singular-registry
LicenseApache-2.0
Safe HaskellNone
LanguageGHC2021

Singular.Registry.Wire.Proof

Description

The Aiken merkle-patricia-forestry proof encoding: a single step in an MPF Merkle proof and the neighbor node a fork step carries, each with its codec. Reads only Singular.Registry.Wire.Primitive; nothing here is importable by a caller — the public surface is the Singular.Registry.Types facade.

Synopsis

Proof steps (Aiken MPF proof encoding)

data ProofStep Source #

A single step in an MPF Merkle proof, matching the Aiken ProofStep type from aiken-lang/merkle-patricia-forestry.

Constructors

Branch

Branch step (Constr 0)

Fields

  • branchSkip :: !Integer

    Number of shared nibbles to skip

  • branchNeighbors :: !ByteString

    Concatenated neighbor hashes (4 x 32 bytes)

Fork

Fork step (Constr 1)

Fields

Leaf

Leaf step (Constr 2)

Fields

  • leafSkip :: !Integer

    Number of shared nibbles to skip

  • leafKey :: !ByteString

    Remaining key suffix at the leaf

  • leafValue :: !ByteString

    Value hash stored at the leaf

Instances

Instances details
Show ProofStep Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

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

show :: ProofStep -> String Source #

showList :: [ProofStep] -> ShowS Source #

Eq ProofStep Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

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

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

FromData ProofStep Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

fromBuiltinData :: BuiltinData -> Maybe ProofStep

ToData ProofStep Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

toBuiltinData :: ProofStep -> BuiltinData

UnsafeFromData ProofStep Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

unsafeFromBuiltinData :: BuiltinData -> ProofStep

data Neighbor Source #

Neighbor node in a fork proof step.

Constructors

Neighbor 

Fields

  • neighborNibble :: !Integer

    Hex digit (0-15) identifying the fork branch

  • neighborPrefix :: !ByteString

    Common prefix nibbles of the neighbor subtree

  • neighborRoot :: !ByteString

    Merkle root hash of the neighbor subtree

Instances

Instances details
Show Neighbor Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

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

show :: Neighbor -> String Source #

showList :: [Neighbor] -> ShowS Source #

Eq Neighbor Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

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

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

FromData Neighbor Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

fromBuiltinData :: BuiltinData -> Maybe Neighbor

ToData Neighbor Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

toBuiltinData :: Neighbor -> BuiltinData

UnsafeFromData Neighbor Source # 
Instance details

Defined in Singular.Registry.Wire.Proof

Methods

unsafeFromBuiltinData :: BuiltinData -> Neighbor