evmos.proto.autogen.py.ics23

Classes

BatchEntry(exist, nonexist)

Use BatchEntry not CommitmentProof, to avoid recursion

BatchProof(entries)

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

CommitmentProof(exist, nonexist, batch, ...)

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

CompressedBatchEntry(exist, nonexist)

Use BatchEntry not CommitmentProof, to avoid recursion

CompressedBatchProof(entries, lookup_inners)

CompressedExistenceProof(key, value, leaf, path)

CompressedNonExistenceProof(key, left, right)

ExistenceProof(key, value, leaf, path)

* ExistenceProof takes a key and a value and a set of steps to perform on it.

HashOp(value)

An enumeration.

InnerOp(hash, prefix, suffix)

* InnerOp represents a merkle-proof step that is not a leaf.

InnerSpec(child_order, child_size, ...)

InnerSpec contains all store-specific structure info to determine if two proofs from a given store are neighbors.

LeafOp(hash, prehash_key, prehash_value, ...)

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

LengthOp(value)

* LengthOp defines how to process the key and value of the LeafOp to include length information.

NonExistenceProof(key, left, right)

NonExistenceProof takes a proof of two neighbors, one left of the desired key, one right of the desired key.

ProofSpec(leaf_spec, inner_spec, max_depth, ...)

* ProofSpec defines what the expected parameters are for a given proof type.

class evmos.proto.autogen.py.ics23.BatchEntry(exist: ~evmos.proto.autogen.py.ics23.ExistenceProof = <object object>, nonexist: ~evmos.proto.autogen.py.ics23.NonExistenceProof = <object object>)[source]

Bases: Message

Use BatchEntry not CommitmentProof, to avoid recursion

exist: ExistenceProof = <object object>
nonexist: NonExistenceProof = <object object>
class evmos.proto.autogen.py.ics23.BatchProof(entries: ~typing.List[~evmos.proto.autogen.py.ics23.BatchEntry] = <object object>)[source]

Bases: Message

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

entries: List[BatchEntry] = <object object>
class evmos.proto.autogen.py.ics23.CommitmentProof(exist: ~evmos.proto.autogen.py.ics23.ExistenceProof = <object object>, nonexist: ~evmos.proto.autogen.py.ics23.NonExistenceProof = <object object>, batch: ~evmos.proto.autogen.py.ics23.BatchProof = <object object>, compressed: ~evmos.proto.autogen.py.ics23.CompressedBatchProof = <object object>)[source]

Bases: Message

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

batch: BatchProof = <object object>
compressed: CompressedBatchProof = <object object>
exist: ExistenceProof = <object object>
nonexist: NonExistenceProof = <object object>
class evmos.proto.autogen.py.ics23.CompressedBatchEntry(exist: ~evmos.proto.autogen.py.ics23.CompressedExistenceProof = <object object>, nonexist: ~evmos.proto.autogen.py.ics23.CompressedNonExistenceProof = <object object>)[source]

Bases: Message

Use BatchEntry not CommitmentProof, to avoid recursion

exist: CompressedExistenceProof = <object object>
nonexist: CompressedNonExistenceProof = <object object>
class evmos.proto.autogen.py.ics23.CompressedBatchProof(entries: List[ForwardRef('CompressedBatchEntry')] = <object object at 0x7f9e85778540>, lookup_inners: List[ForwardRef('InnerOp')] = <object object at 0x7f9e85778540>)[source]

Bases: Message

entries: List[CompressedBatchEntry] = <object object>
lookup_inners: List[InnerOp] = <object object>
class evmos.proto.autogen.py.ics23.CompressedExistenceProof(key: bytes = <object object at 0x7f9e85778540>, value: bytes = <object object at 0x7f9e85778540>, leaf: 'LeafOp' = <object object at 0x7f9e85778540>, path: List[int] = <object object at 0x7f9e85778540>)[source]

Bases: Message

key: bytes = <object object>
leaf: LeafOp = <object object>
path: List[int] = <object object>

these are indexes into the lookup_inners table in CompressedBatchProof

value: bytes = <object object>
class evmos.proto.autogen.py.ics23.CompressedNonExistenceProof(key: bytes = <object object at 0x7f9e85778540>, left: 'CompressedExistenceProof' = <object object at 0x7f9e85778540>, right: 'CompressedExistenceProof' = <object object at 0x7f9e85778540>)[source]

Bases: Message

key: bytes = <object object>
left: CompressedExistenceProof = <object object>
right: CompressedExistenceProof = <object object>
class evmos.proto.autogen.py.ics23.ExistenceProof(key: bytes = <object object>, value: bytes = <object object>, leaf: ~evmos.proto.autogen.py.ics23.LeafOp = <object object>, path: ~typing.List[~evmos.proto.autogen.py.ics23.InnerOp] = <object object>)[source]

Bases: Message

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

key: bytes = <object object>
leaf: LeafOp = <object object>
path: List[InnerOp] = <object object>
value: bytes = <object object>
class evmos.proto.autogen.py.ics23.HashOp(value)[source]

Bases: Enum

An enumeration.

BITCOIN = 5
KECCAK = 3
NO_HASH = 0

NO_HASH is the default if no data passed. Note this is an illegal argument some places.

RIPEMD160 = 4
SHA256 = 1
SHA512 = 2
class evmos.proto.autogen.py.ics23.InnerOp(hash: ~evmos.proto.autogen.py.ics23.HashOp = <object object>, prefix: bytes = <object object>, suffix: bytes = <object object>)[source]

Bases: Message

* 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

hash: HashOp = <object object>
prefix: bytes = <object object>
suffix: bytes = <object object>
class evmos.proto.autogen.py.ics23.InnerSpec(child_order: ~typing.List[int] = <object object>, child_size: int = <object object>, min_prefix_length: int = <object object>, max_prefix_length: int = <object object>, empty_child: bytes = <object object>, hash: ~evmos.proto.autogen.py.ics23.HashOp = <object object>)[source]

Bases: Message

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)

child_order: List[int] = <object object>

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)

child_size: int = <object object>
empty_child: bytes = <object object>

empty child is the prehash image that is used when one child is nil (eg. 20 bytes of 0)

hash: HashOp = <object object>

hash is the algorithm that must be used for each InnerOp

max_prefix_length: int = <object object>
min_prefix_length: int = <object object>
class evmos.proto.autogen.py.ics23.LeafOp(hash: ~evmos.proto.autogen.py.ics23.HashOp = <object object>, prehash_key: ~evmos.proto.autogen.py.ics23.HashOp = <object object>, prehash_value: ~evmos.proto.autogen.py.ics23.HashOp = <object object>, length: ~evmos.proto.autogen.py.ics23.LengthOp = <object object>, prefix: bytes = <object object>)[source]

Bases: Message

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

hash: HashOp = <object object>
length: LengthOp = <object object>
prefix: bytes = <object object>

prefix is a fixed bytes that may optionally be included at the beginning to differentiate a leaf node from an inner node.

prehash_key: HashOp = <object object>
prehash_value: HashOp = <object object>
class evmos.proto.autogen.py.ics23.LengthOp(value)[source]

Bases: Enum

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

FIXED32_BIG = 3

FIXED32_BIG uses big-endian encoding of the length as a 32 bit integer

FIXED32_LITTLE = 4

FIXED32_LITTLE uses little-endian encoding of the length as a 32 bit integer

FIXED64_BIG = 5

FIXED64_BIG uses big-endian encoding of the length as a 64 bit integer

FIXED64_LITTLE = 6

FIXED64_LITTLE uses little-endian encoding of the length as a 64 bit integer

NO_PREFIX = 0

NO_PREFIX don’t include any length info

REQUIRE_32_BYTES = 7

REQUIRE_32_BYTES is like NONE, but will fail if the input is not exactly 32 bytes (sha256 output)

REQUIRE_64_BYTES = 8

REQUIRE_64_BYTES is like NONE, but will fail if the input is not exactly 64 bytes (sha512 output)

VAR_PROTO = 1

VAR_PROTO uses protobuf (and go-amino) varint encoding of the length

VAR_RLP = 2

VAR_RLP uses rlp int encoding of the length

class evmos.proto.autogen.py.ics23.NonExistenceProof(key: bytes = <object object>, left: ~evmos.proto.autogen.py.ics23.ExistenceProof = <object object>, right: ~evmos.proto.autogen.py.ics23.ExistenceProof = <object object>)[source]

Bases: Message

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.

key: bytes = <object object>
left: ExistenceProof = <object object>
right: ExistenceProof = <object object>
class evmos.proto.autogen.py.ics23.ProofSpec(leaf_spec: ~evmos.proto.autogen.py.ics23.LeafOp = <object object>, inner_spec: ~evmos.proto.autogen.py.ics23.InnerSpec = <object object>, max_depth: int = <object object>, min_depth: int = <object object>)[source]

Bases: Message

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

inner_spec: InnerSpec = <object object>
leaf_spec: LeafOp = <object object>

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)

max_depth: int = <object object>

max_depth (if > 0) is the maximum number of InnerOps allowed (mainly for fixed-depth tries)

min_depth: int = <object object>

min_depth (if > 0) is the minimum number of InnerOps allowed (mainly for fixed-depth tries)