Class: ProofSpec
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.
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:519
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.
Generated
from message ics23.ProofSpec
Extends
Message<ProofSpec>
Constructors
Constructor
new ProofSpec(
data?):ProofSpec
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:549
Parameters
data?
PartialMessage<ProofSpec>
Returns
ProofSpec
Overrides
Message<ProofSpec>.constructor
Properties
innerSpec?
optionalinnerSpec?:InnerSpec
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:531
Generated
from field: ics23.InnerSpec inner_spec = 2;
leafSpec?
optionalleafSpec?:LeafOp
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:526
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)
Generated
from field: ics23.LeafOp leaf_spec = 1;
maxDepth
maxDepth:
number=0
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:539
max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)
Generated
from field: int32 max_depth = 3;
minDepth
minDepth:
number=0
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:547
min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)
Generated
from field: int32 min_depth = 4;
fields
readonlystaticfields:FieldList
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:556
runtime
readonlystaticruntime:ProtoRuntime=proto3
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:554
typeName
readonlystatictypeName:"ics23.ProofSpec"='ics23.ProofSpec'
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:555
Methods
equals()
staticequals(a,b):boolean
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:575
Parameters
a
ProofSpec | PlainMessage<ProofSpec> | undefined
b
ProofSpec | PlainMessage<ProofSpec> | undefined
Returns
boolean
fromBinary()
staticfromBinary(bytes,options?):ProofSpec
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:563
Parameters
bytes
Uint8Array
options?
Partial<BinaryReadOptions>
Returns
ProofSpec
fromJson()
staticfromJson(jsonValue,options?):ProofSpec
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:567
Parameters
jsonValue
JsonValue
options?
Partial<JsonReadOptions>
Returns
ProofSpec
fromJsonString()
staticfromJsonString(jsonString,options?):ProofSpec
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:571
Parameters
jsonString
string
options?
Partial<JsonReadOptions>
Returns
ProofSpec