singular_state/preimage

The hashed names of the new Singular line.

Responsibility

Holds the structured preimages whose Plutus Data serialisation is hashed into a token name, and one function per role that names the token.

Dependencies

The Aiken standard library only.

Assumptions

The hash is collision free over the preimages in use, so two different preimages never name the same token.

Invariants

One constructor per role, numbered as the model’s Preimage, so a name of one role is never the name of another.

Types

The structured value hashed into a token name, one constructor per role, numbered as the model’s Preimage.

Constructors

  • State { seed: OutputReference }
  • Active { registry: RegistryIdentity, key: ByteArray }
  • ApplicationConfiguration { registry: RegistryIdentity }
  • RegistrationApproval {
      registry: RegistryIdentity,
      key: ByteArray,
      holding_address: Address,
      initial_datum: ByteArray,
      deposit: Int,
    }
  • TerminationApproval { registry: RegistryIdentity, key: ByteArray }

The identity of a registry: its state token.

Constructors

  • RegistryIdentity { policy: PolicyId, name: AssetName }

Functions

state_token_name(seed: OutputReference) -> AssetName

The name of the state token of the registry created by spending seed: the blake2b-256 hash of the Plutus Data serialisation of its preimage.

active_token_name(registry: RegistryIdentity, key: ByteArray) -> AssetName

The name of the token that stands for key in registry.

configuration_token_name(registry: RegistryIdentity) -> AssetName

The name of the token of the configuration record of registry.

registration_preimage(
  key: ByteArray,
  registry: RegistryIdentity,
  holding_address: Address,
  datum_hash: ByteArray,
  deposit: Int,
) -> ByteArray

The Plutus Data serialisation of the registration approval preimage: the registry, the key, the address the holding sits at, the hash of the holding’s initial datum and the deposit the holding holds.

termination_preimage(key: ByteArray, registry: RegistryIdentity) -> ByteArray

The Plutus Data serialisation of the termination approval preimage: the registry and the key.

approval_name(preimage: ByteArray) -> AssetName

The name of the registration approval token whose preimage is preimage.

initial_datum_hash(datum: Data) -> ByteArray

The hash of a holding’s initial datum, as the registration approval commits it.

Search Document