What is Nonce?

Nonce is an integer value associated with each transaction on the Ethereum network, used to ensure the uniqueness of transactions and their correct sequencing. For every Ethereum address, when a transaction is sent from that address, its corresponding nonce value is incremented by 1. This ensures that transactions are executed in the correct order and prevents duplicate processing or conflicting transactions.

When an address has never sent a transaction, its nonce value is 0. After initiating the first transaction, the nonce value becomes 1, and it increments with each subsequent transaction. Other addresses sending transactions to that address do not affect its nonce value. Miners pack transfer transactions in ascending order of the nonce value. Therefore, if a transaction with nonce 1 has not been confirmed yet, transactions with nonce 2 and higher will not be packed, even if they offer a higher miner fee.

Correctly setting the nonce is crucial to avoid transaction rejections or other issues. If two transactions have the same nonce, one of them will succeed while the other will be considered invalid since the nonce value is seen as duplicated. (Transactions with the same nonce will only pack the one with the higher gas price.)

Last updated