singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Naming.Verify

Description

Pure predicates over already-resolved evidence for one retired record. All inputs are plain bytes supplied by the caller (a reader resolving them from transaction bodies); this module compares, recomputes and routes — it parses nothing, trusts no constants, and holds no keys.

The_EXE_ (retirement-verify) resolves every field below from retained transaction CBOR plus public log mappings; the unit tests pin every predicate here, including the wrong-policy/same-name discrimination (NOTE-026). Either side alone is insufficient: parsing without predicates proves nothing, predicates without parsing check nothing.

Synopsis

Documentation

data RetireEvidence Source #

One retired record, fully resolved to plain evidence. Every hash is raw bytes as found in bodies or public lines — never a runner constant, never a key.

Constructors

RetireEvidence 

Fields

  • reRecord :: String

    Record outref under audit (txid#idx, linkage display).

  • reRetireTx :: String

    Retire txid under audit.

  • reKey :: ByteString

    Retire redeemer spelling (redeemer bytes).

  • reSpelling :: ByteString

    Registry request key from the creation fold.

  • reCreationHash :: ByteString

    Creation control hash (claim-tx datum bytes).

  • reCreationHashLog :: ByteString

    Creation hash as published in public creation material.

  • reCurrentControl :: ByteString

    Control of the record as retired (creation control for LT units, rotated destination for RR units — creating-datum bytes).

  • reQuorum :: [ByteString]

    Quorum members of the record as retired (creating datum).

  • reStatePolicy :: ByteString

    Registry STATE policy bytes (state output address bytes). The state policy forms the registry parameter, not the asset name.

  • reToken :: ByteString

    Registry token name (request datum bytes).

  • reCreationMint :: [(ByteString, ByteString, Integer)]

    Creation-tx mint triples (policy, name, quantity).

  • reCustodyPolicy :: ByteString

    Custody output asset policy (retire-tx bytes).

  • reCustodyName :: ByteString

    Custody output asset name (retire-tx bytes).

  • reCustodyQty :: Integer

    Custody output asset quantity (retire-tx bytes).

  • reRepLog :: ByteString

    Representative as published in public creation material.

  • reSigners :: [ByteString]

    Retire-tx required signatories (body bytes).

  • reWitnesses :: [ByteString]

    Retire-tx actual key witnesses (witness-set bytes).

Instances

Instances details
Show RetireEvidence Source # 
Instance details

Defined in Naming.Verify

Methods

showsPrec :: Int -> RetireEvidence -> ShowS Source #

show :: RetireEvidence -> String Source #

showList :: [RetireEvidence] -> ShowS Source #

Eq RetireEvidence Source # 
Instance details

Defined in Naming.Verify

Methods

(==) :: RetireEvidence -> RetireEvidence -> Bool Source #

(/=) :: RetireEvidence -> RetireEvidence -> Bool Source #

data CompleteEvidence Source #

One permissionless completion, fully resolved to plain evidence. The representative pair comes from an already-verified retirement (never re-derived here); every other field is resolved from the completion transaction's own bytes.

Constructors

CompleteEvidence 

Fields

  • ceRetireTx :: String

    Retire txid this completion closes (linkage display).

  • ceCompleteTx :: String

    Completion txid under audit.

  • ceCustodyTxid :: String

    Creator txid of the spent custody input (body bytes).

  • ceRequestTxid :: String

    Creator txid of the folded request input (body bytes). Co-creation (NOTE-029): these two must be equal — the folded request is the retire's own, not one queued anywhere else.

  • ceReqKey :: ByteString

    Folded request's registry key (request datum bytes): must be the burned asset's own name (#157 token-name-is-registry-key, the asset name IS the key).

  • ceReqEdge :: Integer

    Folded request's seven-admitted-edges row index (request datum bytes): must be the retirement, edge 3 updateTerminal (#183). The request states no values any more, so the move it asks for is the tag itself, and that tag is what the cage reads and the scripts check on ledger.

  • ceRepPolicy :: ByteString

    Verified representative policy (from the retire unit).

  • ceRepName :: ByteString

    Verified representative name (from the retire unit).

  • ceCustodyPolicy :: ByteString

    Spent custody input's asset policy (body bytes).

  • ceCustodyName :: ByteString

    Spent custody input's asset name (body bytes).

  • ceCustodyQty :: Integer

    Spent custody input's asset quantity (body bytes).

  • ceMint :: [(ByteString, ByteString, Integer)]

    Completion mint triples (body bytes): exactly the burn.

  • ceBurnRedeemerOk :: Bool

    Mint redeemer at the mint purpose is the burn shape (resolved by the caller; this module checks no redeemers).

  • ceIsModify :: Bool

    State-spend redeemer decodes as a Modify (caller-resolved).

  • ceActionCount :: Int

    Number of actions in that Modify (caller-resolved): exactly one. With a changed root below, singleton-ness is exactly one genuine UpdateAction (Rejected preserves the root).

  • ceRootBefore :: ByteString

    Spent state root (state datum bytes).

  • ceRootAfter :: ByteString

    Continuation state root (state datum bytes): must differ (a genuine transition, not Rejected-preserved).

  • ceReqSigners :: [ByteString]

    Required signatories (body bytes): must be empty (permissionless — no approval by anybody).

  • ceWitnesses :: [ByteString]

    Actual key witnesses (witness-set bytes).

  • ceFeeOwner :: ByteString

    Payment hash owning the fee input (body bytes): the sole witness must be exactly this key (fee ownership, never authorization — see the Q-file on the no-signature criterion).

  • ceRouteKeys :: [ByteString]

    Route keys that must not witness (control plus quorum).

Instances

Instances details
Show CompleteEvidence Source # 
Instance details

Defined in Naming.Verify

Methods

showsPrec :: Int -> CompleteEvidence -> ShowS Source #

show :: CompleteEvidence -> String Source #

showList :: [CompleteEvidence] -> ShowS Source #

Eq CompleteEvidence Source # 
Instance details

Defined in Naming.Verify

Methods

(==) :: CompleteEvidence -> CompleteEvidence -> Bool Source #

(/=) :: CompleteEvidence -> CompleteEvidence -> Bool Source #

positiveMintPolicy :: [(ByteString, ByteString, Integer)] -> Either String ByteString Source #

The representative mint policy of a creation fold: exactly one positive-quantity policy (the approval burn is negative). Anything else — none, several — fails: the derivation admits no judgment calls about which policy is "the" representative one.

verifyRetireEvidence :: RetireEvidence -> Either String () Source #

The full binding verdict. Every clause names its own failure; Right () means the retirement's key, name, custody triple, creation mint, signers and witnesses all check out.

verifyCompletion :: CompleteEvidence -> Either String () Source #

The full completion verdict: co-created pair, exact burn, singleton-Modify, genuine root change, and permissionless authorization (empty required signers, fee-owner-only witness outside every route).

singleNamingToken :: [ByteString] -> [(ByteString, ByteString, Integer)] -> Either String (ByteString, Integer) Source #

Read one naming token from complete non-ADA value triples. The caller supplies the deployment's allowed approval and representative policies.