cosmos-sdk/proto/cosmos/tx/tx.proto

134 lines
4.7 KiB
Protocol Buffer

syntax = "proto3";
package cosmos.tx;
import "gogoproto/gogo.proto";
import "cosmos/crypto/crypto.proto";
import "cosmos/cosmos.proto";
import "cosmos/tx/signing/signing.proto";
import "google/protobuf/any.proto";
option go_package = "github.com/cosmos/cosmos-sdk/types/tx";
// Tx is the standard type used for broadcasting transactions
message Tx {
// body is the processable content of the transaction
TxBody body = 1;
// auth_info is the authorization related content of the transaction, specifically
// signers, signer modes and fee
AuthInfo auth_info = 2;
// signatures are the raw binary signatures of signers specified by body and auth_info
repeated bytes signatures = 3;
}
// SignDoc is the standard type used for signing transaction in SIGN_MODE_DIRECT
message SignDoc {
// body is the TxBody from Tx
TxBody body = 1;
// auth_info is the AuthInfo from Tx
AuthInfo auth_info = 2;
// chain_id is the unique identifier of the chain this transaction targets.
// It prevents signed transactions from being used on another chain by an
// attacker
string chain_id = 3;
// account_number is the account number of the account in state
uint64 account_number = 4;
// account_sequence starts at 1 rather than 0 to avoid the case where
// the default 0 value must be omitted in protobuf serialization
uint64 account_sequence = 5;
}
// TxBody is the body of a transaction that all signers sign over
message TxBody {
// messages are the processable content of the transaction
repeated google.protobuf.Any messages = 1;
// memo is any arbitrary memo to be added to the transaction
string memo = 2;
// timeout is the block height after which this transaction will not
// be processed by the chain
int64 timeout_height = 3;
// extension_options are arbitrary options that can be added by chains
// when the default options are not sufficient. If any of these are present
// and can't be handled, the transaction will be rejected
repeated google.protobuf.Any extension_options = 1023;
// extension_options are arbitrary options that can be added by chains
// when the default options are not sufficient. If any of these are present
// and can't be handled, they will be ignored
repeated google.protobuf.Any non_critical_extension_options = 2047;
}
// AuthInfo describes the fee and signer modes that are used to sign a transaction
message AuthInfo {
// signer_infos is the list of signer infos which corresponds with
// Tx.signatures and expected signers derived from TxBody.messages. All signers
// are expected to occur in the same order in each of these locations
repeated SignerInfo signer_infos = 1;
// Fee is the fee and gas limit for the transaction. The first signer is the
// primary signer and the one which pays the fee
Fee fee = 2;
}
// SignerInfo describes the public key and signing mode of a single top-level signer
message SignerInfo {
// public_key is the public key of the signer. It is optional for accounts
// that already exist in state
google.protobuf.Any public_key = 1;
// mode_info describes the signing mode of the signer and is a nested
// structure to support nested multisig pubkey's
ModeInfo mode_info = 2;
}
// ModeInfo describes the signing mode of a single or nested multisig signer
message ModeInfo {
// sum is the oneof that specifies whether this represents a single or nested
// multisig signer
oneof sum {
// single represents a single signer
Single single = 1;
// multi represents a nested multisig signer
Multi multi = 2;
}
// Single is the mode info for a single signer. It is structured as a message
// to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the future
message Single {
// mode is the signing mode of the single signer
cosmos.tx.signing.SignMode mode = 1;
}
// Multi is the mode info for a multisig public key
message Multi {
// bitarray specifies which keys within the multisig are signing
cosmos.crypto.CompactBitArray bitarray = 1;
// mode_infos is the corresponding modes of the signers of the multisig
// which could include nested multisig public keys
repeated ModeInfo mode_infos = 2;
}
}
// Fee includes the amount of coins paid in fees and the maximum
// gas to be used by the transaction. The ratio yields an effective "gasprice",
// which must be above some miminum to be accepted into the mempool.
message Fee {
// amount is the amount of coins to be paid as a fee
repeated cosmos.Coin amount = 1
[(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"];
// gas_limit is the maximum gas that can be used in transaction processing
// before an out of gas error occurs
uint64 gas_limit = 2;
}