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.

from message ics23.ProofSpec

Hierarchy

Constructors

Properties

innerSpec?: InnerSpec

from field: ics23.InnerSpec inner_spec = 2;

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)

from field: ics23.LeafOp leaf_spec = 1;

maxDepth: number = 0

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

from field: int32 max_depth = 3;

minDepth: number = 0

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

from field: int32 min_depth = 4;

fields: FieldList = ...
runtime: ProtoRuntime = proto3
typeName: "ics23.ProofSpec" = 'ics23.ProofSpec'

Methods