To begin with, let us understand what does Nonce means – Nonce is the position in the sequence of transactions that is being executed by your wallet.
You might come across the issue of Nonce if you have multiple transactions pending (say, for example, your first transaction is still pending maybe because the gas fees were too low, then you try for a second transaction and now this is waiting too so that the first transaction is cleared).
If there are multiple transactions in sequence, Ethereum will always try to clear the transactions that were initiated first, before moving on to the next transaction.
This is done to ensure there are no malicious attacks on the network by initiating transactions in bulk.
The ‘Nonce Too Low’ Issue is quite common while using MetaMask, here’s what it means and how to solve it.
What Does It Mean By Nonce Too Low?
Nonce Too Low error occurs because of the nonce that is being used by the Metamask wallet at the time of transaction creation.
Nonce Too Low means that the used nonce is incorrect, and the Ethereum node in the network that is being communicated by your Metamask wallet indicates that there is a more recent transaction that is pending (that has a higher nonce).
Some potential ways to solve it:
- Increase your nonce
- Wait for sometime and then try again
How To Increase Your Nonce?
The Nonce value is usually hidden and needs to be set/adjusted manually. Here’s how to do it on Metamask:
Step 1: Log in to your Metamask Account
Step 2: Click on ‘Settings’. On the top right corner of your account, click on your profile photo and choose ‘Settings’ from the drop-down menu.
Step 3: Click on ‘Advanced’. You will find a menu of options to the left, in the Settings tab. Choose ‘Advanced’ in that.
Step 4: Toggle ‘Customise Nonce’. You will find this option by scrolling down a bit. By default, the toggle is off.
Step 5: Now when you initiate an Ethereum transaction with your MetaMask Wallet, at the time of the transaction, you can also find the option to set your nonce. You can fill this out accordingly.
What Does Nonce Mean On MetaMask?
It is one of the most important and less understood concepts of the Ethereum blockchain. The Ethereum Yellow Paper defines it as the number of transactions (absolute number) sent from a particular Ethereum wallet address.
This nonce is not stored in any way on the blockchain but is just the value of the total transactions coming from a wallet.
To understand the importance of nonce, first, know that Ethereum is essentially a network of nodes that is decentralized.
When you initiate a transaction with Metamask for example, it is sent to a temporary pool and stays there till the mining is done and is added to the respective block.
Suppose you send two back-to-back transactions from your Metamask wallet, without the Nonce number, the miner would not know which transaction was initiated first.
On the other hand, with Nonce, your first transaction would be Nonce 0, and the second would be Nonce 1 (assuming you never had any transactions initiated before this).
The miner would now know the order and would process the Nonce 0 transaction first, before moving onto the Nonce 1 transaction.
As mentioned above, you can manually set the Nonce too, in other words, the order in the sequence of transactions to be executed.
What Does A Nonce Of 0 Mean?
Every transaction on the Ethereum blockchain will have a Nonce value associated with it corresponding to the wallet the transaction is created from.
A Nonce of ‘0’ means it is the first transaction to be executed from a particular wallet. Nonce values increment in the order of ‘1’ with every sequential transaction.
What Does Nonce Too Low Mean In Metamask?
Consider a scenario where you already have transactions pending on Metamask with Nonce 0 and Nonce 1, and for some reason, they have not been executed yet.
While you initiate the third transaction, if you custom set the Nonce as ‘1’, you will come across this error – signifying that there is already a transaction pending with that Nonce number so you have to choose a higher nonce number to fix this error. In this case, you need to set Nonce ‘2’ or above.
Why Does “nonce Too Low” Error Occur In MetaMask?
The error occurs where there’s already a more recent transaction with the Nonce value that is being used.
Nonce’s too low error is to maintain the ‘Nonce’ stack on MetaMask which is in turn important to understand the order of transactions to be mined by the Ethereum miners, and also to prevent the flood of malicious attacks.
How To Fix The “nonce Too Low” Error In MetaMask?
Fixing this error is a piece of cake! Consider two cases
- First, if the transaction is being initiated from a Web3 wallet such as MetaMask
- Second, if the transaction is not coming from any Web3 Wallet.
In the MetaMask, Go to Settings > Advanced > Reset Account. This will reset the Nonce count associated with your wallet to 0 by clearing all previous transaction history stored in the cache of your browser. The next transaction that you initiate will be Nonce 0 and will be executed first.
In other cases – it is recommended to wait for a few minutes for the server to clear its own transaction load and try again.
Also Read: How To Add Solana To MetaMask Wallet?
This is all about the Nonce concept on the Ethereum Blockchain and simple ways to fix a commonly occurring error.
Read more about Nonce and its technical guides better to understand the concept from a programming perspective, if you need to. Enjoy your transactions on MetaMask now that you know how to fix this error!