Class: ExistenceProof
ExistenceProof takes a key and a value and a set of steps to perform on it. The result of peforming all these steps will provide a "root hash", which can be…
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:170
ExistenceProof takes a key and a value and a set of steps to perform on it. The result of peforming all these steps will provide a "root hash", which can be compared to the value in a header.
Since it is computationally infeasible to produce a hash collission for any of the used cryptographic hash functions, if someone can provide a series of operations to transform a given key and value into a root hash that matches some trusted root, these key and values must be in the referenced merkle tree.
The only possible issue is maliablity in LeafOp, such as providing extra prefix data, which should be controlled by a spec. Eg. with lengthOp as NONE, prefix = FOO, key = BAR, value = CHOICE and prefix = F, key = OOBAR, value = CHOICE would produce the same value.
With LengthOp this is tricker but not impossible. Which is why the "leafPrefixEqual" field in the ProofSpec is valuable to prevent this mutability. And why all trees should length-prefix the data before hashing it.
Generated
from message ics23.ExistenceProof
Extends
Message<ExistenceProof>
Constructors
Constructor
new ExistenceProof(
data?):ExistenceProof
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:191
Parameters
data?
PartialMessage<ExistenceProof>
Returns
ExistenceProof
Overrides
Message<ExistenceProof>.constructor
Properties
key
key:
Uint8Array<ArrayBuffer>
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:174
Generated
from field: bytes key = 1;
leaf?
optionalleaf?:LeafOp
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:184
Generated
from field: ics23.LeafOp leaf = 3;
path
path:
InnerOp[] =[]
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:189
Generated
from field: repeated ics23.InnerOp path = 4;
value
value:
Uint8Array<ArrayBuffer>
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:179
Generated
from field: bytes value = 2;
fields
readonlystaticfields:FieldList
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:198
runtime
readonlystaticruntime:ProtoRuntime=proto3
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:196
typeName
readonlystatictypeName:"ics23.ExistenceProof"='ics23.ExistenceProof'
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:197
Methods
equals()
staticequals(a,b):boolean
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:217
Parameters
a
ExistenceProof | PlainMessage<ExistenceProof> | undefined
b
ExistenceProof | PlainMessage<ExistenceProof> | undefined
Returns
boolean
fromBinary()
staticfromBinary(bytes,options?):ExistenceProof
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:205
Parameters
bytes
Uint8Array
options?
Partial<BinaryReadOptions>
Returns
ExistenceProof
fromJson()
staticfromJson(jsonValue,options?):ExistenceProof
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:209
Parameters
jsonValue
JsonValue
options?
Partial<JsonReadOptions>
Returns
ExistenceProof
fromJsonString()
staticfromJsonString(jsonString,options?):ExistenceProof
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:213
Parameters
jsonString
string
options?
Partial<JsonReadOptions>
Returns
ExistenceProof