conformance
Safe HaskellNone
LanguageGHC2021

Conformance.Authenticate

Description

cardano-keri's ruling gives the registry to identity uniqueness, and epic 16 executed the correction: a permissionless ledger cannot prohibit a rival registry (naming-correspondence.md, "What t50 settled"). Canonical identity is therefore a /derivation the consumer authenticates/, not a refusal the chain performs: the canonical registry token's name is SHA-256 of the canonical seed's outRef, that seed can never be spent twice, and a rival from another seed can never carry that name.

This module is the pure decision core the devnet rows execute. It never talks to the chain; the runner feeds it assets read back from chain UTxOs at the derived address. Two decisions exist on purpose:

  • authenticate — the consumer's check: exact policy, the derived name, quantity one.
  • authenticateWeak — the policy-address-only-authentication-control control: policy only (the address leg is the query itself). It is designed to accept a consistent rival, which is what makes rival-seed-authentication's rejection attributable to the name check and nothing else. A control that could not accept would prove nothing.
Synopsis

Decisions

data AuthDecision Source #

The authentication verdict for one output.

Instances

Instances details
Show AuthDecision Source # 
Instance details

Defined in Conformance.Authenticate

Methods

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

show :: AuthDecision -> String Source #

showList :: [AuthDecision] -> ShowS Source #

Eq AuthDecision Source # 
Instance details

Defined in Conformance.Authenticate

Methods

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

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

data AuthReject Source #

Why an output failed canonical authentication. The failing leg is named so a rejection is attributable, the same discipline the refusal matcher applies to node reasons.

Constructors

PolicyAbsent

No asset at all under the canonical policy: whatever this output is, it is not a registry (the tokenless-output-authentication forgery).

NameMismatch

The policy is present but the derived name is not: a rival registry from another seed (the rival-seed-authentication rival).

QuantityNotOne Integer

The canonical name with a quantity other than one.

Instances

Instances details
Show AuthReject Source # 
Instance details

Defined in Conformance.Authenticate

Methods

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

show :: AuthReject -> String Source #

showList :: [AuthReject] -> ShowS Source #

Eq AuthReject Source # 
Instance details

Defined in Conformance.Authenticate

Methods

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

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

authenticate :: ByteString -> ByteString -> Assets -> AuthDecision Source #

Canonical authentication: the exact policy, the name derived from the published seed, quantity one. Every leg must hold.

authenticateWeak :: ByteString -> Assets -> AuthDecision Source #

The policy-address-only-authentication-control control: policy only. The address leg is the query itself (the runner reads UTxOs at the derived address), so the weak check is exactly policy present. It accepts a consistent rival by design — that acceptance is the observation that makes rival-seed-authentication's rejection attributable to the derived name.

Chain-shaped input

type Assets = Map ByteString (Map ByteString Integer) Source #

One output's token assets, as the ledger reports them: policy-id bytes -> asset-name bytes -> quantity.