Skip to main content

Module lifecycle

Module lifecycle 

Source
Expand description

The store LIFECYCLE (SPEC §3): a store is a coin that gets SPENT.

A DIG store is a CHIP-0035 DataLayer singleton. Three operations span its life, each a spend of that coin, composed directly over dig-merkle (the byte-source-of-truth for every DataLayer spend, INV-4):

Every operation returns an UNSIGNED MerkleCoinSpend (inherited boundary INV-2/INV-3 from dig-merkle): dig-store never holds a key, never signs, never broadcasts. The wallet-backend / node feeds the reported spends to dig_merkle::required_signatures, signs, assembles the SpendBundle, and submits it. The on-chain encoding is minimal (NC-8) — delegated wholesale to dig-merkle, which owns the byte layout.

modify_store / melt_store take the already-hydrated tip DataStore (from crate::get_store_singleton_tip, which does the single chain read) rather than a chain source, so these builders stay pure transforms of their inputs (INV-1).

Structs§

CreateStoreParams
The parameters that describe a store’s on-chain metadata at creation (SPEC §3.1).

Enums§

StoreOwner
Who is authorized to spend a store coin — the p2 (“inner”) puzzle that guards it.

Functions§

create_store
Launches a new store coin from a funding parent, anchoring the first root (SPEC §3.1).
melt_store
Terminally spends (melts) the store’s tip coin, leaving no successor (SPEC §3.3).
modify_store
Spends the store’s tip coin to recreate it anchoring new_root — a new generation (SPEC §3.2).