OpenAgentID documentation
Source referencesRust module referenceoas-document

oas-document · lineage_section

Declared module signatures, types, configuration, and source documentation.

Source: oas/oas/oas-document/src/lineage_section.rs. SHA-256: 73319761726f6da22a5b6e35caf1353a6f1e0b6b947d04c8f01ffab28d892956.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

lineage_section::LineageSection

The lineage section of an OAS Identity Document.

Contains the cryptographic chain linking an entity to its human root. Required for L1+ conformance on non-root entities.

See OAS Specification §8 for the complete structure.

Examples

use oas_document::lineage_section::LineageSection;

let lineage = LineageSection {
    human_root_did: "did:oas:acme:hmr:alice".to_string(),
    creator_did: "did:oas:acme:hmr:alice".to_string(),
    generation: 0,
    derivation_proof: None,
    human_root_chain: vec![
        "did:oas:acme:ao:research".to_string(),
        "did:oas:acme:hmr:alice".to_string(),
    ],
    org_inclusion_proof: None,
    anchor_refs: None,
};
assert_eq!(lineage.generation, 0);
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct LineageSection {
/// DID of the ultimate human root (HMR, MHR, or ENR).

pub human_root_did: String,
/// DID of the entity that directly created this entity.

pub creator_did: String,
/// Number of derivation steps from human root.

/// 0 = created directly by human root.

pub generation: u32,
/// AgentLineageProof2025 linking this entity to its creator.

#[serde(skip_serializing_if = "Option::is_none")]
pub derivation_proof: Option<AgentLineageProof>,
/// Ordered array of DIDs from this entity to human root.

pub human_root_chain: Vec<String>,
/// Optional Merkle inclusion proof binding this entity to the

/// `OrgLineageRoot` of its creator (an MHR / ENR org). REQUIRED at

/// resolution time when the GAL has an `OrgLineageRoot` for the

/// creator DID. Verification uses BLAKE3; see

/// [`OrgInclusionProof`].

#[serde(skip_serializing_if = "Option::is_none")]
pub org_inclusion_proof: Option<OrgInclusionProof>,
/// References to on-chain or transparency-log anchors attesting to

/// this lineage section's registration.

///

/// Lineage authority is backend-agnostic (see [`AnchorRef`]). An

/// entity MAY be anchored on multiple backends at once - Sigil and an

/// EAS attestation and a transparency log - and verifiers consult the

/// refs for the schemes they trust. A verifier MUST ignore refs whose

/// `scheme` it does not support rather than rejecting the document:

/// unknown schemes are additive, never breaking.

#[serde(skip_serializing_if = "Option::is_none")]
pub anchor_refs: Option<Vec<AnchorRef>>
}

Source line: 35.

lineage_section::AnchorRef

A reference to an on-chain (or transparency-log) anchor attesting to a lineage registration.

Lineage proofs verify offline; lineage authority - proof that the claimed root exists, that this delegation was recorded, and that nothing in the chain is revoked or superseded - is what an anchor backend supplies. The scheme names the backend; the locator addresses the record within it.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnchorRef {
/// The anchor scheme: `sigil`, `eas`, `ctlog`, or a future registered

/// name. Verifiers ignore schemes they do not support.

pub scheme: String,
/// Scheme-specific locator: a transaction hash (`sigil`), an

/// attestation UID (`eas`), a log identifier and leaf index (`ctlog`).

/// Opaque to verifiers that do not implement the scheme.

pub locator: String,
/// Optional inclusion proof binding the locator to the anchor

/// backend's canonical root. Presence semantics are scheme-specific;

/// some schemes (EAS) are self-proving and carry none, others (batch

/// Merkle anchoring) require one.

#[serde(skip_serializing_if = "Option::is_none")]
pub inclusion_proof: Option<AnchorInclusionProof>
}

Source line: 84.

lineage_section::AnchorRef::to_uri

The display form: anchor:<scheme>:<locator>.

pub fn to_uri(&self) -> String;

Source line: 104.

lineage_section::AnchorRef::parse_uri

Parse the display form back into a ref (without a proof).

The locator may itself contain colons (e.g. ctlog log-id:index forms), so parsing splits at the first two colons only.

pub fn parse_uri(uri: &str) -> Option<Self>;

Source line: 112.

lineage_section::AnchorInclusionProof

An inclusion proof binding an [AnchorRef] locator to its backend's canonical root.

The shape is the Merkle family generalization used by [OrgInclusionProof], named by proof_type so a backend can register others: merkle-blake3 (Sigil, transparency logs), eas-attestation (EAS, where the attestation itself is the proof and root is the schema UID), or future registered types.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct AnchorInclusionProof {
/// The proof family: `merkle-blake3`, `eas-attestation`, or a future

/// registered name. Verifiers ignore types they do not support.

pub proof_type: String,
/// The root this proof binds to (hex digest or backend-native form).

pub root: String,
/// The leaf the anchored registration hashes to.

pub leaf_hash: String,
/// Ordered sibling path from leaf to root (Merkle-family proofs).

/// Empty for self-proving schemes.

#[serde(default)]
pub path: Vec<MerkleProofNode>
}

Source line: 136.

lineage_section::MerkleDirection

Direction of a sibling node in a Merkle proof path.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub enum MerkleDirection {
    /// Sibling is on the left; reconstructed hash combines as
    /// `H(sibling || current)`.
    Left,
    /// Sibling is on the right; reconstructed hash combines as
    /// `H(current || sibling)`.
    Right,
}

Source line: 156.

lineage_section::MerkleProofNode

One step in a Merkle inclusion proof path.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MerkleProofNode {
/// `blake3:`-prefixed hex of the sibling hash at this level.

pub sibling_hash: String,
/// Direction of the sibling relative to the current node.

pub direction: MerkleDirection
}

Source line: 168.

lineage_section::OrgInclusionProof

Merkle inclusion proof binding a child entity to an OrgLineageRoot.

Canonicalization rules (verified by oas-resolve::sigil_guard with the BLAKE3-32 hash function):

  1. Leaf hash: blake3: + hex(BLAKE3(child_did_utf8_bytes)). The org commits to a tree of child DIDs.
  2. Internal nodes: at each level, combine the running hash and the sibling per direction. LeftH(sibling || current); RightH(current || sibling). Both halves are taken as raw 32-byte BLAKE3 outputs (after stripping the blake3: prefix).
  3. Root match: the final reconstructed root MUST equal both proof.merkle_root and the merkle_root of the OrgLineageRoot returned by the GAL for the creator DID.
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct OrgInclusionProof {
/// `blake3:`-prefixed hex of the org's Merkle root. MUST equal the

/// on-chain `OrgLineageRoot.merkle_root`.

pub merkle_root: String,
/// `blake3:`-prefixed hex of the leaf — `BLAKE3(child_did)`.

pub leaf_hash: String,
/// Ordered path of sibling hashes from leaf to root.

pub path: Vec<MerkleProofNode>
}

Source line: 192.

On this page