package cosmos.ics23.v1

Mouse Melon logoGet desktop application:
View/edit binary Protocol Buffers messages

message BatchEntry

proofs.proto:200

Use BatchEntry not CommitmentProof, to avoid recursion

Used in: BatchProof

message BatchProof

proofs.proto:195

BatchProof is a group of multiple proof types than can be compressed

Used in: CommitmentProof

message CommitmentProof

proofs.proto:87

CommitmentProof is either an ExistenceProof or a NonExistenceProof, or a Batch of such messages

message CompressedBatchEntry

proofs.proto:215

Use BatchEntry not CommitmentProof, to avoid recursion

Used in: CompressedBatchProof

message CompressedBatchProof

proofs.proto:209

Used in: CommitmentProof

message CompressedExistenceProof

proofs.proto:222

Used in: CompressedBatchEntry, CompressedNonExistenceProof

message CompressedNonExistenceProof

proofs.proto:230

Used in: CompressedBatchEntry

message ExistenceProof

proofs.proto:66

* 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.

Used in: BatchEntry, CommitmentProof, NonExistenceProof

enum HashOp

proofs.proto:7

Used in: InnerOp, InnerSpec, LeafOp

message InnerOp

proofs.proto:139

* 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

Used in: CompressedBatchProof, ExistenceProof

message InnerSpec

proofs.proto:178

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)

Used in: ProofSpec

message LeafOp

proofs.proto:112

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

Used in: CompressedExistenceProof, ExistenceProof, ProofSpec

enum LengthOp

proofs.proto:24

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

Used in: LeafOp

message NonExistenceProof

proofs.proto:78

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.

Used in: BatchEntry, CommitmentProof

message ProofSpec

proofs.proto:157

* 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.