Skip to main content

prove

Function prove 

Source
pub fn prove(
    secret: &[u8],
    salt: &[u8; 32],
    blueprint: &[u8],
) -> Result<Vec<u8>, String>
Expand description

The Proof Generator. Creates a ZK proof (byte array) that the secret satisfies the blueprint’s rules.

  • secret: the claim data as JSON bytes (e.g. b'{"claim":{"age_years":25}}').
  • salt: 32-byte caller-chosen salt (used to derive binding context).
  • blueprint: the opaque byte array from compile.

§Errors

Returns Err if secret is not valid JSON, if the claim fails the template’s predicates, if hardware entropy is unavailable, or if the internal prove pipeline fails.