Skip to main content

Layer 0 · Identity & naming

Canonical reference: digstore-core::capsule, digstore-core::urn. Addressing grammar continues in URN & addressing.

store — the on-chain identity

A store is an on-chain identity: store_id: Bytes32, which is the CHIP-0035 DataLayer singleton launcher id (the launcher coin id). It is the only mutable-identity anchor; everything else is derived per-generation. Host-side it is persisted as hex in config.toml (digstore-store/config.rs:10,40). verify_module_root binds the store identity to this on-chain launcher id (digstore-compiler/data_section.rs:209-213, 286-288).

capsule — one immutable generation

A capsule is the identity of one immutable generation: the pair (store_id, root_hash), canonical string storeId:rootHash (lowercase hex : lowercase hex).

// digstore_core::capsule::Capsule { store_id, root_hash }
Capsule::canonical() // = format!("{}:{}", store_id.to_hex(), root_hash.to_hex())
Capsule::from_canonical() // requires EXACTLY two ':'-segments of valid 32-byte hex
  • canonical() / from_canonicalcapsule.rs:27-62.
  • Codec encoding is store_id(32) || root_hash(32), big-endian Chia-streamable (capsule.rs:70-84).
  • The capsule is a pure naming layer and MUST NOT alter Urn::canonical() / Urn::retrieval_key() (regression-locked, capsule.rs:12-15).

store = an ordered sequence of capsules

A store is a sequence of capsules, one per commit / root-advance. The ordered root list is the RootHistory (oldest→newest), persisted host-side as GenerationState { id: u64, root, timestamp } and embedded in the compiled module as the RootHistory section.

A Urn names a capsule iff its root_hash is Some:

// urn.rs:88-93
Urn { chain, store_id, root_hash: Option<Bytes32>, resource_key: Option<String> }
Urn::as_capsule() -> Some(Capsule) // only when root_hash is Some; rootless -> None (= latest)

The three identities at a glance

TermValueMutable?Reference
storestore_id = CHIP-0035 launcher id (Bytes32)identity fixed; current root advancescapsule.rs, data_section.rs:209-213
capsule(store_id, root_hash) = one generationimmutablecapsule.rs:27-62
generationone entry in RootHistory, ordered oldest→newestappend-onlydigstore-store/generation.rs