DocsRust SDK
Rust SDK (crate)
The nebula-vrf crate helps you generate consistent payloads for:
- Local testing
- Backend services
- Creating commit/reveal inputs for the on-chain contract
Crate: https://crates.io/crates/nebula-vrf
Install
[dependencies]
nebula-vrf = "0.1"Generate a payload for commit/reveal
use nebula_vrf::SamplePayload;
fn main() -> Result<(), String> {
let payload = SamplePayload::generate(8, 8)?;
// Stellar Lab expects base64 for Bytes/BytesN parameters.
println!("seed_b64: {}", payload.seed_base64());
println!("salt_b64: {}", payload.salt_base64());
println!("commitment_b64: {}", payload.commitment_base64()); // 32 bytes
println!("pubkey_b64: {}", payload.pubkey_base64()); // 96 bytes (G1, uncompressed)
println!("sig_b64: {}", payload.signature_base64()); // 192 bytes (G2, uncompressed)
Ok(())
}Security note
The sample payload utilities are meant to help you get started quickly. Production systems should implement:
- entropy collection appropriate for your threat model
- key management (HSM / vault / custody) appropriate for your environment