Sigil documentation
ReferenceRust referencesigil-zk

sigil-zk · lineage_proof

Source declarations, signatures and documentation for lineage_proof.

Source: sigil/node/sigil-zk/src/lineage_proof.rs. SHA-256: e05033b0e169cb18c2e314a3401f2cff26ad35fdf5d770677d8b1aa3c033949b.

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.

lineage_proof::LineageNode

Snapshot of the on-chain GAL view of a single DID, used as input to [verify_structural_chain]. Higher layers populate this from sigil-core::gal records.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct LineageNode {
/// The subject DID.

pub did: String,
/// One of `"hmr"`, `"mhr"`, `"enr"`, or `"agent"` (or any

/// non-root kind tag).

pub kind: String,
/// On-chain status: `"active"`, `"rotating"`, `"revoked"`.

pub status: String,
/// True when GAL `gal_check_revocation` returned `revoked: true` for

/// this DID. Tracked separately from `status` because revocation may

/// cascade independently of status.

pub revoked: bool
}

Source line: 26.

lineage_proof::LineageNode::is_root

True when this node represents a terminal root anchor.

pub fn is_root(&self) -> bool;

Source line: 42.

lineage_proof::LineageError

Outcome of a structural lineage check.

#[derive(Debug, Clone, PartialEq, Eq, thiserror::Error)]
pub enum LineageError {
    /// Chain is empty.
    #[error("empty lineage chain")]
    Empty,
    /// One of the nodes is revoked on the GAL.
    #[error("node {did} is revoked")]
    Revoked {
        /// The revoked DID.
        did: String,
    },
    /// One of the non-terminal nodes has a non-active status.
    #[error("node {did} has non-active status: {status}")]
    NonActive {
        /// The DID with the non-active status.
        did: String,
        /// The reported status.
        status: String,
    },
    /// The terminal node is not a recognized root kind.
    #[error("terminal node {did} has non-root kind {kind:?}")]
    TerminalNotRoot {
        /// The terminal DID.
        did: String,
        /// The reported (non-root) kind.
        kind: String,
    },
    /// A non-terminal node was reported as a root kind, which means the
    /// lineage chain is structurally invalid (a root cannot have a
    /// parent).
    #[error("non-terminal node {did} is a root kind {kind:?}")]
    InternalNodeIsRoot {
        /// The internal DID.
        did: String,
        /// The reported (root) kind.
        kind: String,
    },
}

Source line: 49.

lineage_proof::LineageVerifier

Verifier abstraction so a future ZK-wrapped variant can plug in without changing call sites.

pub trait LineageVerifier {
    /// Verify the lineage chain. Implementations may add cryptographic
    /// signature or zero-knowledge checks; the structural checks below
    /// are the minimum every implementation must perform.
    fn verify(&self, chain: &[LineageNode]) -> Result<(), LineageError>;
}

Source line: 89.

lineage_proof::StructuralLineageVerifier

Structural-only verifier: enforces the four invariants documented at the module level. Other verifiers (cryptographic, ZK-wrapped) call this internally and add their own checks on top.

pub struct StructuralLineageVerifier;

Source line: 99.

lineage_proof::verify_structural_chain

The reference structural check. Same logic as StructuralLineageVerifier::verify but exposed as a free function so it is easy to call from contexts that don't want to hold a verifier instance.

pub fn verify_structural_chain(chain: &[LineageNode]) -> Result<(), LineageError>;

Source line: 111.

On this page