Skip to content
🎉 Welcome to the new Aptos Docs! Click here to submit an issue.
BuildGuidesOrderless Transactions

Orderless Transactions

As outlined in AIP-123, orderless transactions allow for transactions to be executed out of order, which is particularly useful in scenarios where multiple machines need to sign for a single sending account, but the order in which they sign does not affect the outcome of the transaction or matter to the creator. Replay is protected by a nonce, which is a unique identifier for a transaction. This allows for the transaction to be executed at any time within the expiration time, regardless of the order in which the machines sign the transaction, but not be able to be replayed after the nonce has expired. The maximum expiration time is 60 seconds for orderless transactions, which is not the same for sequence number transactions.

Process Overview

Orderless transactions are dependent on the transaction payload specified in AIP-129. The process for building and executing an orderless transaction is as follows:

  1. Build a transaction with a replayProtectionNonce and a TransactionPayload::TransactionPayloadPayload that defines the operation to be executed.
  2. Sign and submit the transaction as any other transaction, but with the replayProtectionNonce set. Ideally, the nonce should be a random u64 value.

Note, that the behavior of the replayProtectionNonce is similar to a sequence number, but it does not guarantee ordered execution of transactions. Instead, it ensures that the transaction is unique and cannot be replayed (executed twice) with the same nonce.

SDK Support

These are demonstrations of sponsored transactions: