Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Proof

Zero-knowledge proof data for validating a privacy-preserving transaction.This structure contains all the cryptographic proof elements needed to verify that a transaction is valid without revealing private information. # Cryptographic Components - proof: The zero-knowledge proof demonstrating transaction validity - root: The Merkle root that the transaction is based on - input_nullifiers: Nullifiers proving input ownership and preventing double-spending - output_commitments: New commitments for the transaction outputs - public_amount: The public amount that must be consistent with external data - ext_data_hash: Hash of external data for consistency verification

Fully qualified path: obscura::structs::Proof

#[derive(Debug, Drop, PartialEq, Serde)]
pub struct Proof {
    pub proof: Span<felt252>,
    pub root: u256,
    pub input_nullifiers: Array<u256>,
    pub output_commitments: Array<u256>,
    pub public_amount: u256,
    pub ext_data_hash: u256,
}

Members

proof

The zero-knowledge proof demonstrating the validity of the transaction. Verified by the external proof verifier contract.

Fully qualified path: obscura::structs::Proof::proof

pub proof: Span<felt252>

root

The Merkle root that the transaction inputs are based on. Must be a known root from the recent history.

Fully qualified path: obscura::structs::Proof::root

pub root: u256

input_nullifiers

Nullifiers for the input commitments, proving ownership and preventing double-spending. Each nullifier can only be used once and reveals no information about the input.

Fully qualified path: obscura::structs::Proof::input_nullifiers

pub input_nullifiers: Array<u256>

output_commitments

New commitments for the transaction outputs. These will be inserted into the Merkle tree after verification.

Fully qualified path: obscura::structs::Proof::output_commitments

pub output_commitments: Array<u256>

public_amount

The public amount that must be consistent with the external data. Calculated as ext_amount - fee and used for zero-knowledge proof verification.

Fully qualified path: obscura::structs::Proof::public_amount

pub public_amount: u256

ext_data_hash

Hash of the external data for consistency verification. Ensures the proof corresponds to the provided external data.

Fully qualified path: obscura::structs::Proof::ext_data_hash

pub ext_data_hash: u256