github.com/fibonacci-chain/fbc@v0.0.0-20231124064014-c7636198c1e9/libs/cosmos-sdk/types/tx/tx.proto (about) 1 syntax = "proto3"; 2 package cosmos.tx.v1beta1; 3 4 import "gogoproto/gogo.proto"; 5 import "cosmos/crypto/multisig/v1beta1/multisig.proto"; 6 import "cosmos/base/v1beta1/coin.proto"; 7 import "cosmos/tx/signing/v1beta1/signing.proto"; 8 import "google/protobuf/any.proto"; 9 10 option go_package = "github.com/cosmos/cosmos-sdk/types/tx"; 11 12 // Tx is the standard type used for broadcasting transactions. 13 message Tx { 14 // body is the processable content of the transaction 15 TxBody body = 1; 16 17 // auth_info is the authorization related content of the transaction, 18 // specifically signers, signer modes and fee 19 AuthInfo auth_info = 2; 20 21 // signatures is a list of signatures that matches the length and order of 22 // AuthInfo's signer_infos to allow connecting signature meta information like 23 // public key and signing mode by position. 24 repeated bytes signatures = 3; 25 } 26 27 // TxRaw is a variant of Tx that pins the signer's exact binary representation 28 // of body and auth_info. This is used for signing, broadcasting and 29 // verification. The binary `serialize(tx: TxRaw)` is stored in Tendermint and 30 // the hash `sha256(serialize(tx: TxRaw))` becomes the "txhash", commonly used 31 // as the transaction ID. 32 message TxRaw { 33 // body_bytes is a protobuf serialization of a TxBody that matches the 34 // representation in SignDoc. 35 bytes body_bytes = 1; 36 37 // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the 38 // representation in SignDoc. 39 bytes auth_info_bytes = 2; 40 41 // signatures is a list of signatures that matches the length and order of 42 // AuthInfo's signer_infos to allow connecting signature meta information like 43 // public key and signing mode by position. 44 repeated bytes signatures = 3; 45 } 46 47 // SignDoc is the type used for generating sign bytes for SIGN_MODE_DIRECT. 48 message SignDoc { 49 // body_bytes is protobuf serialization of a TxBody that matches the 50 // representation in TxRaw. 51 bytes body_bytes = 1; 52 53 // auth_info_bytes is a protobuf serialization of an AuthInfo that matches the 54 // representation in TxRaw. 55 bytes auth_info_bytes = 2; 56 57 // chain_id is the unique identifier of the chain this transaction targets. 58 // It prevents signed transactions from being used on another chain by an 59 // attacker 60 string chain_id = 3; 61 62 // account_number is the account number of the account in state 63 uint64 account_number = 4; 64 } 65 66 // TxBody is the body of a transaction that all signers sign over. 67 message TxBody { 68 // messages is a list of messages to be executed. The required signers of 69 // those messages define the number and order of elements in AuthInfo's 70 // signer_infos and Tx's signatures. Each required signer address is added to 71 // the list only the first time it occurs. 72 // By convention, the first required signer (usually from the first message) 73 // is referred to as the primary signer and pays the fee for the whole 74 // transaction. 75 repeated google.protobuf.Any messages = 1; 76 77 // memo is any arbitrary note/comment to be added to the transaction. 78 // WARNING: in clients, any publicly exposed text should not be called memo, 79 // but should be called `note` instead (see https://github.com/cosmos/cosmos-sdk/issues/9122). 80 string memo = 2; 81 82 // timeout is the block height after which this transaction will not 83 // be processed by the chain 84 uint64 timeout_height = 3; 85 86 // extension_options are arbitrary options that can be added by chains 87 // when the default options are not sufficient. If any of these are present 88 // and can't be handled, the transaction will be rejected 89 repeated google.protobuf.Any extension_options = 1023; 90 91 // extension_options are arbitrary options that can be added by chains 92 // when the default options are not sufficient. If any of these are present 93 // and can't be handled, they will be ignored 94 repeated google.protobuf.Any non_critical_extension_options = 2047; 95 } 96 97 // AuthInfo describes the fee and signer modes that are used to sign a 98 // transaction. 99 message AuthInfo { 100 // signer_infos defines the signing modes for the required signers. The number 101 // and order of elements must match the required signers from TxBody's 102 // messages. The first element is the primary signer and the one which pays 103 // the fee. 104 repeated SignerInfo signer_infos = 1; 105 106 // Fee is the fee and gas limit for the transaction. The first signer is the 107 // primary signer and the one which pays the fee. The fee can be calculated 108 // based on the cost of evaluating the body and doing signature verification 109 // of the signers. This can be estimated via simulation. 110 Fee fee = 2; 111 } 112 113 // SignerInfo describes the public key and signing mode of a single top-level 114 // signer. 115 message SignerInfo { 116 // public_key is the public key of the signer. It is optional for accounts 117 // that already exist in state. If unset, the verifier can use the required \ 118 // signer address for this position and lookup the public key. 119 google.protobuf.Any public_key = 1; 120 121 // mode_info describes the signing mode of the signer and is a nested 122 // structure to support nested multisig pubkey's 123 ModeInfo mode_info = 2; 124 125 // sequence is the sequence of the account, which describes the 126 // number of committed transactions signed by a given address. It is used to 127 // prevent replay attacks. 128 uint64 sequence = 3; 129 } 130 131 // ModeInfo describes the signing mode of a single or nested multisig signer. 132 message ModeInfo { 133 // sum is the oneof that specifies whether this represents a single or nested 134 // multisig signer 135 oneof sum { 136 // single represents a single signer 137 Single single = 1; 138 139 // multi represents a nested multisig signer 140 Multi multi = 2; 141 } 142 143 // Single is the mode info for a single signer. It is structured as a message 144 // to allow for additional fields such as locale for SIGN_MODE_TEXTUAL in the 145 // future 146 message Single { 147 // mode is the signing mode of the single signer 148 cosmos.tx.signing.v1beta1.SignMode mode = 1; 149 } 150 151 // Multi is the mode info for a multisig public key 152 message Multi { 153 // bitarray specifies which keys within the multisig are signing 154 cosmos.crypto.multisig.v1beta1.CompactBitArray bitarray = 1; 155 156 // mode_infos is the corresponding modes of the signers of the multisig 157 // which could include nested multisig public keys 158 repeated ModeInfo mode_infos = 2; 159 } 160 } 161 162 // Fee includes the amount of coins paid in fees and the maximum 163 // gas to be used by the transaction. The ratio yields an effective "gasprice", 164 // which must be above some miminum to be accepted into the mempool. 165 message Fee { 166 // amount is the amount of coins to be paid as a fee 167 repeated cosmos.base.v1beta1.Coin amount = 1 168 [(gogoproto.nullable) = false, (gogoproto.castrepeated) = "github.com/cosmos/cosmos-sdk/types.Coins"]; 169 170 // gas_limit is the maximum gas that can be used in transaction processing 171 // before an out of gas error occurs 172 uint64 gas_limit = 2; 173 174 // if unset, the first signer is responsible for paying the fees. If set, the specified account must pay the fees. 175 // the payer must be a tx signer (and thus have signed this field in AuthInfo). 176 // setting this field does *not* change the ordering of required signers for the transaction. 177 string payer = 3; 178 179 // if set, the fee payer (either the first signer or the value of the payer field) requests that a fee grant be used 180 // to pay fees instead of the fee payer's own balance. If an appropriate fee grant does not exist or the chain does 181 // not support fee grants, this will fail 182 string granter = 4; 183 }