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 withspace: 80.
Request
Base58-encoded public key (string)
required
The account to initialize as a nonce account. Must already exist.
Base58-encoded public key (string)
required
The authority that can authorize future nonce operations.
Response
SolanaInstruction (object)
The initialize_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.
Code Examples
AuthorizeNonceAccount
Changes the authority of a nonce account. The current authority must sign the transaction.Request
Base58-encoded public key (string)
required
The nonce account to update.
Base58-encoded public key (string)
required
The current authority. Must be a signer.
Base58-encoded public key (string)
required
The new authority.
Response
SolanaInstruction (object)
The authorize_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.
Code Examples
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
Base58-encoded public key (string)
required
The nonce account to withdraw from.
Base58-encoded public key (string)
required
The nonce account’s authority. Must be a signer.
Base58-encoded public key (string)
required
Destination account for the withdrawn lamports.
uint64
required
Amount to withdraw, in lamports.
Response
SolanaInstruction (object)
The withdraw_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.
Code Examples
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
Base58-encoded public key (string)
required
The nonce account to advance.
Base58-encoded public key (string)
required
The nonce account’s authority. Must be a signer.
Response
SolanaInstruction (object)
The advance_nonce_account instruction. Add this as the first instruction in your nonce-backed transaction.
Code Examples
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
Base58-encoded public key (string)
required
The legacy nonce account to upgrade.
Response
SolanaInstruction (object)
The upgrade_nonce_account instruction. Add this to a transaction and submit it via the Transaction Service.