vrf_contract_verifier/lib.rs
1//! RFC 9381 compliant VRF verification library for NEAR smart contracts
2//!
3//! This library implements ECVRF-RISTRETTO255-SHA512-ELL2 as specified in RFC 9381,
4//! containing only the essential components needed to verify VRF proofs.
5//!
6//! Client (browser wasm-worker) responsibilities:
7//! - Generate VRF keypairs using vrf-wasm
8//! - Create VRF outputs and proofs using vrf-wasm
9//! - Send VRF output, proof, and public key to contract
10//!
11//! Contract responsibilities:
12//! - Verify VRF proof matches the claimed output using RFC 9381 standards
13//! - Use minimal cryptographic operations compatible with NEAR WASM
14
15pub mod constants;
16pub mod types;
17mod verifiers;
18
19pub use verifiers::{
20 verify_vrf,
21 verify_vrf_bool,
22 verify_vrf_fixed
23};
24pub use types::{
25 VrfOutput,
26 VrfPublicKey,
27 VrfProof,
28 VerificationError
29};
30
31#[cfg(test)]
32mod test;
33
34#[cfg(all(test, feature = "near"))]
35mod test_near;