Secret VRF for IBC with IBC-Hooks
Verifiable on-chain random number generator for the entire Cosmos.
Last updated
Was this helpful?
Verifiable on-chain random number generator for the entire Cosmos.
Last updated
Was this helpful?
Secret VRF is a provably fair and verifiable on-chain random number generator (RNG) that enables smart contracts to access random values without compromising security or usability. Coupled with cross-chain interoperable smart contracts using , Secret Network enables developers and projects across the Cosmos access to state-of-the-art on-chain RNG.
Use Secret VRF to build reliable smart contracts for any application that relies on unpredictable outcomes:
NFT Minting: Utilize randomness for features like unordered minting, trait randomization, and identity numbering, enhancing the authenticity and security of NFT collections.
Web3 Gaming: Apply randomness in gambling, damage calculation, loot boxes, and boss drops to build trust among players by ensuring fairness and preventing any player from having an unfair advantage.
DAO Operations: Employ randomness for wallet initialization, task assigning, unordered voting/liquidations, and order book ordering, facilitating equitable and secure decentralized governance and operations.
To use SecretVRF on any IBC-enabled chain with IBC hooks, all that is required is:
An IBC transfer channel between Secret Network and the consumer chain that receives randomness.
Uploading the RNG Consumer Contract to your chain and directing it to your chain's transfer channel
Git clone
the IBC hooks randomness repository:
Once you have updated the transfer channels, compile the contract:
Upload the compiled contract:
Instantiate the contract with the returned code_id
:
Now that you've instantiated your randomness contract, all that's left is to request randomness! Simply execute request_random:
A transaction hash will be returned:
And then view the magic of cross-chain randomness with IBC hooks π:
Congrats! You've just sent a verifiable on-chain random byte
with SecretVRF π.
Secret VRF revolutionizes blockchain applications by providing a secure and verifiable source of randomness, critical for fairness in NFT minting, gaming, and DAO operations. Its seamless integration with IBC hooks enables cross-chain interoperability, allowing developers across the Cosmos ecosystem to build more reliable and elegant smart contracts.
Update the and the to the channel-id for your IBC-enabled chain:
Upon successful , a code_id
is returned:
Upon succesful , a contract_address
is returned:
Navigate to the recently for your contract:
If you have any questions, join our and a Secret developer will assist you ASAP.