Skip to main content

Crate vrf_contract_verifier

Crate vrf_contract_verifier 

Source
Expand description

RFC 9381 compliant VRF verification library for NEAR smart contracts

This library implements ECVRF-RISTRETTO255-SHA512-ELL2 as specified in RFC 9381, containing only the essential components needed to verify VRF proofs.

Client (browser wasm-worker) responsibilities:

  • Generate VRF keypairs using vrf-wasm
  • Create VRF outputs and proofs using vrf-wasm
  • Send VRF output, proof, and public key to contract

Contract responsibilities:

  • Verify VRF proof matches the claimed output using RFC 9381 standards
  • Use minimal cryptographic operations compatible with NEAR WASM

Re-exports§

pub use types::VrfOutput;
pub use types::VrfPublicKey;
pub use types::VrfProof;
pub use types::VerificationError;

Modules§

constants
types

Functions§

verify_vrf
VRF verification function for NEAR contracts (Vec input for compatibility) Returns the VRF output on successful verification
verify_vrf_bool
Boolean verification for simpler contract usage
verify_vrf_fixed
VRF verification function for NEAR contracts (with fixed-length arrays) Returns the VRF output on successful verification