2020-05-06 08:17:50 -07:00
|
|
|
syntax = "proto3";
|
2020-06-18 10:04:26 -07:00
|
|
|
package ibc.commitment;
|
2020-05-06 08:17:50 -07:00
|
|
|
|
|
|
|
option go_package = "github.com/cosmos/cosmos-sdk/x/ibc/23-commitment/types";
|
|
|
|
|
2020-06-18 10:04:26 -07:00
|
|
|
import "gogoproto/gogo.proto";
|
2020-08-14 10:58:53 -07:00
|
|
|
import "tendermint/crypto/proof.proto";
|
2020-05-06 08:17:50 -07:00
|
|
|
|
|
|
|
// MerkleRoot defines a merkle root hash.
|
|
|
|
// In the Cosmos SDK, the AppHash of a block header becomes the root.
|
|
|
|
message MerkleRoot {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
bytes hash = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// MerklePrefix is merkle path prefixed to the key.
|
2020-09-25 03:25:37 -07:00
|
|
|
// The constructed key from the Path and the key will be append(Path.KeyPath,
|
|
|
|
// append(Path.KeyPrefix, key...))
|
2020-05-06 08:17:50 -07:00
|
|
|
message MerklePrefix {
|
|
|
|
bytes key_prefix = 1 [(gogoproto.moretags) = "yaml:\"key_prefix\""];
|
|
|
|
}
|
|
|
|
|
2020-09-25 03:25:37 -07:00
|
|
|
// MerklePath is the path used to verify commitment proofs, which can be an
|
|
|
|
// arbitrary structured object (defined by a commitment type).
|
2020-05-06 08:17:50 -07:00
|
|
|
message MerklePath {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
|
2020-09-08 15:06:54 -07:00
|
|
|
KeyPath key_path = 1 [(gogoproto.nullable) = false, (gogoproto.moretags) = "yaml:\"key_path\""];
|
2020-05-06 08:17:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// MerkleProof is a wrapper type that contains a merkle proof.
|
2020-09-25 03:25:37 -07:00
|
|
|
// It demonstrates membership or non-membership for an element or set of
|
|
|
|
// elements, verifiable in conjunction with a known commitment root. Proofs
|
|
|
|
// should be succinct.
|
2020-05-06 08:17:50 -07:00
|
|
|
message MerkleProof {
|
2020-08-14 10:58:53 -07:00
|
|
|
tendermint.crypto.ProofOps proof = 1;
|
2020-05-06 08:17:50 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
// KeyPath defines a slice of keys
|
|
|
|
message KeyPath {
|
|
|
|
option (gogoproto.goproto_stringer) = false;
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
repeated Key keys = 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Key defines a proof Key
|
|
|
|
message Key {
|
|
|
|
option (gogoproto.goproto_getters) = false;
|
|
|
|
|
|
|
|
bytes name = 1 [(gogoproto.customname) = "name"];
|
|
|
|
KeyEncoding enc = 2 [(gogoproto.customname) = "enc"];
|
|
|
|
}
|
|
|
|
|
|
|
|
// KeyEncoding defines the encoding format of a key's bytes.
|
|
|
|
enum KeyEncoding {
|
|
|
|
option (gogoproto.goproto_enum_stringer) = false;
|
|
|
|
option (gogoproto.goproto_enum_prefix) = false;
|
|
|
|
|
|
|
|
// URL encoding
|
|
|
|
KEY_ENCODING_URL_UNSPECIFIED = 0 [(gogoproto.enumvalue_customname) = "URL"];
|
|
|
|
// Hex encoding
|
|
|
|
KEY_ENCODING_HEX = 1 [(gogoproto.enumvalue_customname) = "HEX"];
|
2020-06-18 10:04:26 -07:00
|
|
|
}
|