Documentation ¶
Overview ¶
Code generated by protoc-gen-go-pulsar. DO NOT EDIT.
Index ¶
- Variables
- type BatchEntry
- func (*BatchEntry) Descriptor() ([]byte, []int)deprecated
- func (x *BatchEntry) GetExist() *ExistenceProof
- func (x *BatchEntry) GetNonexist() *NonExistenceProof
- func (x *BatchEntry) GetProof() isBatchEntry_Proof
- func (*BatchEntry) ProtoMessage()
- func (x *BatchEntry) ProtoReflect() protoreflect.Message
- func (x *BatchEntry) Reset()
- func (x *BatchEntry) String() string
- type BatchEntry_Exist
- type BatchEntry_Nonexist
- type BatchProof
- type CommitmentProof
- func (*CommitmentProof) Descriptor() ([]byte, []int)deprecated
- func (x *CommitmentProof) GetBatch() *BatchProof
- func (x *CommitmentProof) GetCompressed() *CompressedBatchProof
- func (x *CommitmentProof) GetExist() *ExistenceProof
- func (x *CommitmentProof) GetNonexist() *NonExistenceProof
- func (x *CommitmentProof) GetProof() isCommitmentProof_Proof
- func (*CommitmentProof) ProtoMessage()
- func (x *CommitmentProof) ProtoReflect() protoreflect.Message
- func (x *CommitmentProof) Reset()
- func (x *CommitmentProof) String() string
- type CommitmentProof_Batch
- type CommitmentProof_Compressed
- type CommitmentProof_Exist
- type CommitmentProof_Nonexist
- type CompressedBatchEntry
- func (*CompressedBatchEntry) Descriptor() ([]byte, []int)deprecated
- func (x *CompressedBatchEntry) GetExist() *CompressedExistenceProof
- func (x *CompressedBatchEntry) GetNonexist() *CompressedNonExistenceProof
- func (x *CompressedBatchEntry) GetProof() isCompressedBatchEntry_Proof
- func (*CompressedBatchEntry) ProtoMessage()
- func (x *CompressedBatchEntry) ProtoReflect() protoreflect.Message
- func (x *CompressedBatchEntry) Reset()
- func (x *CompressedBatchEntry) String() string
- type CompressedBatchEntry_Exist
- type CompressedBatchEntry_Nonexist
- type CompressedBatchProof
- func (*CompressedBatchProof) Descriptor() ([]byte, []int)deprecated
- func (x *CompressedBatchProof) GetEntries() []*CompressedBatchEntry
- func (x *CompressedBatchProof) GetLookupInners() []*InnerOp
- func (*CompressedBatchProof) ProtoMessage()
- func (x *CompressedBatchProof) ProtoReflect() protoreflect.Message
- func (x *CompressedBatchProof) Reset()
- func (x *CompressedBatchProof) String() string
- type CompressedExistenceProof
- func (*CompressedExistenceProof) Descriptor() ([]byte, []int)deprecated
- func (x *CompressedExistenceProof) GetKey() []byte
- func (x *CompressedExistenceProof) GetLeaf() *LeafOp
- func (x *CompressedExistenceProof) GetPath() []int32
- func (x *CompressedExistenceProof) GetValue() []byte
- func (*CompressedExistenceProof) ProtoMessage()
- func (x *CompressedExistenceProof) ProtoReflect() protoreflect.Message
- func (x *CompressedExistenceProof) Reset()
- func (x *CompressedExistenceProof) String() string
- type CompressedNonExistenceProof
- func (*CompressedNonExistenceProof) Descriptor() ([]byte, []int)deprecated
- func (x *CompressedNonExistenceProof) GetKey() []byte
- func (x *CompressedNonExistenceProof) GetLeft() *CompressedExistenceProof
- func (x *CompressedNonExistenceProof) GetRight() *CompressedExistenceProof
- func (*CompressedNonExistenceProof) ProtoMessage()
- func (x *CompressedNonExistenceProof) ProtoReflect() protoreflect.Message
- func (x *CompressedNonExistenceProof) Reset()
- func (x *CompressedNonExistenceProof) String() string
- type ExistenceProof
- func (*ExistenceProof) Descriptor() ([]byte, []int)deprecated
- func (x *ExistenceProof) GetKey() []byte
- func (x *ExistenceProof) GetLeaf() *LeafOp
- func (x *ExistenceProof) GetPath() []*InnerOp
- func (x *ExistenceProof) GetValue() []byte
- func (*ExistenceProof) ProtoMessage()
- func (x *ExistenceProof) ProtoReflect() protoreflect.Message
- func (x *ExistenceProof) Reset()
- func (x *ExistenceProof) String() string
- type HashOp
- type InnerOp
- func (*InnerOp) Descriptor() ([]byte, []int)deprecated
- func (x *InnerOp) GetHash() HashOp
- func (x *InnerOp) GetPrefix() []byte
- func (x *InnerOp) GetSuffix() []byte
- func (*InnerOp) ProtoMessage()
- func (x *InnerOp) ProtoReflect() protoreflect.Message
- func (x *InnerOp) Reset()
- func (x *InnerOp) String() string
- type InnerSpec
- func (*InnerSpec) Descriptor() ([]byte, []int)deprecated
- func (x *InnerSpec) GetChildOrder() []int32
- func (x *InnerSpec) GetChildSize() int32
- func (x *InnerSpec) GetEmptyChild() []byte
- func (x *InnerSpec) GetHash() HashOp
- func (x *InnerSpec) GetMaxPrefixLength() int32
- func (x *InnerSpec) GetMinPrefixLength() int32
- func (*InnerSpec) ProtoMessage()
- func (x *InnerSpec) ProtoReflect() protoreflect.Message
- func (x *InnerSpec) Reset()
- func (x *InnerSpec) String() string
- type LeafOp
- func (*LeafOp) Descriptor() ([]byte, []int)deprecated
- func (x *LeafOp) GetHash() HashOp
- func (x *LeafOp) GetLength() LengthOp
- func (x *LeafOp) GetPrefix() []byte
- func (x *LeafOp) GetPrehashKey() HashOp
- func (x *LeafOp) GetPrehashValue() HashOp
- func (*LeafOp) ProtoMessage()
- func (x *LeafOp) ProtoReflect() protoreflect.Message
- func (x *LeafOp) Reset()
- func (x *LeafOp) String() string
- type LengthOp
- type NonExistenceProof
- func (*NonExistenceProof) Descriptor() ([]byte, []int)deprecated
- func (x *NonExistenceProof) GetKey() []byte
- func (x *NonExistenceProof) GetLeft() *ExistenceProof
- func (x *NonExistenceProof) GetRight() *ExistenceProof
- func (*NonExistenceProof) ProtoMessage()
- func (x *NonExistenceProof) ProtoReflect() protoreflect.Message
- func (x *NonExistenceProof) Reset()
- func (x *NonExistenceProof) String() string
- type ProofSpec
- func (*ProofSpec) Descriptor() ([]byte, []int)deprecated
- func (x *ProofSpec) GetInnerSpec() *InnerSpec
- func (x *ProofSpec) GetLeafSpec() *LeafOp
- func (x *ProofSpec) GetMaxDepth() int32
- func (x *ProofSpec) GetMinDepth() int32
- func (x *ProofSpec) GetPrehashKeyBeforeComparison() bool
- func (*ProofSpec) ProtoMessage()
- func (x *ProofSpec) ProtoReflect() protoreflect.Message
- func (x *ProofSpec) Reset()
- func (x *ProofSpec) String() string
Constants ¶
This section is empty.
Variables ¶
var ( HashOp_name = map[int32]string{ 0: "NO_HASH", 1: "SHA256", 2: "SHA512", 3: "KECCAK256", 4: "RIPEMD160", 5: "BITCOIN", 6: "SHA512_256", 7: "BLAKE2B_512", 8: "BLAKE2S_256", 9: "BLAKE3", } HashOp_value = map[string]int32{ "NO_HASH": 0, "SHA256": 1, "SHA512": 2, "KECCAK256": 3, "RIPEMD160": 4, "BITCOIN": 5, "SHA512_256": 6, "BLAKE2B_512": 7, "BLAKE2S_256": 8, "BLAKE3": 9, } )
Enum value maps for HashOp.
var ( LengthOp_name = map[int32]string{ 0: "NO_PREFIX", 1: "VAR_PROTO", 2: "VAR_RLP", 3: "FIXED32_BIG", 4: "FIXED32_LITTLE", 5: "FIXED64_BIG", 6: "FIXED64_LITTLE", 7: "REQUIRE_32_BYTES", 8: "REQUIRE_64_BYTES", } LengthOp_value = map[string]int32{ "NO_PREFIX": 0, "VAR_PROTO": 1, "VAR_RLP": 2, "FIXED32_BIG": 3, "FIXED32_LITTLE": 4, "FIXED64_BIG": 5, "FIXED64_LITTLE": 6, "REQUIRE_32_BYTES": 7, "REQUIRE_64_BYTES": 8, } )
Enum value maps for LengthOp.
var File_cosmos_ics23_v1_proofs_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type BatchEntry ¶
type BatchEntry struct { // Types that are assignable to Proof: // // *BatchEntry_Exist // *BatchEntry_Nonexist Proof isBatchEntry_Proof `protobuf_oneof:"proof"` // contains filtered or unexported fields }
Use BatchEntry not CommitmentProof, to avoid recursion
func (*BatchEntry) Descriptor
deprecated
func (*BatchEntry) Descriptor() ([]byte, []int)
Deprecated: Use BatchEntry.ProtoReflect.Descriptor instead.
func (*BatchEntry) GetExist ¶
func (x *BatchEntry) GetExist() *ExistenceProof
func (*BatchEntry) GetNonexist ¶
func (x *BatchEntry) GetNonexist() *NonExistenceProof
func (*BatchEntry) GetProof ¶
func (x *BatchEntry) GetProof() isBatchEntry_Proof
func (*BatchEntry) ProtoMessage ¶
func (*BatchEntry) ProtoMessage()
func (*BatchEntry) ProtoReflect ¶
func (x *BatchEntry) ProtoReflect() protoreflect.Message
func (*BatchEntry) Reset ¶
func (x *BatchEntry) Reset()
func (*BatchEntry) String ¶
func (x *BatchEntry) String() string
type BatchEntry_Exist ¶
type BatchEntry_Exist struct {
Exist *ExistenceProof `protobuf:"bytes,1,opt,name=exist,proto3,oneof"`
}
type BatchEntry_Nonexist ¶
type BatchEntry_Nonexist struct {
Nonexist *NonExistenceProof `protobuf:"bytes,2,opt,name=nonexist,proto3,oneof"`
}
type BatchProof ¶
type BatchProof struct { Entries []*BatchEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` // contains filtered or unexported fields }
BatchProof is a group of multiple proof types than can be compressed
func (*BatchProof) Descriptor
deprecated
func (*BatchProof) Descriptor() ([]byte, []int)
Deprecated: Use BatchProof.ProtoReflect.Descriptor instead.
func (*BatchProof) GetEntries ¶
func (x *BatchProof) GetEntries() []*BatchEntry
func (*BatchProof) ProtoMessage ¶
func (*BatchProof) ProtoMessage()
func (*BatchProof) ProtoReflect ¶
func (x *BatchProof) ProtoReflect() protoreflect.Message
func (*BatchProof) Reset ¶
func (x *BatchProof) Reset()
func (*BatchProof) String ¶
func (x *BatchProof) String() string
type CommitmentProof ¶
type CommitmentProof struct { // Types that are assignable to Proof: // // *CommitmentProof_Exist // *CommitmentProof_Nonexist // *CommitmentProof_Batch // *CommitmentProof_Compressed Proof isCommitmentProof_Proof `protobuf_oneof:"proof"` // contains filtered or unexported fields }
CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages
func (*CommitmentProof) Descriptor
deprecated
func (*CommitmentProof) Descriptor() ([]byte, []int)
Deprecated: Use CommitmentProof.ProtoReflect.Descriptor instead.
func (*CommitmentProof) GetBatch ¶
func (x *CommitmentProof) GetBatch() *BatchProof
func (*CommitmentProof) GetCompressed ¶
func (x *CommitmentProof) GetCompressed() *CompressedBatchProof
func (*CommitmentProof) GetExist ¶
func (x *CommitmentProof) GetExist() *ExistenceProof
func (*CommitmentProof) GetNonexist ¶
func (x *CommitmentProof) GetNonexist() *NonExistenceProof
func (*CommitmentProof) GetProof ¶
func (x *CommitmentProof) GetProof() isCommitmentProof_Proof
func (*CommitmentProof) ProtoMessage ¶
func (*CommitmentProof) ProtoMessage()
func (*CommitmentProof) ProtoReflect ¶
func (x *CommitmentProof) ProtoReflect() protoreflect.Message
func (*CommitmentProof) Reset ¶
func (x *CommitmentProof) Reset()
func (*CommitmentProof) String ¶
func (x *CommitmentProof) String() string
type CommitmentProof_Batch ¶
type CommitmentProof_Batch struct {
Batch *BatchProof `protobuf:"bytes,3,opt,name=batch,proto3,oneof"`
}
type CommitmentProof_Compressed ¶
type CommitmentProof_Compressed struct {
Compressed *CompressedBatchProof `protobuf:"bytes,4,opt,name=compressed,proto3,oneof"`
}
type CommitmentProof_Exist ¶
type CommitmentProof_Exist struct {
Exist *ExistenceProof `protobuf:"bytes,1,opt,name=exist,proto3,oneof"`
}
type CommitmentProof_Nonexist ¶
type CommitmentProof_Nonexist struct {
Nonexist *NonExistenceProof `protobuf:"bytes,2,opt,name=nonexist,proto3,oneof"`
}
type CompressedBatchEntry ¶
type CompressedBatchEntry struct { // Types that are assignable to Proof: // // *CompressedBatchEntry_Exist // *CompressedBatchEntry_Nonexist Proof isCompressedBatchEntry_Proof `protobuf_oneof:"proof"` // contains filtered or unexported fields }
Use BatchEntry not CommitmentProof, to avoid recursion
func (*CompressedBatchEntry) Descriptor
deprecated
func (*CompressedBatchEntry) Descriptor() ([]byte, []int)
Deprecated: Use CompressedBatchEntry.ProtoReflect.Descriptor instead.
func (*CompressedBatchEntry) GetExist ¶
func (x *CompressedBatchEntry) GetExist() *CompressedExistenceProof
func (*CompressedBatchEntry) GetNonexist ¶
func (x *CompressedBatchEntry) GetNonexist() *CompressedNonExistenceProof
func (*CompressedBatchEntry) GetProof ¶
func (x *CompressedBatchEntry) GetProof() isCompressedBatchEntry_Proof
func (*CompressedBatchEntry) ProtoMessage ¶
func (*CompressedBatchEntry) ProtoMessage()
func (*CompressedBatchEntry) ProtoReflect ¶
func (x *CompressedBatchEntry) ProtoReflect() protoreflect.Message
func (*CompressedBatchEntry) Reset ¶
func (x *CompressedBatchEntry) Reset()
func (*CompressedBatchEntry) String ¶
func (x *CompressedBatchEntry) String() string
type CompressedBatchEntry_Exist ¶
type CompressedBatchEntry_Exist struct {
Exist *CompressedExistenceProof `protobuf:"bytes,1,opt,name=exist,proto3,oneof"`
}
type CompressedBatchEntry_Nonexist ¶
type CompressedBatchEntry_Nonexist struct {
Nonexist *CompressedNonExistenceProof `protobuf:"bytes,2,opt,name=nonexist,proto3,oneof"`
}
type CompressedBatchProof ¶
type CompressedBatchProof struct { Entries []*CompressedBatchEntry `protobuf:"bytes,1,rep,name=entries,proto3" json:"entries,omitempty"` LookupInners []*InnerOp `protobuf:"bytes,2,rep,name=lookup_inners,json=lookupInners,proto3" json:"lookup_inners,omitempty"` // contains filtered or unexported fields }
func (*CompressedBatchProof) Descriptor
deprecated
func (*CompressedBatchProof) Descriptor() ([]byte, []int)
Deprecated: Use CompressedBatchProof.ProtoReflect.Descriptor instead.
func (*CompressedBatchProof) GetEntries ¶
func (x *CompressedBatchProof) GetEntries() []*CompressedBatchEntry
func (*CompressedBatchProof) GetLookupInners ¶
func (x *CompressedBatchProof) GetLookupInners() []*InnerOp
func (*CompressedBatchProof) ProtoMessage ¶
func (*CompressedBatchProof) ProtoMessage()
func (*CompressedBatchProof) ProtoReflect ¶
func (x *CompressedBatchProof) ProtoReflect() protoreflect.Message
func (*CompressedBatchProof) Reset ¶
func (x *CompressedBatchProof) Reset()
func (*CompressedBatchProof) String ¶
func (x *CompressedBatchProof) String() string
type CompressedExistenceProof ¶
type CompressedExistenceProof struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Leaf *LeafOp `protobuf:"bytes,3,opt,name=leaf,proto3" json:"leaf,omitempty"` // these are indexes into the lookup_inners table in CompressedBatchProof Path []int32 `protobuf:"varint,4,rep,packed,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
func (*CompressedExistenceProof) Descriptor
deprecated
func (*CompressedExistenceProof) Descriptor() ([]byte, []int)
Deprecated: Use CompressedExistenceProof.ProtoReflect.Descriptor instead.
func (*CompressedExistenceProof) GetKey ¶
func (x *CompressedExistenceProof) GetKey() []byte
func (*CompressedExistenceProof) GetLeaf ¶
func (x *CompressedExistenceProof) GetLeaf() *LeafOp
func (*CompressedExistenceProof) GetPath ¶
func (x *CompressedExistenceProof) GetPath() []int32
func (*CompressedExistenceProof) GetValue ¶
func (x *CompressedExistenceProof) GetValue() []byte
func (*CompressedExistenceProof) ProtoMessage ¶
func (*CompressedExistenceProof) ProtoMessage()
func (*CompressedExistenceProof) ProtoReflect ¶
func (x *CompressedExistenceProof) ProtoReflect() protoreflect.Message
func (*CompressedExistenceProof) Reset ¶
func (x *CompressedExistenceProof) Reset()
func (*CompressedExistenceProof) String ¶
func (x *CompressedExistenceProof) String() string
type CompressedNonExistenceProof ¶
type CompressedNonExistenceProof struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // TODO: remove this as unnecessary??? we prove a range Left *CompressedExistenceProof `protobuf:"bytes,2,opt,name=left,proto3" json:"left,omitempty"` Right *CompressedExistenceProof `protobuf:"bytes,3,opt,name=right,proto3" json:"right,omitempty"` // contains filtered or unexported fields }
func (*CompressedNonExistenceProof) Descriptor
deprecated
func (*CompressedNonExistenceProof) Descriptor() ([]byte, []int)
Deprecated: Use CompressedNonExistenceProof.ProtoReflect.Descriptor instead.
func (*CompressedNonExistenceProof) GetKey ¶
func (x *CompressedNonExistenceProof) GetKey() []byte
func (*CompressedNonExistenceProof) GetLeft ¶
func (x *CompressedNonExistenceProof) GetLeft() *CompressedExistenceProof
func (*CompressedNonExistenceProof) GetRight ¶
func (x *CompressedNonExistenceProof) GetRight() *CompressedExistenceProof
func (*CompressedNonExistenceProof) ProtoMessage ¶
func (*CompressedNonExistenceProof) ProtoMessage()
func (*CompressedNonExistenceProof) ProtoReflect ¶
func (x *CompressedNonExistenceProof) ProtoReflect() protoreflect.Message
func (*CompressedNonExistenceProof) Reset ¶
func (x *CompressedNonExistenceProof) Reset()
func (*CompressedNonExistenceProof) String ¶
func (x *CompressedNonExistenceProof) String() string
type ExistenceProof ¶
type ExistenceProof struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` Value []byte `protobuf:"bytes,2,opt,name=value,proto3" json:"value,omitempty"` Leaf *LeafOp `protobuf:"bytes,3,opt,name=leaf,proto3" json:"leaf,omitempty"` Path []*InnerOp `protobuf:"bytes,4,rep,name=path,proto3" json:"path,omitempty"` // contains filtered or unexported fields }
* 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.
func (*ExistenceProof) Descriptor
deprecated
func (*ExistenceProof) Descriptor() ([]byte, []int)
Deprecated: Use ExistenceProof.ProtoReflect.Descriptor instead.
func (*ExistenceProof) GetKey ¶
func (x *ExistenceProof) GetKey() []byte
func (*ExistenceProof) GetLeaf ¶
func (x *ExistenceProof) GetLeaf() *LeafOp
func (*ExistenceProof) GetPath ¶
func (x *ExistenceProof) GetPath() []*InnerOp
func (*ExistenceProof) GetValue ¶
func (x *ExistenceProof) GetValue() []byte
func (*ExistenceProof) ProtoMessage ¶
func (*ExistenceProof) ProtoMessage()
func (*ExistenceProof) ProtoReflect ¶
func (x *ExistenceProof) ProtoReflect() protoreflect.Message
func (*ExistenceProof) Reset ¶
func (x *ExistenceProof) Reset()
func (*ExistenceProof) String ¶
func (x *ExistenceProof) String() string
type HashOp ¶
type HashOp int32
const ( // NO_HASH is the default if no data passed. Note this is an illegal argument some places. HashOp_NO_HASH HashOp = 0 HashOp_SHA256 HashOp = 1 HashOp_SHA512 HashOp = 2 HashOp_KECCAK256 HashOp = 3 HashOp_RIPEMD160 HashOp = 4 HashOp_BITCOIN HashOp = 5 // ripemd160(sha256(x)) HashOp_SHA512_256 HashOp = 6 HashOp_BLAKE2B_512 HashOp = 7 HashOp_BLAKE2S_256 HashOp = 8 HashOp_BLAKE3 HashOp = 9 )
func (HashOp) Descriptor ¶
func (HashOp) Descriptor() protoreflect.EnumDescriptor
func (HashOp) EnumDescriptor
deprecated
func (HashOp) Number ¶
func (x HashOp) Number() protoreflect.EnumNumber
func (HashOp) Type ¶
func (HashOp) Type() protoreflect.EnumType
type InnerOp ¶
type InnerOp struct { Hash HashOp `protobuf:"varint,1,opt,name=hash,proto3,enum=cosmos.ics23.v1.HashOp" json:"hash,omitempty"` Prefix []byte `protobuf:"bytes,2,opt,name=prefix,proto3" json:"prefix,omitempty"` Suffix []byte `protobuf:"bytes,3,opt,name=suffix,proto3" json:"suffix,omitempty"` // contains filtered or unexported fields }
* InnerOp represents a merkle-proof step that is not a leaf. It represents concatenating two children and hashing them to provide the next result.
The result of the previous step is passed in, so the signature of this op is: innerOp(child) -> output
The result of applying InnerOp should be: output = op.hash(op.prefix || child || op.suffix)
where the || operator is concatenation of binary data, and child is the result of hashing all the tree below this step.
Any special data, like prepending child with the length, or prepending the entire operation with some value to differentiate from leaf nodes, should be included in prefix and suffix. If either of prefix or suffix is empty, we just treat it as an empty string
func (*InnerOp) Descriptor
deprecated
func (*InnerOp) ProtoMessage ¶
func (*InnerOp) ProtoMessage()
func (*InnerOp) ProtoReflect ¶
func (x *InnerOp) ProtoReflect() protoreflect.Message
type InnerSpec ¶
type InnerSpec struct { // Child order is the ordering of the children node, must count from 0 // iavl tree is [0, 1] (left then right) // merk is [0, 2, 1] (left, right, here) ChildOrder []int32 `protobuf:"varint,1,rep,packed,name=child_order,json=childOrder,proto3" json:"child_order,omitempty"` ChildSize int32 `protobuf:"varint,2,opt,name=child_size,json=childSize,proto3" json:"child_size,omitempty"` MinPrefixLength int32 `protobuf:"varint,3,opt,name=min_prefix_length,json=minPrefixLength,proto3" json:"min_prefix_length,omitempty"` MaxPrefixLength int32 `protobuf:"varint,4,opt,name=max_prefix_length,json=maxPrefixLength,proto3" json:"max_prefix_length,omitempty"` // empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0) EmptyChild []byte `protobuf:"bytes,5,opt,name=empty_child,json=emptyChild,proto3" json:"empty_child,omitempty"` // hash is the algorithm that must be used for each InnerOp Hash HashOp `protobuf:"varint,6,opt,name=hash,proto3,enum=cosmos.ics23.v1.HashOp" json:"hash,omitempty"` // contains filtered or unexported fields }
InnerSpec contains all store-specific structure info to determine if two proofs from a given store are neighbors.
This enables:
isLeftMost(spec: InnerSpec, op: InnerOp) isRightMost(spec: InnerSpec, op: InnerOp) isLeftNeighbor(spec: InnerSpec, left: InnerOp, right: InnerOp)
func (*InnerSpec) Descriptor
deprecated
func (*InnerSpec) GetChildOrder ¶
func (*InnerSpec) GetChildSize ¶
func (*InnerSpec) GetEmptyChild ¶
func (*InnerSpec) GetMaxPrefixLength ¶
func (*InnerSpec) GetMinPrefixLength ¶
func (*InnerSpec) ProtoMessage ¶
func (*InnerSpec) ProtoMessage()
func (*InnerSpec) ProtoReflect ¶
func (x *InnerSpec) ProtoReflect() protoreflect.Message
type LeafOp ¶
type LeafOp struct { Hash HashOp `protobuf:"varint,1,opt,name=hash,proto3,enum=cosmos.ics23.v1.HashOp" json:"hash,omitempty"` PrehashKey HashOp `protobuf:"varint,2,opt,name=prehash_key,json=prehashKey,proto3,enum=cosmos.ics23.v1.HashOp" json:"prehash_key,omitempty"` PrehashValue HashOp `` /* 126-byte string literal not displayed */ Length LengthOp `protobuf:"varint,4,opt,name=length,proto3,enum=cosmos.ics23.v1.LengthOp" json:"length,omitempty"` // prefix is a fixed bytes that may optionally be included at the beginning to differentiate // a leaf node from an inner node. Prefix []byte `protobuf:"bytes,5,opt,name=prefix,proto3" json:"prefix,omitempty"` // contains filtered or unexported fields }
* 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)
func (*LeafOp) Descriptor
deprecated
func (*LeafOp) GetPrehashKey ¶
func (*LeafOp) GetPrehashValue ¶
func (*LeafOp) ProtoMessage ¶
func (*LeafOp) ProtoMessage()
func (*LeafOp) ProtoReflect ¶
func (x *LeafOp) ProtoReflect() protoreflect.Message
type LengthOp ¶
type LengthOp int32
* LengthOp defines how to process the key and value of the LeafOp to include length information. After encoding the length with the given algorithm, the length will be prepended to the key and value bytes. (Each one with it's own encoded length)
const ( // NO_PREFIX don't include any length info LengthOp_NO_PREFIX LengthOp = 0 // VAR_PROTO uses protobuf (and go-amino) varint encoding of the length LengthOp_VAR_PROTO LengthOp = 1 // VAR_RLP uses rlp int encoding of the length LengthOp_VAR_RLP LengthOp = 2 // FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer LengthOp_FIXED32_BIG LengthOp = 3 // FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer LengthOp_FIXED32_LITTLE LengthOp = 4 // FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer LengthOp_FIXED64_BIG LengthOp = 5 // FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer LengthOp_FIXED64_LITTLE LengthOp = 6 // REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output) LengthOp_REQUIRE_32_BYTES LengthOp = 7 // REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output) LengthOp_REQUIRE_64_BYTES LengthOp = 8 )
func (LengthOp) Descriptor ¶
func (LengthOp) Descriptor() protoreflect.EnumDescriptor
func (LengthOp) EnumDescriptor
deprecated
func (LengthOp) Number ¶
func (x LengthOp) Number() protoreflect.EnumNumber
func (LengthOp) Type ¶
func (LengthOp) Type() protoreflect.EnumType
type NonExistenceProof ¶
type NonExistenceProof struct { Key []byte `protobuf:"bytes,1,opt,name=key,proto3" json:"key,omitempty"` // TODO: remove this as unnecessary??? we prove a range Left *ExistenceProof `protobuf:"bytes,2,opt,name=left,proto3" json:"left,omitempty"` Right *ExistenceProof `protobuf:"bytes,3,opt,name=right,proto3" json:"right,omitempty"` // contains filtered or unexported fields }
NonExistenceProof takes a proof of two neighbors, one left of the desired key, one right of the desired key. If both proofs are valid AND they are neighbors, then there is no valid proof for the given key.
func (*NonExistenceProof) Descriptor
deprecated
func (*NonExistenceProof) Descriptor() ([]byte, []int)
Deprecated: Use NonExistenceProof.ProtoReflect.Descriptor instead.
func (*NonExistenceProof) GetKey ¶
func (x *NonExistenceProof) GetKey() []byte
func (*NonExistenceProof) GetLeft ¶
func (x *NonExistenceProof) GetLeft() *ExistenceProof
func (*NonExistenceProof) GetRight ¶
func (x *NonExistenceProof) GetRight() *ExistenceProof
func (*NonExistenceProof) ProtoMessage ¶
func (*NonExistenceProof) ProtoMessage()
func (*NonExistenceProof) ProtoReflect ¶
func (x *NonExistenceProof) ProtoReflect() protoreflect.Message
func (*NonExistenceProof) Reset ¶
func (x *NonExistenceProof) Reset()
func (*NonExistenceProof) String ¶
func (x *NonExistenceProof) String() string
type ProofSpec ¶
type ProofSpec struct { // 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) LeafSpec *LeafOp `protobuf:"bytes,1,opt,name=leaf_spec,json=leafSpec,proto3" json:"leaf_spec,omitempty"` InnerSpec *InnerSpec `protobuf:"bytes,2,opt,name=inner_spec,json=innerSpec,proto3" json:"inner_spec,omitempty"` // max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries) MaxDepth int32 `protobuf:"varint,3,opt,name=max_depth,json=maxDepth,proto3" json:"max_depth,omitempty"` // min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries) MinDepth int32 `protobuf:"varint,4,opt,name=min_depth,json=minDepth,proto3" json:"min_depth,omitempty"` // prehash_key_before_comparison is a flag that indicates whether to use the // prehash_key specified by LeafOp to compare lexical ordering of keys for // non-existence proofs. PrehashKeyBeforeComparison bool `` /* 144-byte string literal not displayed */ // contains filtered or unexported fields }
* 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.
func (*ProofSpec) Descriptor
deprecated
func (*ProofSpec) GetInnerSpec ¶
func (*ProofSpec) GetLeafSpec ¶
func (*ProofSpec) GetMaxDepth ¶
func (*ProofSpec) GetMinDepth ¶
func (*ProofSpec) GetPrehashKeyBeforeComparison ¶
func (*ProofSpec) ProtoMessage ¶
func (*ProofSpec) ProtoMessage()
func (*ProofSpec) ProtoReflect ¶
func (x *ProofSpec) ProtoReflect() protoreflect.Message