> For the complete documentation index, see [llms.txt](https://leather.gitbook.io/guides/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://leather.gitbook.io/guides/transactions/nonces.md).

# Nonces

<mark style="color:red;">Warning:</mark> 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.&#x20;

### 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”.

<figure><img src="/files/9OPQp5YPBAnxutTafaJn" alt=""><figcaption><p>Step 1: Click "edit nonce" below the fee options and above the button to continue.</p></figcaption></figure>

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

<figure><img src="/files/v1NH5wf7uGRnauXbhiqG" alt=""><figcaption><p>Step 2: Edit the nonce, and apply</p></figcaption></figure>

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**](https://support.gamma.io/hc/en-us/articles/6908193338131-How-do-nonces-work-)

[**Leather.io Guides - Pending transactions, and why they are pending**](/guides/transactions/pending-transactions.md)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://leather.gitbook.io/guides/transactions/nonces.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
