Awesome
vrf-rs
vrf-client-starknet-rs
is a fork of vrf-rs, an open source implementation of Verifiable Random Functions (VRFs). This particular fork supports the verification function implemented in VRF StarkNet. In the future this project will interact with StarkNet to make random number calculations and proofs.
The VRF spec is described in VRF-draft-05. We use a modified SECP256K1_SHA256_TAI
with keccak rather than sha256 since sha256 is not available in cairo with such large inputs.
The library can be built using cargo
and the examples can be executed with:
Running
Create two files, wallet-address.txt and wallet-secret.txt in the root directory. List your addresses and secrets in a list. Multiple wallets allow better throughput of the vrf.
cargo build
NETWORK=<choose network> VRF_SECRET=<your vrf secret key> ORACLE_ADDRESS=<address of the deployed oracle contract> cargo run --example client
Until this project has the capabilities to interect with StarkNet itself it can be viewed as a script that take inputs from the blockchain and spits out a result to be put manually back onto the blockchain.
License
vrf-client-starknet-rs
is published under the [MIT license][license].