Nonces

How do I edit the nonce for a Stacks transaction before sending with the Leather?

Warning: Do not edit the nonce of a transaction unless you know what you are doing

Introduction

Nonces on Stacks are used to dictate the order in which transactions have to be ordered by miners. A transaction with nonce 8 can't be processed (mined) before a transaction with nonce 7 is processed. A pending transaction with nonce 8, without a pending (or confirmed) transaction with nonce 7 can never get processed. In normal circumstances, the wallet is expected to set the correct nonce for you. A nonce can only be used once per address starting with 0.

Editing the nonce

Editing the nonce is only possible before confirming the transaction. To do so follow these steps:

  1. On the confirmation screen, see the lower left corner and click “edit nonce”.

  1. Edit the number to the preferred nonce and apply.

Note that the miners process transactions in order of the nonce. Lowest first. And no gaps are allowed. An address that has not yet sent any transactions will send the first transaction with a nonce value of “0”, then “1”, “2”, etc..

Additional sources

Gamma.io - How do nonces work

Leather.io Guides - Pending transactions, and why they are pending

Last updated