Tutorial — Security & verification
Auditable randomness with VRF
The Tenzro VRF precompile implements ECVRF-EDWARDS25519-SHA512-TAI per RFC 9381 §5.4.1.1 using validator Ed25519 keys. Every output is verifiable on-chain — no off-chain oracle needed.
- Level
- Intermediate
- Time
- ~15 min
- Prerequisites
- Ed25519 keypair
- Stack
- CLI · Solidity
01
Generate a proof
Pass any 32-byte seed; the VRF derives an 80-byte proof and 64-byte deterministic output.
tenzro vrf prove --seed 0x$(openssl rand -hex 32) --out ./vrf.json02
Verify off-chain
Verification is deterministic — same seed and key always produce the same output.
tenzro vrf verify --proof ./vrf.json03
Call from a contract
The VRF_VERIFY precompile at 0x1007 verifies on-chain in one call.
(bool ok, bytes memory out) = address(0x1007).staticcall(
abi.encodePacked(pubKey, proof, seed)
);04
Mint with verified randomness
The NFT factory's mintRandom() consumes the verified output to roll traits.
await tz.call("nft_mint_random", { collection: coll.address, to: buyer });Related