singular_state/genesis

Genesis of a registry state.

Responsibility

The decision sites of the model’s genesis: one function per guard, and genesis, which conjoins them for the mint handler of the state script.

Dependencies

singular_state/state for recognition and the mint comparison; singular_state/preimage for the state token name.

Assumptions

The ledger runs the mint handler only when the state policy is among the minted policies, and spends an input at most once.

Invariants

A registry state is created only by spending its seed once, minting exactly one state token named from that seed and nothing else under the state policy, into exactly one recognised state output with the empty root.

Types

The redeemer of the state policy: the genesis of a registry, or a mint that belongs to a fold, whose spend handler decides it.

Constructors

  • Genesis { seed: OutputReference }
  • Folded

Functions

genesis_seed(seed: OutputReference, inputs: List<Input>) -> Bool

Model guard genesisSeed: the seed is spent by exactly one input.

genesis_invocation(state_policy: PolicyId, mint: Value) -> Bool

Model guard genesisInvocation: the state policy is among the minted policies.

genesis_mint(state_policy: PolicyId, seed: OutputReference, mint: Value) -> Bool

Model guard genesisMint: the whole state-policy mint is exactly one state token named from the seed.

state_candidates(
  state_policy: PolicyId,
  seed: OutputReference,
  outputs: List<Output>,
) -> List<Output>

The outputs that carry the state token named from seed.

genesis_output(
  state_policy: PolicyId,
  seed: OutputReference,
  candidates: List<Output>,
) -> Bool

Model guard genesisOutput: exactly one candidate, and it is a recognised state.

genesis_empty(candidates: List<Output>) -> Bool

Model guard genesisEmpty: every candidate carries the empty root.

genesis(seed: OutputReference, state_policy: PolicyId, tx: Transaction) -> Bool

The model’s genesis for the state script state_policy.

Search Document