Sigil documentation
ReferenceRust referencesigil-zk

sigil-zk · proof

Source declarations, signatures and documentation for proof.

Source: sigil/node/sigil-zk/src/proof.rs. SHA-256: 4957d3c16aefecc25268bf2e62fb39b3eb29da582bb1607920cbbf052bc46878.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

proof::BlockProof

A zero-knowledge proof of correct block execution.

Generated by a Block Producer after executing all transactions in a block. The proof attests that executing the transactions against parent_state_root produces post_state_root, without revealing the execution details.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct BlockProof {
/// Height of the block this proof covers.

pub block_height: u64,
/// Hash of the block being proved.

pub block_hash: SigilHash,
/// State root before block execution.

pub parent_state_root: SigilHash,
/// State root after block execution.

pub post_state_root: SigilHash,
/// Merkle root of the transactions in the block.

pub tx_root: SigilHash,
/// Merkle root of the transaction receipts.

pub receipt_root: SigilHash,
/// Identifier for the proving system used (e.g., "jolt-v1", "hash-commit-v1").

pub proving_system: String,
/// The raw proof bytes (format is proving-system-dependent).

pub proof_bytes: Vec<u8>,
/// Public inputs that both prover and verifier agree on.

pub public_inputs: PublicInputs,
/// Hash of the verification key (identifies the circuit).

pub verification_key_hash: SigilHash,
/// OAS DID of the prover (Block Producer).

pub prover_did: String,
/// Time taken to generate this proof, in milliseconds.

pub proof_generation_time_ms: u64
}

Source line: 17.

proof::PublicInputs

Public inputs that both prover and verifier agree on.

These values are committed to by the proof and verified against the block. Any mismatch between these values and the actual block data means the proof is invalid.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct PublicInputs {
/// State root before execution.

pub pre_state_root: SigilHash,
/// State root after execution.

pub post_state_root: SigilHash,
/// Block hash being proved.

pub block_hash: SigilHash,
/// Number of transactions in the block.

pub tx_count: u32,
/// Total gas consumed by the block.

pub gas_used: u64
}

Source line: 50.

proof::PublicInputs::to_bytes

Serialize to a deterministic byte representation for proof verification.

Layout: pre_state_root (32) | post_state_root (32) | block_hash (32) | tx_count (4 LE) | gas_used (8 LE) = 108 bytes total.

pub fn to_bytes(&self) -> Vec<u8>;

Source line: 68.

proof::PublicInputs::from_bytes

Deserialize from the deterministic byte representation.

Expects exactly 108 bytes in the layout produced by [Self::to_bytes].

pub fn from_bytes(bytes: &[u8]) -> Result<Self, ZkError>;

Source line: 81.

proof::PublicInputs::commitment

Compute a commitment hash of these public inputs.

Used for binding the proof to specific public inputs.

pub fn commitment(&self) -> SigilHash;

Source line: 122.

proof::HashCommitmentProof

A hash-commitment proof used as a fallback when full ZK is not available.

This is not a true zero-knowledge proof. It commits to the execution trace and state transition hashes, signed by the prover's Ed25519 key. Validators verify the signature against the prover's public key to confirm attribution, but cannot verify correctness of execution without re-executing (or trusting the prover).

Phase 2 (Jolt Pro) replaces this with real zkSNARKs providing succinctness, privacy, and soundness.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct HashCommitmentProof {
/// Height of the block this commitment covers.

pub block_height: u64,
/// BLAKE3 hash of the full execution trace.

pub execution_trace_hash: SigilHash,
/// BLAKE3 hash of the state transition (pre_root || post_root || tx_root).

pub state_transition_hash: SigilHash,
/// Ed25519 signature by the prover over (execution_trace_hash || state_transition_hash).

/// 64 bytes.

pub prover_signature: Vec<u8>
}

Source line: 138.

proof::HashCommitmentProof::try_to_zk_proof

Convert this hash-commitment proof into a [sigil_core::block::ZkProof] for embedding in a block header.

Serializes the proof to JSON bytes as the proof_bytes field, sets the proving system to hash-commit-v1, and includes the execution trace and state transition hashes as public inputs.

pub fn try_to_zk_proof(&self) -> Result<sigil_core::block::ZkProof, ZkError>;

Source line: 157.

proof::HashCommitmentProof::to_zk_proof

Convert this hash-commitment proof into a [sigil_core::block::ZkProof].

This convenience wrapper no longer silently emits empty proof bytes if serialization fails; callers that can recover should use [Self::try_to_zk_proof].

pub fn to_zk_proof(&self) -> sigil_core::block::ZkProof;

Source line: 178.

proof::HashCommitmentProof::from_zk_proof

Deserialize a [HashCommitmentProof] from a [sigil_core::block::ZkProof].

Returns None if the proving system is not hash-commit-v1 or if the proof bytes cannot be deserialized.

pub fn from_zk_proof(zk: &sigil_core::block::ZkProof) -> Option<Self>;

Source line: 187.

On this page