Skip to main content
Regular Solana transactions expire after roughly 150 slots (~60 seconds) because they include a recent blockhash. Nonce accounts store a durable blockhash that doesn’t expire, allowing a transaction to be signed offline, stored, and submitted later. This is essential for multi-sig workflows, hardware signing flows, and scheduled transactions where the time between signing and submission exceeds the normal expiration window.
All nonce operation methods return SolanaInstruction objects. Add them to a transaction and use the Transaction Service to execute on-chain. See Instructions & Transactions.

InitializeNonceAccount

Initializes a nonce account, storing a durable blockhash. The nonce account must already exist with enough lamports for rent exemption and allocated space. Create it first using the System Program Create method with space: 80.

Request

nonce_account
Base58-encoded public key (string)
required
The account to initialize as a nonce account. Must already exist.
authority
Base58-encoded public key (string)
required
The authority that can authorize future nonce operations.

Response

instruction
SolanaInstruction (object)
The initialize_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.

Code Examples

resp, err := client.InitializeNonceAccount(ctx, &system_v1.InitializeNonceAccountRequest{
    NonceAccount: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",
    Authority:    "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV",
})
if err != nil {
    log.Fatal(err)
}
// Add instruction to your transaction
instruction := resp.Instruction

AuthorizeNonceAccount

Changes the authority of a nonce account. The current authority must sign the transaction.

Request

nonce_account
Base58-encoded public key (string)
required
The nonce account to update.
current_authority
Base58-encoded public key (string)
required
The current authority. Must be a signer.
new_authority
Base58-encoded public key (string)
required
The new authority.

Response

instruction
SolanaInstruction (object)
The authorize_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.

Code Examples

resp, err := client.AuthorizeNonceAccount(ctx, &system_v1.AuthorizeNonceAccountRequest{
    NonceAccount:     "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",
    CurrentAuthority: "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV",
    NewAuthority:     "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
})
if err != nil {
    log.Fatal(err)
}
// Add instruction to your transaction
instruction := resp.Instruction

WithdrawNonceAccount

Withdraws lamports from a nonce account back to a destination. If the withdrawal leaves the account below the rent-exempt balance, the account is closed.

Request

nonce_account
Base58-encoded public key (string)
required
The nonce account to withdraw from.
authority
Base58-encoded public key (string)
required
The nonce account’s authority. Must be a signer.
to
Base58-encoded public key (string)
required
Destination account for the withdrawn lamports.
lamports
uint64
required
Amount to withdraw, in lamports.

Response

instruction
SolanaInstruction (object)
The withdraw_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.

Code Examples

resp, err := client.WithdrawNonceAccount(ctx, &system_v1.WithdrawNonceAccountRequest{
    NonceAccount: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",
    Authority:    "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV",
    To:           "9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin",
    Lamports:     1000000000,
})
if err != nil {
    log.Fatal(err)
}
// Add instruction to your transaction
instruction := resp.Instruction

AdvanceNonceAccount

Advances the nonce account to use the next blockhash. Include this as the first instruction in any transaction that uses a nonce account — it invalidates the current nonce value to prevent replay attacks.

Request

nonce_account
Base58-encoded public key (string)
required
The nonce account to advance.
authority
Base58-encoded public key (string)
required
The nonce account’s authority. Must be a signer.

Response

instruction
SolanaInstruction (object)
The advance_nonce_account instruction. Add this as the first instruction in your nonce-backed transaction.

Code Examples

resp, err := client.AdvanceNonceAccount(ctx, &system_v1.AdvanceNonceAccountRequest{
    NonceAccount: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",
    Authority:    "7EcDhSYGxXyscszYEp35KHN8vvw3svAuLKTzXwCFLtV",
})
if err != nil {
    log.Fatal(err)
}
// Add instruction to your transaction (must be first)
instruction := resp.Instruction

UpgradeNonceAccount

Upgrades a legacy nonce account to the current nonce account format. Only relevant for nonce accounts created before the nonce format upgrade on mainnet.

Request

nonce_account
Base58-encoded public key (string)
required
The legacy nonce account to upgrade.

Response

instruction
SolanaInstruction (object)
The upgrade_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.

Code Examples

resp, err := client.UpgradeNonceAccount(ctx, &system_v1.UpgradeNonceAccountRequest{
    NonceAccount: "5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpKuc147dw2N9d",
})
if err != nil {
    log.Fatal(err)
}
// Add instruction to your transaction
instruction := resp.Instruction