Skip to content

aakash4dev/vrfcall

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

⚙️ VRFCall — Client for VRFChain Blockchain

VRFCall is a lightweight client application for interacting with the VRFChain blockchain to generate and verify verifiable random numbers.


🚀 Quick Start

Prerequisites

  • Go 1.22+
  • VRFChain node running (Tendermint RPC: http://localhost:26657, REST API: http://localhost:1317)

Installation

git clone https://github.com/aakash4dev/vrfcall.git
cd vrfcall
go mod download

Run

go run main.go

The application will:

  1. Check/create admin account
  2. Verify account balance (needs ≥3 tokens)
  3. Generate verifiable random number
  4. Retrieve and verify the random number

📁 Project Structure

vrfcall/
├── main.go                 # Application entry point
├── chain/                  # Blockchain interaction functions
│   ├── checkBalance.chain.go
│   ├── createAccount.chain.go
│   ├── PostGeneratePsudoRandomNumber.go
│   ├── GetPsudoRandomNumber.go
│   └── GetVerifyRandomNumber.go
├── config/                 # Configuration and connection setup
│   └── chain.go
├── accounts/               # Keyring and account data (auto-generated)
└── docs/                   # Additional documentation
    ├── CONTRIBUTING.md
    ├── CODE_OF_CONDUCT.md
    └── SECURITY.md

🔌 Configuration

Default connection settings (in config/chain.go):

  • Tendermint RPC: http://localhost:26657
  • REST API: http://localhost:1317
  • Address Prefix: cosmos
  • Gas Limit: 70000000

To modify, edit config/chain.go.


📋 VRF Parameters

The client sends MsgCreateVerifiableRandomNumber with:

Parameter Description
Creator Sender's blockchain address
Shaseed SHA256 hash of seed data (32 bytes)
Publickey ECDSA public key (JSON-marshaled)
R, S ECDSA signature components (64 bytes)
Maxrange Maximum range for random number

Seed Data includes: LatestPod, StationID, NumberOfPodSubmitters, LatestStationBlockNumber, LatestStationBlockHash, Sender.


🌐 API Endpoints

  • POST MsgCreateVerifiableRandomNumber - Generate random number
  • GET /aakash4dev/verifiablerandomnumber/vrf/getpsudorandomnumber - Get random number
  • GET /aakash4dev/verifiablerandomnumber/vrf/verify_random_number/{shaSeed}/{maxRange} - Verify number

📚 Documentation


👨‍💻 Author

Aakash
🌐 aakash4dev.comXLinkedIn


📜 License

Licensed under the MIT License.

About

VRFCall is a lightweight client application designed to interact with the https://github.com/aakash4dev/vrfchain blockchain.

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

No packages published

Languages