syntax = "proto3"; package tendermint.types; option go_package = "github.com/tendermint/tendermint/proto/tendermint/types"; import "gogoproto/gogo.proto"; import "google/protobuf/timestamp.proto"; import "tendermint/crypto/proof.proto"; import "tendermint/version/types.proto"; import "tendermint/types/validator.proto"; // BlockIdFlag indicates which BlcokID the signature is for enum BlockIDFlag { option (gogoproto.goproto_enum_stringer) = true; option (gogoproto.goproto_enum_prefix) = false; BLOCK_ID_FLAG_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "BlockIDFlagUnknown"]; BLOCK_ID_FLAG_ABSENT = 1 [(gogoproto.enumvalue_customname) = "BlockIDFlagAbsent"]; BLOCK_ID_FLAG_COMMIT = 2 [(gogoproto.enumvalue_customname) = "BlockIDFlagCommit"]; BLOCK_ID_FLAG_NIL = 3 [(gogoproto.enumvalue_customname) = "BlockIDFlagNil"]; } // SignedMsgType is a type of signed message in the consensus. enum SignedMsgType { option (gogoproto.goproto_enum_stringer) = true; option (gogoproto.goproto_enum_prefix) = false; SIGNED_MSG_TYPE_UNKNOWN = 0 [(gogoproto.enumvalue_customname) = "UnknownType"]; // Votes SIGNED_MSG_TYPE_PREVOTE = 1 [(gogoproto.enumvalue_customname) = "PrevoteType"]; SIGNED_MSG_TYPE_PRECOMMIT = 2 [(gogoproto.enumvalue_customname) = "PrecommitType"]; // Proposals SIGNED_MSG_TYPE_PROPOSAL = 32 [(gogoproto.enumvalue_customname) = "ProposalType"]; } // PartsetHeader message PartSetHeader { uint32 total = 1; bytes hash = 2; } message Part { uint32 index = 1; bytes bytes = 2; tendermint.crypto.Proof proof = 3 [(gogoproto.nullable) = false]; } // BlockID message BlockID { bytes hash = 1; PartSetHeader part_set_header = 2 [(gogoproto.nullable) = false]; } // -------------------------------- // Header defines the structure of a block header. message Header { // basic block info tendermint.version.Consensus version = 1 [(gogoproto.nullable) = false]; string chain_id = 2 [(gogoproto.customname) = "ChainID"]; int64 height = 3; google.protobuf.Timestamp time = 4 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; // prev block info BlockID last_block_id = 5 [(gogoproto.nullable) = false]; // hashes of block data bytes last_commit_hash = 6; // commit from validators from the last block bytes data_hash = 7; // transactions // hashes from the app output from the prev block bytes validators_hash = 8; // validators for the current block bytes next_validators_hash = 9; // validators for the next block bytes consensus_hash = 10; // consensus params for current block bytes app_hash = 11; // state after txs from the previous block bytes last_results_hash = 12; // root hash of all results from the txs from the previous block // consensus info bytes evidence_hash = 13; // evidence included in the block bytes proposer_address = 14; // original proposer of the block } // Data contains all the information needed for a consensus full node to // reconstruct an extended data square. message Data { // Txs that will be applied to state in block.Height + 1 because deferred execution. // This means that the block.AppHash of this block does not include these txs. // NOTE: not all txs here are valid. We're just agreeing on the order first. repeated bytes txs = 1; reserved 2, 3, 4; // field number 2 is reserved for intermediate state roots // field number 3 is reserved for evidence // field number 4 is reserved for blobs // SquareSize is the number of rows or columns in the original data square. uint64 square_size = 5; // Hash is the root of a binary Merkle tree where the leaves of the tree are // the row and column roots of an extended data square. Hash is often referred // to as the "data root". bytes hash = 6; } // Blob (named after binary large object) is a chunk of data submitted by a user // to be published to the Celestia blockchain. The data of a Blob is published // to a namespace and is encoded into shares based on the format specified by // share_version. message Blob { bytes namespace_id = 1; bytes data = 2; uint32 share_version = 3; uint32 namespace_version = 4; } // Vote represents a prevote, precommit, or commit vote from validators for // consensus. message Vote { SignedMsgType type = 1; int64 height = 2; int32 round = 3; BlockID block_id = 4 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; // zero if vote is nil. google.protobuf.Timestamp timestamp = 5 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; bytes validator_address = 6; int32 validator_index = 7; bytes signature = 8; } // Commit contains the evidence that a block was committed by a set of validators. message Commit { int64 height = 1; int32 round = 2; BlockID block_id = 3 [(gogoproto.nullable) = false, (gogoproto.customname) = "BlockID"]; repeated CommitSig signatures = 4 [(gogoproto.nullable) = false]; } // CommitSig is a part of the Vote included in a Commit. message CommitSig { BlockIDFlag block_id_flag = 1; bytes validator_address = 2; google.protobuf.Timestamp timestamp = 3 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; bytes signature = 4; } message Proposal { SignedMsgType type = 1; int64 height = 2; int32 round = 3; int32 pol_round = 4; BlockID block_id = 5 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; google.protobuf.Timestamp timestamp = 6 [(gogoproto.nullable) = false, (gogoproto.stdtime) = true]; bytes signature = 7; } message SignedHeader { Header header = 1; Commit commit = 2; } message LightBlock { SignedHeader signed_header = 1; tendermint.types.ValidatorSet validator_set = 2; } message BlockMeta { BlockID block_id = 1 [(gogoproto.customname) = "BlockID", (gogoproto.nullable) = false]; int64 block_size = 2; Header header = 3 [(gogoproto.nullable) = false]; int64 num_txs = 4; } // TxProof represents a Merkle proof of the presence of a transaction in the // Merkle tree. // // Note: TxProof is not used in celestia-core because of modifications to the // data root. In a normal Cosmos chain, the data root is the root of a Merkle // tree of transactions in the block. However, in Celestia the data root is the // root of the row and column roots in the extended data square. See // https://github.com/celestiaorg/celestia-app/blob/852a229f11f0f269021b36f7621609f432bb858b/pkg/da/data_availability_header.go // for more details. Therefore, TxProof isn't sufficient to prove the existence // of a transaction in a Celestia block and ShareProof was defined instead. See // ShareProof for more details. message TxProof { bytes root_hash = 1; bytes data = 2; tendermint.crypto.Proof proof = 3; } // IndexWrapper adds index metadata to a transaction. This is used to track // transactions that pay for blobs, and where the blobs start in the square. message IndexWrapper { bytes tx = 1; repeated uint32 share_indexes = 2; string type_id = 3; } // BlobTx wraps an encoded sdk.Tx with a second field to contain blobs of data. // The raw bytes of the blobs are not signed over, instead we verify each blob // using the relevant MsgPayForBlobs that is signed over in the encoded sdk.Tx. message BlobTx { bytes tx = 1; repeated Blob blobs = 2; string type_id = 3; } // ShareProof is an NMT proof that a set of shares exist in a set of rows and a // Merkle proof that those rows exist in a Merkle tree with a given data root. message ShareProof { repeated bytes data = 1; repeated NMTProof share_proofs = 2; bytes namespace_id = 3; RowProof row_proof = 4; uint32 namespace_version = 5; } // RowProof is a Merkle proof that a set of rows exist in a Merkle tree with a // given data root. message RowProof { repeated bytes row_roots = 1; repeated tendermint.crypto.Proof proofs = 2; bytes root = 3; uint32 start_row = 4; uint32 end_row = 5; } // NMTProof is a proof of a namespace.ID in an NMT. // In case this proof proves the absence of a namespace.ID // in a tree it also contains the leaf hashes of the range // where that namespace would be. message NMTProof { // Start index of this proof. int32 start = 1; // End index of this proof. int32 end = 2; // Nodes that together with the corresponding leaf values can be used to // recompute the root and verify this proof. Nodes should consist of the max // and min namespaces along with the actual hash, resulting in each being 48 // bytes each repeated bytes nodes = 3; // leafHash are nil if the namespace is present in the NMT. In case the // namespace to be proved is in the min/max range of the tree but absent, this // will contain the leaf hash necessary to verify the proof of absence. Leaf // hashes should consist of the namespace along with the actual hash, // resulting 40 bytes total. bytes leaf_hash = 4; }