Skip to content
Every Solana transaction includes a recent blockhash—a reference to a recent network state that proves the transaction was created “now.” The network rejects any transaction with a blockhash older than 150 blocks (about 30 seconds at 200ms slots), preventing replay attacks and stale submissions. This works perfectly for real-time payments. But it breaks workflows that need a gap between signing and submission, such as:
ScenarioWhy Standard Transactions Fail
Treasury operationsCFO in Tokyo signs, Controller in NYC approves—30 seconds isn’t enough
Compliance workflowsTransactions need legal/compliance review before execution
Cold storage signingAir-gapped machines require manual transfer of signed transactions
Batch preparationPrepare payroll or disbursements during business hours, execute overnight
Multi-sig coordinationMultiple approvers across time zones
Scheduled paymentsSchedule payments to be executed at a future date
In traditional finance, a signed check doesn’t expire in 30 seconds. Certain onchain operations shouldn’t either. Durable nonces solve this by replacing the recent blockhash with a stored, persistent value that only advances when you use it—giving you transactions that stay valid until you’re ready to submit.

​How It Works

Instead of a recent blockhash (valid ~150 blocks), you use a nonce account, a special account that stores a unique value which can be used in place of a blockhash. Each transaction using this nonce must “advance” it as the first instruction. Each nonce value can only be used for one transaction.
Durable NonceDurable Nonce

Durable Nonce

Standard BlockhashStandard Blockhash

Standard Blockhash

The nonce account costs about 0.001 SOL for rent exemption (1,056,640 lamports for its 80 bytes at the rate mainnet and devnet use as of November 2026; local validators can charge more). One nonce account = one pending transaction at a time. For parallel workflows, create multiple nonce accounts.

​Create a Nonce Account

Creating a nonce account requires two instructions in a single transaction:
  1. Create the account using getCreateAccountInstruction from the System Program
  2. Initialize it as a nonce using getInitializeNonceAccountInstruction
1

Generate Keypair

Generate a new keypair to use as the nonce account address and calculate the required space and rent.
Create Nonce Account
2

Create Account Instruction

Create the account owned by the System Program with enough lamports for rent exemption.
Create Nonce Account
3

Initialize Nonce Instruction

Initialize the account as a nonce account, setting the authority that can advance it.
Create Nonce Account
4

Build Transaction

Build a transaction with both instructions.
Create Nonce Account
5

Sign and Send

Sign and send the transaction to create and initialize the nonce account.
Create Nonce Account

​Build a Deferred Transaction

Instead of a recent blockhash, use the nonce account’s blockhash as the transaction’s lifetime.
1

Fetch the Nonce

Fetch the data from the nonce account. Use the blockhash from the nonce account as the transaction’s lifetime.
Example Nonce Account Data
Build Deferred Transaction
2

Create Transfer Instruction

Create the instruction for your payment. This example shows a token transfer.
Build Deferred Transaction
3

Build Transaction with Durable Nonce

Use setTransactionMessageLifetimeUsingDurableNonce which sets the nonce as the blockhash and automatically prepends the advance nonce instruction.
Build Deferred Transaction
4

Sign Transaction

Sign the transaction. It now uses the durable nonce instead of a standard blockhash.
Build Deferred Transaction

​Store or Send Transaction

After signing, encode the transaction for storage. When ready, send it to the network.
1

Encode for Storage

Encode the signed transaction to base64. Store this value in your database.
Store and Execute
2

Send Transaction

Send the signed transaction when ready. The transaction remains valid until the nonce is advanced.
Store and Execute

​Demo

To run this demo, create a project and install its packages. "type": "module" lets the demo use top-level await:
In a second terminal, start a local network on 127.0.0.1:8899 with the Surfpool CLI and leave it running:
Save the demo as demo.ts and run it with npx tsx demo.ts.
Demo

​Invalidate a Pending Transaction

Each nonce account blockhash can only be used once. To invalidate a pending transaction or prepare the nonce account for reuse, advance it manually:
This generates a new nonce value, making any transaction signed with the old value permanently invalid.

​Multi-Party Approval Workflow

When a transaction needs signatures from several people, the first approver can’t use signTransactionMessageWithSigners: it throws while any required signature is missing. In the message, stand in for each approver who signs later with createNoopSigner(address), which marks the account as a required signer without signing. For example, in the transfer instruction above, set authority: createNoopSigner(approverAddress) when a second approver owns the source token account. Then sign what you can with partiallySignTransactionMessageWithSigners and serialize the result for storage:
Each later approver deserializes the stored transaction, adds a signature, and serializes it again for storage or submission:
The transaction can be serialized, stored, and passed between approvers. Once all required signatures are collected, submit to the network.

​Production Considerations

Nonce account management:
  • Create a pool of nonce accounts for parallel transaction preparation
  • Track which nonces are “in use” (have pending signed transactions)
  • Implement nonce recycling after transactions are submitted or abandoned
Security:
  • The nonce authority controls whether transactions can be invalidated. Consider separating nonce authority from transaction signers for additional control and separation of duties
  • Anyone with the serialized transaction bytes can submit it to the network