Class: LeafOp
LeafOp represents the raw key-value data we wish to prove, and must be flexible to represent the internal transformation from the original key-value pairs into…
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:375
LeafOp represents the raw key-value data we wish to prove, and must be flexible to represent the internal transformation from the original key-value pairs into the basis hash, for many existing merkle trees.
key and value are passed in. So that the signature of this operation is: leafOp(key, value) -> output
To process this, first prehash the keys and values if needed (ANY means no hash in this case): hkey = prehashKey(key) hvalue = prehashValue(value)
Then combine the bytes, and hash it output = hash(prefix || length(hkey) || hkey || length(hvalue) || hvalue)
Generated
from message ics23.LeafOp
Extends
Message<LeafOp>
Constructors
Constructor
new LeafOp(
data?):LeafOp
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:404
Parameters
data?
PartialMessage<LeafOp>
Returns
LeafOp
Overrides
Message<LeafOp>.constructor
Properties
hash
hash:
HashOp=HashOp.NO_HASH
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:379
Generated
from field: ics23.HashOp hash = 1;
length
length:
LengthOp=LengthOp.NO_PREFIX
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:394
Generated
from field: ics23.LengthOp length = 4;
prefix
prefix:
Uint8Array<ArrayBuffer>
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:402
prefix is a fixed bytes that may optionally be included at the beginning to differentiate a leaf node from an inner node.
Generated
from field: bytes prefix = 5;
prehashKey
prehashKey:
HashOp=HashOp.NO_HASH
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:384
Generated
from field: ics23.HashOp prehash_key = 2;
prehashValue
prehashValue:
HashOp=HashOp.NO_HASH
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:389
Generated
from field: ics23.HashOp prehash_value = 3;
fields
readonlystaticfields:FieldList
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:411
runtime
readonlystaticruntime:ProtoRuntime=proto3
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:409
typeName
readonlystatictypeName:"ics23.LeafOp"='ics23.LeafOp'
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:410
Methods
equals()
staticequals(a,b):boolean
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:431
Parameters
a
LeafOp | PlainMessage<LeafOp> | undefined
b
LeafOp | PlainMessage<LeafOp> | undefined
Returns
boolean
fromBinary()
staticfromBinary(bytes,options?):LeafOp
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:419
Parameters
bytes
Uint8Array
options?
Partial<BinaryReadOptions>
Returns
LeafOp
fromJson()
staticfromJson(jsonValue,options?):LeafOp
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:423
Parameters
jsonValue
JsonValue
options?
Partial<JsonReadOptions>
Returns
LeafOp
fromJsonString()
staticfromJsonString(jsonString,options?):LeafOp
Defined in: packages/bitbadgesjs-sdk/src/proto/proofs_pb.ts:427
Parameters
jsonString
string
options?
Partial<JsonReadOptions>
Returns
LeafOp