MARS documentation
Rust librariesmars-shard

mars-shard · gal

Public declarations and documentation for mars-shard::gal.

Prototype / draft — separate from production registry operations.

Package: mars-shard · Workspace version: 0.1.0 · Module: gal

Status: prototype / draft. This is not the production registry topology.

This reference follows declared modules and public syntax, including public implementation methods. Function bodies and constant values are omitted. Feature conditions are retained. Private-module re-exports and trait resolution require the compiler; not every declaration is a root import.

gal::GalEntryType

The type of anchor stored in the Global Anchor Layer.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum GalEntryType {
    /// An HMR identity anchor.
    HmrAnchor,
    /// An MHR (multi-human root) identity anchor.
    MhrAnchor,
    /// Root of an organization lineage chain.
    OrgLineageRoot,
    /// A revocation record for a previously published entry.
    RevocationRecord,
    /// Assignment of a DID to a specific RSL shard.
    ShardAssignment,
    /// Topology metadata for a shard in the network.
    ShardTopologyEntry,
}

Source line: 19.

gal::GalEntryType::all

Returns all variants.

pub fn all() -> &'static [GalEntryType; 6];

Source line: 36.

gal::GalEntry

A GAL entry stored on-chain in the Sigil execution layer.

Only root-level anchors live in GAL. Full entries stay in RSL shards.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct GalEntry {
/// The type of GAL anchor.

pub entry_type: GalEntryType,
/// The DID this anchor references.

pub did: String,
/// SHA-256 content hash of the full entry in RSL.

pub content_hash: String,
/// DID of the publisher who created the anchor.

pub publisher_did: String,
/// When this anchor was created.

pub created_at: chrono::DateTime<chrono::Utc>,
/// When this anchor was last updated.

pub updated_at: chrono::DateTime<chrono::Utc>,
/// Which RSL shard holds the full entry.

pub shard_id: String,
/// Merkle inclusion proof from the shard (optional).

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

Source line: 57.

gal::GalEntry::validate

Validate that required fields are non-empty.

pub fn validate(&self) -> Result<(), ShardError>;

Source line: 79.

gal::GalEntry::hash

Compute the SHA-256 hash of this entry's core fields for Merkle tree insertion.

pub fn hash(&self) -> [u8; 32];

Source line: 101.

gal::HmrAnchorData

Anchor data specific to an HMR (Human Root) entry.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct HmrAnchorData {
/// DID of the HMR.

pub hmr_did: String,
/// DID of the entry being anchored.

pub entry_did: String,
/// SHA-256 hash of the item data.

pub item_data_hash: String,
/// Proof-of-humanity attestation reference.

pub proof_of_humanity: String
}

Source line: 121.

gal::MhrAnchorData

Anchor data specific to an MHR (Multi-Human Root) entry.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct MhrAnchorData {
/// DID of the MHR.

pub mhr_did: String,
/// Hash of the threshold ceremony.

pub ceremony_hash: String,
/// Threshold required (e.g. 3 of 5).

pub threshold: u8,
/// DIDs of participants in the MHR ceremony.

pub participants: Vec<String>
}

Source line: 139.

gal::OrgLineageRootData

Anchor data for an organization lineage root.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct OrgLineageRootData {
/// DID of the organization.

pub org_did: String,
/// DID of the originating human root.

pub human_root_did: String,
/// Ordered chain of DIDs from root to org.

pub lineage_chain: Vec<String>,
/// Generation depth from human root.

pub depth: u32
}

Source line: 157.

gal::RevocationRecord

A record of a revoked entry.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
pub struct RevocationRecord {
/// DID of the revoked entry.

pub entry_did: String,
/// DID of the entity that performed the revocation.

pub revoked_by: String,
/// Human-readable reason for revocation.

pub reason: String,
/// When the revocation occurred.

pub revoked_at: chrono::DateTime<chrono::Utc>,
/// Current propagation status across shards.

pub propagation_status: PropagationStatus
}

Source line: 175.

gal::PropagationStatus

Status of revocation propagation across shards.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum PropagationStatus {
    /// Revocation initiated, not yet propagated.
    Pending,
    /// Revocation being propagated to shards.
    Propagating,
    /// Revocation fully propagated to all shards.
    Complete,
}

Source line: 194.

gal::GalMerkleTree

A simple SHA-256 Merkle tree for GAL entries.

Entries are hashed leaf-first, then combined pairwise up to the root. Supports inclusion proofs and verification.

pub struct GalMerkleTree {

}

Source line: 211.

gal::GalMerkleTree::new

Create a new empty Merkle tree.

pub fn new() -> Self;

Source line: 218.

gal::GalMerkleTree::insert

Insert a GAL entry as a leaf in the tree.

pub fn insert(&mut self, entry: &GalEntry);

Source line: 223.

gal::GalMerkleTree::len

Returns the number of leaves in the tree.

pub fn len(&self) -> usize;

Source line: 228.

gal::GalMerkleTree::is_empty

Returns true if the tree has no leaves.

pub fn is_empty(&self) -> bool;

Source line: 233.

gal::GalMerkleTree::root

Compute the Merkle root hash. Returns all-zeros for an empty tree.

pub fn root(&self) -> [u8; 32];

Source line: 238.

gal::GalMerkleTree::proof

Generate an inclusion proof for the leaf at index.

Returns None if index is out of bounds.

pub fn proof(&self, index: usize) -> Option<Vec<Vec<u8>>>;

Source line: 248.

gal::GalMerkleTree::verify

Verify an inclusion proof against a root hash.

index is the original leaf position.

pub fn verify(root: &[u8; 32], entry_hash: &[u8; 32], proof: &[Vec<u8>], index: usize) -> bool;

Source line: 258.

Source provenance

Source: mars-shard/src/gal.rs · SHA-256 6332d9bc8eb410ac0e85c3b452088bcdc4f73a52c749d7cc8eae737336f9c44e. Package overview.

On this page