Options
All
  • Public
  • Public/Protected
  • All
Menu

ProofSpec defines what the expected parameters are for a given proof type. This can be stored in the client and used to validate any incoming proofs.

verify(ProofSpec, Proof) -> Proof | Error

As demonstrated in tests, if we don't fix the algorithm used to calculate the LeafHash for a given tree, there are many possible key-value pairs that can generate a given hash (by interpretting the preimage differently). We need this for proper security, requires client knows a priori what tree format server uses. But not in code, rather a configuration object.

Hierarchy

  • ProofSpec

Index

Properties

Optional innerSpec

innerSpec: InnerSpec

Optional leafSpec

leafSpec: LeafOp

any field in the ExistenceProof must be the same as in this spec. except Prefix, which is just the first bytes of prefix (spec can be longer)

maxDepth

maxDepth: number

max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)

minDepth

minDepth: number

min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)

Generated using TypeDoc