VRFChain is a custom blockchain built using Ignite CLI that implements Verifiable Random Functions (VRFs) — cryptographic primitives that generate provably fair and verifiable random numbers on-chain.
This chain allows anyone to create, store, and verify randomness in a decentralized manner — enabling use cases like lotteries, gaming, fair leader election, and secure random selection.
-
✅ Generate On-Chain Random Numbers using verifiable randomness
-
🔐 Verify Random Outputs with public-key cryptography
-
⚙️ Cosmos SDK + Ignite CLI powered blockchain module
-
📡 Simple REST Endpoints:
POST /CreateVerifiableRandomNumber— Create random number requestGET /VerifyNumber— Verify generated number against proof
- User submits input (
shaSeed,publicKey,r,s,maxRange) to generate a verifiable random number. - The chain module computes the random number using VRF cryptography.
- A proof is attached that allows anyone to verify the randomness.
- Using
GET /VerifyNumber, users can validate that the number was truly random and not tampered with.
This chain was initialized with the following Ignite commands:
ignite scaffold module vrf
ignite scaffold message create-verifiable-random-number shaseed publickey r s max-range --module vrfThese commands create the vrf module and the message handler for verifiable randomness generation.
To start the local blockchain node:
ignite chain serveThis command:
- Builds and serves the blockchain locally
- Starts REST and gRPC servers for module interaction
- Automatically generates the client, daemon, and configuration files
| Method | Endpoint | Description |
|---|---|---|
| POST | /CreateVerifiableRandomNumber |
Create and broadcast a VRF-based random number transaction |
| GET | /VerifyNumber |
Verify a previously generated number and proof |
- 🎰 Decentralized lotteries and on-chain games
- 🗳️ Random validator selection
- 🎲 Fair random draws in DAOs
- 🔄 Randomized asset distribution in NFTs
| Component | Technology |
|---|---|
| Framework | Ignite CLI |
| Blockchain SDK | Cosmos SDK |
| Language | Go (Golang) |
| Module | Custom vrf Cosmos module |
| Cryptography | Verifiable Random Function (VRF) |
vrfchain/
├── x/vrf/ # VRF module logic
│ ├── keeper/ # State management and verification
│ ├── types/ # Message and type definitions
│ └── module.go # Cosmos SDK module entry point
├── app/ # Chain initialization and configuration
├── cmd/ # CLI entry points
├── config.yml # Ignite configuration
└── README.md
To test transactions:
# Create random number
ignite tx vrf create-verifiable-random-number <shaSeed> <publicKey> <r> <s> <maxRange> --from <key>
# Verify result
ignite query vrf verify-number <number-id>- 🔄 Add on-chain proof verification logic
- 🧮 Integrate BLS or Ed25519-based VRF
- 🌐 Add front-end dashboard for randomness requests
- ☁️ Enable Tendermint RPC interaction
This project is licensed under the MIT License.
Aakash 🌐 aakash4dev.com X (Twitter) • LinkedIn • Medium