Architecture
SimpleVrf is composed of several modular components that interact to provide decentralized, verifiable randomness:
Components
- ECVRF Package: TypeScript implementation of Elliptic Curve Verifiable Random Function (RFC 9381)
- SimpleVrf Smart Contract: Fuel contract that manages requests, authorities, and proof verification
- Worker: Off-chain service that monitors the contract, generates proofs, and submits them
- CLI: Command-line interface for interacting with the contract
- Web App: (Optional) Frontend for documentation and interaction
High-Level Flow
- A user or contract requests randomness from the SimpleVrf contract
- The request is stored on-chain
- The off-chain worker monitors for unfulfilled requests
- The worker generates a VRF proof and submits it to the contract
- The contract verifies the proof and triggers a callback with the random value
Diagram
Component Interactions
- The CLI and web app interact with the contract for management and monitoring
- The worker automates proof generation and submission
- The ECVRF package is used by the worker for cryptographic operations