Signer: the account that signs the transactionActions: the set of actions to be performed (see below)Receiver: the account on which to perform the actions
PublicKey: the public key used to sign the transaction (so the network can verify the signature)Nonce: a number that is incremented for each transaction sent by theSignerBlockHash: the hash of a recent block, to limit the time-validity of the transaction
About nonce values
- When adding a key, the
nonceis automatically assigned - particularly, it is given the valueblock height * 10^6- so the value in theADD_KEYaction is ignored - A transaction is accepted only if the
noncevalue is in the range of:[(current_nonce_of_access_key + 1) .. (block_height * 10^6)]
- Once a transaction is accepted, the access key’s
nonceis set to thenoncevalue of the included transaction - A transaction signed with a gas key additionally specifies a
nonce_indexselecting one of the key’s parallel nonce lanes; the same rules then apply to that lane’s nonce independently
Transaction limits
A signed transaction must fit within both of these limits:
The size limit includes the entire signed transaction: account IDs, public key, nonce, block hash, actions (including function-call arguments or contract code), and signature. The space available for your payload is therefore smaller than 1.5 MiB. Nodes reject larger transactions with
TransactionSizeExceeded.
The size and gas limits are separate: attaching more gas does not let you upload more bytes. To upload larger data, split it across transactions if your contract supports incremental uploads.
These limits are configured by max_transaction_size and max_total_prepaid_gas in the protocol configuration.
Actions
Each transaction can have one or multipleActions, which are the actual operations to be performed on the Receiver account. There are different types of actions that can be performed:
FunctionCall: to invoke a function on a contract (optionally attaching NEAR to the call)Transfer: to transfer tokens to another accountDeployContract: to deploy a contract in the accountDeployGlobalContract: registers a global contract referenced by its contract hash or by its account IDUseGlobalContract: uses a registered global contract by contract hash or account IDCreateAccount: to create a new sub-account (e.g.ana.nearcan createsub.ana.near)DeleteAccount: to delete the account (transferring the remaining balance to a beneficiary)AddKey: to add a new key to the account (eitherFullAccessorFunctionCallaccess, optionally as a gas key)DeleteKey: to delete an existing key from the accountTransferToGasKey: to fund a gas key’s prepaid gas balance with NEARWithdrawFromGasKey: to move NEAR from a gas key’s balance back to the accountDelegateActions: to create a meta-transaction (Delegate).DelegateV2, which lets a gas key sign the delegate action, is rejected from protocol version 87Stake: special action to express interest in becoming a network validator (its ownpublic_keyfield — the validator’s block-production key — must stayed25519, regardless of what key signed the transaction)DeterministicStateInit: special action to create a deterministic account (an advanced kind of implicit account)UniversalStateInit: special action to create a universal account, installing its code, storage, and access keys in one step
bob.near can bundle the following actions in a single transaction:
- Create the account
contract.bob.near - Transfer 5 NEAR to
contract.bob.near - Deploy a contract in
contract.bob.near - Call the function
initincontract.bob.near
Actions are executed in the order they are specified in the transaction. If any of the actions fails, the transaction is discarded and none of the actions take effect.