NebulaVRF is a Soroban smart contract that provides verifiable, on-chain randomness using BLS12-381 and a commit–reveal scheme. This repo contains the testnet contract and integration docs; payload generation utilities and the local API live in vrf-core.
contracts/nebula-vrf: Soroban contract implementationUSAGE.md: Testnet guide for using the contractLICENSE,CONTRIBUTING.md: OSS metadata
Related repo:
vrf-core: helper utilities, sample payload generator, and local API (NebulaVRF/vrf-core)
The contract exposes:
commit(user, commitment, pubkey)reveal(user, seed, salt, signature) -> BytesN<32>derive_random(randomness, context) -> u64get_commitment(user) -> Option<BytesN<32>>get_pubkey(user) -> Option<BytesN<96>>
Randomness flow:
- User commits
sha256(seed || salt)and their BLS G1 public key. - User reveals
seed,salt, and a BLS G2 signature over the commitment. - Contract verifies and returns the randomness (
BytesN<32>). - Apps derive deterministic randomness with
derive_random.
NebulaVRF ensures randomness is verifiable, deterministic for auditors, and unbiased through the commit–reveal process.
The contract expects uncompressed points:
- Public Key (G1): 96 bytes
- Signature (G2): 192 bytes
DST (must match off-chain signing):
NEBULA-VRF-V01-BLS12381G2
Message format:
m = sha256(seed || salt)
From the repo root:
cd vrf-testnet/contracts/nebula-vrf
stellar contract buildRun tests:
cd vrf-testnet/contracts/nebula-vrf
cargo testSee DEPLOYMENT.md for build and deploy instructions (testnet).
Current deployed contract:
- Contract ID:
CBLC5COYONIRCPWWCRNE6S2EOYJ7IQOWI7RUDG5ZVPHCLZW2KXFFCK2Q - Network: Soroban Testnet
Full testnet usage is documented in USAGE.md.
In the vrf-core repo:
cd vrf-core
cargo run --example sample_payloadsThis generates valid seed, salt, commitment, pubkey, signature in hex and base64.
The local payload API lives in the vrf-core repo:
(NebulaVRF/vrf-core)
cd vrf-core
cargo run --bin nebula_vrf_apiThen:
GET http://localhost:3000/payloadsGET http://localhost:3000/payloads?seed_len=8&salt_len=8
Response format:
{
"hex": { ... },
"base64": { ... }
}
.
├── contracts/
│ └── nebula-vrf/
│ ├── src/
│ │ ├── bls.rs
│ │ ├── errors.rs
│ │ ├── lib.rs
│ │ ├── storage.rs
│ │ ├── test.rs
│ │ └── vrf.rs
│ ├── Cargo.toml
│ └── README.md
├── Cargo.toml
├── USAGE.md
├── DEPLOYMENT.md
├── LICENSE
└── CONTRIBUTING.md
LICENSE(MIT)CONTRIBUTING.md
If you want additional OSS files, we can add:
SECURITY.mdCHANGELOG.md- GitHub issue templates
Open an issue with:
- steps to reproduce
- expected vs actual behavior
- logs or error output