On-chain VDF verifier enabling trustless, tamper-resistant randomness on EVM.
Secure and fair randomness on-chain is hard. Block variables are manipulable, and oracles introduce external trust assumptions and costs.
Seedy uses Verifiable Delay Functions (VDFs) based on the Pietrzak scheme to provide:
- Tamper Resistance: A mandatory time delay (
T) prevents predicting/biasing the output randomness (y) after a seedxis known. - Trustless On-Chain Verification: A cryptographic proof (
pi) allows ourSeedyVerifier.solcontract to mathematically validate the VDF computation directly on-chain.
The final randomness is keccak256(y). This approach offers enhanced security guarantees compared to alternatives by verifying the computation proof trustlessly on-chain.
/contracts: Solidity contracts (SeedyVerifier,SeedyCoordinator,Raffleexample)./experiments: TypeScript implementation for off-chain VDF proving (generateProof) and testing./frontend: React/Next.js frontend for theRaffleexample.
- Request: Commit to a seed source (future blockhashes) via
SeedyCoordinator. - Compute: Off-chain prover calculates VDF output
yand proofpiover timeT. - Finalize: Prover submits
x, y, pitoSeedyCoordinator. - Verify:
SeedyCoordinatorcallsSeedyVerifier.verify()for on-chain validation. - Result: Coordinator provides
keccak256(y)as the final random output.
- Prerequisites: Node.js, npm, Foundry.
- Contracts:
cd contracts && forge build && forge test - Experiments (Prover/Test Script):
cd experiments && npm install && node ./dist/index.js - Frontend Demo:
cd frontend && npm install && npm run dev
- SeedyVerifier:
0xd4ee61b3CB112747B534876E4c5F7e60b36E2893 - SeedyCoordinator:
0xf25469bdf21c06aff3f4236b8e0ca1b51c9e5ec6 - Raffle:
0xF918db551C9C9bd8c960582676657b32DcD19b4a
- Dvelop a robust BigNumber library for Solidity.
- Debug and scale the off-chain prover for large
T& target delays. - Explore gas optimizations (e.g., zk-VDF).
- Develop more RNG use cases.