Skip to main content

zk_gated_consume

Function zk_gated_consume 

Source
pub fn zk_gated_consume(
    q: &mut NQuin,
    reusable: bool,
    proof_verified: bool,
) -> bool
Expand description

ZK-gated consumption: a linear resource may be exhausted only if a zero-knowledge proof of entitlement verifies (the witness stays private). Composes the verification boolean — produced by zk_proofs / legal_compose::zk_eligibility — with the linear consume-once discipline. Consumes (and returns true) iff the proof holds AND the resource is available. The webizen-VM opcode dispatch that invokes this gate is a separate, out-of-(this-crate-scope) wiring step.