Sigil documentation
ReferenceRust referencesigil-zk

sigil-zk · traits

Source declarations, signatures and documentation for traits.

Source: sigil/node/sigil-zk/src/traits.rs. SHA-256: 260212a22761e6942d870d29d7c73f4e03d2d74faf682c6a40225f00a40a5c66.

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.

traits::Prover

Trait for ZK proof generation, implemented by Block Producers.

A Prover takes a fully-executed block (with known pre/post state roots) and produces a [BlockProof] that any [Verifier] can check without re-executing the block.

pub trait Prover: Send + Sync {
    /// Generate a proof of correct block execution.
    ///
    /// # Arguments
    /// * `block` - The block whose execution is being proved.
    /// * `pre_state_root` - The state root before executing this block.
    /// * `post_state_root` - The state root after executing this block.
    ///
    /// # Errors
    /// Returns [`ZkError`] if proof generation fails (e.g., trace collection,
    /// circuit constraints unsatisfied, resource limits exceeded).
    fn prove(
        &self,
        block: &Block,
        pre_state_root: SigilHash,
        post_state_root: SigilHash,
    ) -> Result<BlockProof, ZkError>;

    /// Returns the proving system identifier (e.g., "jolt-v1", "hash-commit-v1").
    fn proving_system(&self) -> &str;

    /// Returns the verification key hash for this prover's circuit.
    ///
    /// This identifies the specific circuit version and allows verifiers to
    /// select the correct verification key.
    fn verification_key_hash(&self) -> SigilHash;
}

Source line: 17.

traits::Verifier

Trait for ZK proof verification, used by Block Validators.

A Verifier checks a [BlockProof] and returns whether the proof is valid. Verification must complete within the target time (10ms) to maintain block processing throughput.

pub trait Verifier: Send + Sync {
    /// Verify a block proof.
    ///
    /// Must complete in < 10ms to meet Sigil's performance targets.
    ///
    /// # Arguments
    /// * `proof` - The block proof to verify.
    ///
    /// # Returns
    /// `Ok(true)` if the proof is valid, `Ok(false)` if the proof is
    /// cryptographically valid but does not match the claimed public inputs,
    /// or `Err` if verification itself fails.
    fn verify(&self, proof: &BlockProof) -> Result<bool, ZkError>;

    /// Returns the list of proving system identifiers this verifier supports.
    fn supported_systems(&self) -> Vec<String>;
}

Source line: 50.

On this page