ics23

package module
v0.0.0-...-ccce00e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 2

Documentation

Overview

Code generated by protoc-gen-go-pulsar. DO NOT EDIT.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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.

View Source
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 (*CompressedBatchEntry) GetNonexist

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 (*CompressedNonExistenceProof) GetRight

func (*CompressedNonExistenceProof) ProtoMessage

func (*CompressedNonExistenceProof) ProtoMessage()

func (*CompressedNonExistenceProof) ProtoReflect

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) Enum

func (x HashOp) Enum() *HashOp

func (HashOp) EnumDescriptor deprecated

func (HashOp) EnumDescriptor() ([]byte, []int)

Deprecated: Use HashOp.Descriptor instead.

func (HashOp) Number

func (x HashOp) Number() protoreflect.EnumNumber

func (HashOp) String

func (x HashOp) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use InnerOp.ProtoReflect.Descriptor instead.

func (*InnerOp) GetHash

func (x *InnerOp) GetHash() HashOp

func (*InnerOp) GetPrefix

func (x *InnerOp) GetPrefix() []byte

func (*InnerOp) GetSuffix

func (x *InnerOp) GetSuffix() []byte

func (*InnerOp) ProtoMessage

func (*InnerOp) ProtoMessage()

func (*InnerOp) ProtoReflect

func (x *InnerOp) ProtoReflect() protoreflect.Message

func (*InnerOp) Reset

func (x *InnerOp) Reset()

func (*InnerOp) String

func (x *InnerOp) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use InnerSpec.ProtoReflect.Descriptor instead.

func (*InnerSpec) GetChildOrder

func (x *InnerSpec) GetChildOrder() []int32

func (*InnerSpec) GetChildSize

func (x *InnerSpec) GetChildSize() int32

func (*InnerSpec) GetEmptyChild

func (x *InnerSpec) GetEmptyChild() []byte

func (*InnerSpec) GetHash

func (x *InnerSpec) GetHash() HashOp

func (*InnerSpec) GetMaxPrefixLength

func (x *InnerSpec) GetMaxPrefixLength() int32

func (*InnerSpec) GetMinPrefixLength

func (x *InnerSpec) GetMinPrefixLength() int32

func (*InnerSpec) ProtoMessage

func (*InnerSpec) ProtoMessage()

func (*InnerSpec) ProtoReflect

func (x *InnerSpec) ProtoReflect() protoreflect.Message

func (*InnerSpec) Reset

func (x *InnerSpec) Reset()

func (*InnerSpec) String

func (x *InnerSpec) String() string

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) Descriptor() ([]byte, []int)

Deprecated: Use LeafOp.ProtoReflect.Descriptor instead.

func (*LeafOp) GetHash

func (x *LeafOp) GetHash() HashOp

func (*LeafOp) GetLength

func (x *LeafOp) GetLength() LengthOp

func (*LeafOp) GetPrefix

func (x *LeafOp) GetPrefix() []byte

func (*LeafOp) GetPrehashKey

func (x *LeafOp) GetPrehashKey() HashOp

func (*LeafOp) GetPrehashValue

func (x *LeafOp) GetPrehashValue() HashOp

func (*LeafOp) ProtoMessage

func (*LeafOp) ProtoMessage()

func (*LeafOp) ProtoReflect

func (x *LeafOp) ProtoReflect() protoreflect.Message

func (*LeafOp) Reset

func (x *LeafOp) Reset()

func (*LeafOp) String

func (x *LeafOp) String() string

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) Enum

func (x LengthOp) Enum() *LengthOp

func (LengthOp) EnumDescriptor deprecated

func (LengthOp) EnumDescriptor() ([]byte, []int)

Deprecated: Use LengthOp.Descriptor instead.

func (LengthOp) Number

func (x LengthOp) Number() protoreflect.EnumNumber

func (LengthOp) String

func (x LengthOp) String() string

func (LengthOp) Type

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) Descriptor() ([]byte, []int)

Deprecated: Use ProofSpec.ProtoReflect.Descriptor instead.

func (*ProofSpec) GetInnerSpec

func (x *ProofSpec) GetInnerSpec() *InnerSpec

func (*ProofSpec) GetLeafSpec

func (x *ProofSpec) GetLeafSpec() *LeafOp

func (*ProofSpec) GetMaxDepth

func (x *ProofSpec) GetMaxDepth() int32

func (*ProofSpec) GetMinDepth

func (x *ProofSpec) GetMinDepth() int32

func (*ProofSpec) GetPrehashKeyBeforeComparison

func (x *ProofSpec) GetPrehashKeyBeforeComparison() bool

func (*ProofSpec) ProtoMessage

func (*ProofSpec) ProtoMessage()

func (*ProofSpec) ProtoReflect

func (x *ProofSpec) ProtoReflect() protoreflect.Message

func (*ProofSpec) Reset

func (x *ProofSpec) Reset()

func (*ProofSpec) String

func (x *ProofSpec) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL