Documentation Index
Fetch the complete documentation index at: https://docs.decibel.trade/llms.txt
Use this file to discover all available pages before exploring further.
Overview
The optimized approach uses:- ABI (Application Binary Interface): Pre-loaded function signatures and parameter types.
- Replay Protection Nonce: A random 64-bit value embedded in the transaction payload to enable orderless transactions.
- Chain ID: The network identifier to prevent cross-chain replay attacks.
Orderless Transactions
These transactions are orderless, meaning they can be submitted in any order without requiring sequential sequence numbers. ThereplayProtectionNonce is embedded directly in the transaction payload to provide replay protection, eliminating the need to fetch the account’s current sequence number from the network.
Benefits of orderless transactions:
- No sequence number fetch: Avoids network round-trip to get account sequence number
- Parallel execution: Multiple transactions can be built and submitted simultaneously
- Better performance: Faster transaction construction without waiting for network responses
- Improved UX: Transactions can be prepared offline and submitted later
- Require fetching the account’s current sequence number from the network
- Must be submitted sequentially (each transaction increments the sequence number)
- Cannot be built in parallel without coordination
- Require network calls during transaction construction
Generate Replay Protection Nonce
The replay protection nonce is a random 64-bit value that enables orderless transactions. Instead of using the account’s sequence number (which requires a network fetch), the nonce is embedded in the transaction payload to prevent replay attacks. Generate a random 64-bit nonce for replay protection:Parse ABI to EntryFunctionABI
Before building a transaction, parse theMoveFunction ABI to the EntryFunctionABI format required for transaction payload construction.
Generate Expiration Timestamp
A convenience function to compute the expiration timestamp for the transaction.Build Transaction Synchronously
This function builds a transaction payload and constructs aRawTransaction synchronously using all pre-known parameters.
Complete Example: Building a Transaction
Below is a complete example of building and submitting a transaction using the optimized (orderless, synchronous) approach.Benefits
- Performance: No network calls during transaction construction
- Reliability: Deterministic transaction building with pre-loaded ABI
- Security: Replay protection nonce prevents transaction replay attacks
- Efficiency: Can build multiple transactions in parallel without blocking
When to Use
Use the optimized synchronous approach when:- You have ABI data available locally
- You know the chain ID
- You want to build transactions without network latency
- You’re building multiple transactions in batch
Fallback to Async Building
If ABI or chain ID is not available, the SDK falls back to async transaction building, which may require a network fetch to get the account’s sequence number for replay protection.- The SDK makes a network request to fetch the account’s current sequence number when you call
aptos.transaction.build.simple() - The sequence number is used for replay protection instead of (or in addition to) the nonce
- Transactions must be submitted sequentially
- Each transaction increments the sequence number, preventing parallel submission

