singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.Registry.Proof

Description

Serializes MPFProof (from mts:mpf) to the CBOR/PlutusData format expected by the Aiken on-chain validator, and converts proofs to the on-chain ProofStep type used in UpdateRedeemer.

The CBOR encoding uses indefinite-length lists and bytestrings to match the reference TypeScript implementation byte-for-byte. Steps are reversed from the library's leaf-to-root order to the root-to-leaf order expected on-chain.

Synopsis

Serialization

serializeProof Source #

Arguments

:: MPFProof MPFHash

Proof produced by an insert/delete/update

-> ByteString 

Serialize an MPFProof to Aiken-compatible PlutusData CBOR bytes.

The output is byte-identical to the TypeScript reference proof.toCBOR().

Conversion to on-chain types

toProofSteps Source #

Arguments

:: MPFProof MPFHash

Proof produced by an insert/delete/update

-> [ProofStep] 

Convert an MPFProof to on-chain ProofSteps.

Steps are reversed from leaf-to-root storage order to root-to-leaf (same as serializeProof).