MetaMask Transaction Nonce Explained and How to Fix Stuck Transfers

MetaMask transaction nonce explained

✓ Top answer Community-sourced, written up by
MetaMask Transaction Nonce Explained and How to Fix Stuck Transfers

A MetaMask transaction nonce is a sequential number tied to your wallet address that ensures the blockchain processes your transactions in the order you initiated them and prevents replay attacks. Each transaction gets a unique, incrementing nonce, and if one transaction stalls, everything queued behind it waits too.

The ordering rule is strict: if the transaction with nonce 6 is still pending, all transactions with nonces greater than 6 will not confirm until nonce 6 confirms. Nonces also stop the same transaction from being broadcast multiple times, which protects against double spending. A stuck transaction is often a gas problem, for example a transaction set to 1 gwei when the lowest going rate on Etherscan is much higher.

To cancel a stuck transaction, send 0 ETH to your own address using the exact nonce of the pending transaction, with a gas price set to the high figure on the Etherscan gas tracker. You can find the pending nonce in the transaction details of the earliest stuck transaction on a block explorer. For multiple stuck transactions, back up your seed phrase and reset the account through Settings, then Advanced, then Reset Account.

Fix a stuck transaction

  1. Turn on Customize Transaction Nonce Profile icon, then Settings, then Advanced, then toggle it on. It also appears by default in the transaction screen settings.
  2. Find the stuck nonce on Etherscan Open the details of the earliest stuck transaction and locate the nonce. Click see more if the explorer hides it.
  3. Send 0 ETH to yourself Use your own wallet address as the recipient and set the nonce to exactly match the pending transaction.
  4. Set a high gas price Match the high gas price shown on the Etherscan gas tracker so the replacement confirms first.
  5. Reset the account for multiple stuck transactions Back up your seed phrase, then Settings, Advanced, Reset Account.
MetaMask Transaction Nonce Explained and How to Fix Stuck Transfers — infographic

Nonce Functionality

Sequential Order: Each transaction from your MetaMask wallet is assigned a unique, incrementing nonce. The blockchain processes transactions based on this nonce, ensuring that transactions are confirmed in the order they were initiated. "if transaction with nonce #6 is still pending, ALL transactions with nonces greater than 6 will not confirm until #6 confirms."
Preventing Double-Spending: Nonces prevent the same transaction from being broadcast multiple times, which could lead to double-spending issues. "The lowest gas price as of writing (according to Etherscan) is 47 gwei. The linked transaction has a gas price set to 1 gwei."

Troubleshooting Stuck Transactions

Custom Nonce for Cancellation: If a transaction is stuck, you can cancel it by sending a new transaction to your own address with the exact same nonce as the stuck transaction, but with a higher gas fee. "Send 0 ETH to yourself (your own wallet address), edit the nonce (copy the nonce of the pending transaction, you can find this on etherscan), set your gas price to the high gas price in here: https://etherscan.io/gastracker"
Resetting Account: If you have multiple stuck transactions, resetting your MetaMask account can clear them. "Back-up your seed phrase (if you haven't yet). Get rid of stuck queued transactions by resetting your account. Settings > Advanced > Reset Account"
Viewing Nonce: You can find the nonce of a pending transaction by viewing its details on a blockchain explorer like Etherscan. "Second, go to the blockchain scanner and click transaction details of the EARLIEST stuck transaction and find the nonce (you might need to click "see more" in some scanners)."

Custom Nonce Option in MetaMask

Enabling Custom Nonce: The option to customize the transaction nonce is available in MetaMask's advanced settings. "First, on the profile icon in the top right corner of the MetaMask window, select Settings, click on Advanced, and turn on Customize Transaction Nonce."
Location in UI: This feature is now enabled by default and appears when you attempt to perform a transaction, accessible through the settings option within the transaction interface. "the option hasn't been removed with the last update, now it will appear by default once you try to perform a transaction, to find it what you need to do is click on the right top corner (the settings option you get once you are trying to do the transaction) then you will see the custom nonce option appear 😊"

Do you want to know more about how gas fees interact with transaction nonces?

Bottom line

A MetaMask transaction nonce is a sequential number associated with your wallet address that ensures transactions are processed in the correct order and prevents replay attacks. Nonces are crucial for managing pending transactions and resolving stuck transactions.

Community answers 23

What others in the community said:

62% upvoted

I just got hit for a ton of eth 3 meta wallets drained. Anyone heard anything or could help point me in the right direction of what to do? No idea how they accessed my funds.

100% upvoted

When I try broadcasting a transaction on diffusion.fi (either swapping or harvesting). It seems MetaMask is consistently trying to broadcast on the nonce just below it. Can’t get any tx through due to it.

Don’t have this problem on Disperze, but guessing that might be due to it using signed messaged rather than normal Txs. Already tried removing and readding Evmos from MetaMask. Anyone any suggestion, or running into this problem too?

EDIT: It seems MetaMask has difficulties syncing up the right nonce if you use it shortly after Disperze - just wait a few minutes thereafter and it seems to be working OK again.

100% upvoted

Hello, I was trying to explain to a friend how to use Metamask, in particular I was trying to explain him how to cancel a transaction by sending a new one with the same nonce...

Unfortunately despite having manually changed the nonce Metamask broadcasted the transaction with another one, completely ignoring the custom nonce, two times.

We had to use MyCrypto to be able to send a transaction with a nonce different from the suggested one trough Metamask.

I was aware of this bug months -years- ago but it definitely seems to be still there, can you guys confirm it?

63% upvoted

Below are steps that allow you to overwrite a transaction you sent on the blockchain. The two main reasons you would do this is if you sent a transaction in error and want to try to cancel it before it is completed by the blockchain. The other main reason is if a transaction was not given enough gas and it is preventing you from doing any other transactions on the blockchain.

The first thing you need to do when you have a stuck transaction in MetaMask is to see if it has been sent to the blockchain. Google "whatever network" explorer and then put your wallet address in the search bar (do not close this window, you will need it later). If the transaction shows as pending follow the below

  • First, on the profile icon in the top right corner of the MetaMask window, select Settings, click on Advanced, and turn on Customize Transaction Nonce.

  • Second, go to the blockchain scanner and click transaction details of the EARLIEST stuck transaction and find the nonce (you might need to click "see more" in some scanners).

Polygonscan View (same as Etherscan)

  • Third, create a new transaction where you send yourself 0.00001 of the blockchains crypto (or anything, but this tends to be lowest gas). You need a transaction to overwrite the "stuck one". It can be the same transaction as the stuck one with a higher GWEI.
  • Fourth, in the “custom nonce” field change it to the nonce of the earliest stuck transaction.

  • Fifth, provide a custom gas amount that is more than the one in the stuck transaction and complete the transaction. This will overwrite the original transaction with the new one.

That’s for the post incase we get stuck in a transaction this will help greatly

An informative post on ? Holy hell damn! Great post OP, the first post i ever saved/bookmarked from this subreddit.

Another process that needs to be simplified before mass adoption.

100% upvoted

Has the Customize Transaction Nonce option been removed from Metamask?

I'm using the latest version of MM and noticed it isn't in the Advanced section of the settings anymore.

100% upvoted

I have a transaction pending on my wallet & it won't let me cancel the transaction. When I try to pay a gas fees to cancel the transaction, it says "insufficient funds" even though I have sufficient funds to cancel the transaction.

I have tried to send myself 0 eth with a nonce + 1 the nonce of the earlier pending transaction but that didn't help either. Even that transaction got stuck. Please help

60% upvoted

Hi there so a friend of mine said he lost $66.61 usd worth of wbtc not much which is good. But just wanting clarity on how this happened.

So he just created a fresh meta mask and moved some crypto into it, he deposited wbtc into aave and made a borrow then deposited that borrow back into aave all good.

Then went to sleep next day logged in there was a transaction approval he rejected it then it popped back again he rejected it then popped up again then he approved it with out checking what it was how it got there and then 0.00063103 $66.61 of aEthWBTC got withdrawn from his deposit/supply side in aave.

Most likely gone we dont care about recovery we just want to understand how something could request something without us instigation a transaction.

Heres the transaction hash to look it up on ether scan 0xd30b484978b945d87a92353a7baacd170a95a7c4f6d22aaf9b67592cc1e64f27

I'm also having this issue.

EDIT: I figured it out. So either it doesn't work with the first transaction from a new ethereum address, OR for a custom nonce to work all other transactions before it must be confirmed. e.g. if transaction with nonce #6 is still pending, ALL transactions with nonces greater than 6 will not confirm until #6 confirms.

This feature is really important for apps that intend to send the replacement transaction themselves, perhaps they intend for the replacement to be different than the original transaction such as setting gasPrice or input.

I know you mentioned in a previous thread that letting users edit nonce would case issues. Would this be something at least an app could do? Is there an intention to support this?

MetaMask allows you to edit the nonce for any transaction, but you have to enable this advanced feature in settings.

So. I tried to transfer 0.31 ETH about 8 hours ago. I then went to sleep and woke up and it was still there. I tried to speed it up. I chose the fastest method like (~1min) - but then it still didnt do anything, so I tried to cancel it then I noticed there were 5 other transactions added all for lower amounts. I cant cancel them as its asking for 15$ fee to cancel them all.

The recent thing about cancelling: the progress bar keeps getting to nearly 100% and then dropping back to 50% ish...

What the hell is going on.

"it added" - clearly you are not in the control

SAMEEE WTF mine has been pending for 6 days its just stuck

Hi thank you so much for sharing your question 🙏 just to clarify, the option hasn't been removed with the last update, now it will appear by default once you try to perform a transaction, to find it what you need to do is click on the right top corner (the settings option you get once you are trying to do the transaction) then you will see the custom nonce option appear 😊
Remember that WE WILL NEVER SEND YOU DM TO OFFER SUPPORT REGARDING METAMASK HERE, SO PLEASE BE CAREFUL ⚠️

50% upvoted

36 hours ago:

Yesterday I tried to borrow from AAVE, stupidly lowered GWEI to a low amount (regretting massively now for being so stupid).

Sent the transaction, after 5 hours still showed as “pending” in metamask wallet. On etherscan there is ONLY the txn hash showing and Status as “pending” and “This txn hash was found in our secondary node and should be picked up by our indexer in a short while”. I decided to wait thinking it may go through eventually.

12 hours ago:

Waited 24 hours, today still the same, no change, still pending in metamask, and because of this i cant move my other assets in the wallet.

Tried to cancel in metamask for a few times, increasing gwei manually in the cancel option.

Then…

On etherscan, when searching for the Original txn hash the page now show “Sorry we are unable to locate this Txnhash” (i saved down the etherscan link when the original transaction didnt go through yesterday).

In Metamask the transaction still shows as pending, when I clicked on “view on etherscan” a different txn hash appeared but again, the status shows as “pending” and “This txn hash was found in our secondary node and should be picked up by our indexer in a short while”.

The “From” and “To” both shows as my own wallet address, the “Value” field showing as 0 ETH

I believe this should be the cancelling ticket but it has been stuck like this for 12 hours.

Has anyone experienced the same situation before? Dont care about this transaction so much, but I need to get rid of it so I can transact my other assets in my wallet.

Please help if you can, really appreciate this 🙏

The lowest gas price as of writing (according to Etherscan) is 47 gwei. The linked transaction has a gas price set to 1 gwei.
- Resetting Account: If you have multiple stuck transactions, resetting your MetaMask account can clear them.
- Viewing Nonce: You can find the nonce of a pending transaction by viewing its details on a blockchain explorer like Etherscan.
### Custom Nonce Option in MetaMask
- Enabling Custom Nonce: The option to customize the transaction nonce is available in MetaMask's advanced settings.
- Location in UI: This feature is now enabled by default and appears when you attempt to perform a transaction, accessible through the settings option within the transaction interface.

Related questions

What is a nonce in MetaMask?
It is a sequential number attached to your wallet address that increments with each transaction. It forces the blockchain to confirm your transactions in order and prevents replay attacks and double spending.
Why is my MetaMask transaction stuck pending?
A transaction stalls when an earlier nonce has not confirmed yet. If the transaction with nonce 6 is still pending, every transaction with a nonce above 6 will not confirm until it does. Low gas price is a common cause, such as setting 1 gwei when the lowest rate on Etherscan is far higher.
How do I cancel a stuck MetaMask transaction?
Send 0 ETH to your own wallet address, set the nonce to match the pending transaction exactly, and set the gas price to the high value listed on the Etherscan gas tracker. The replacement transaction takes the same slot and pushes the stuck one out.
How do I enable the custom nonce option in MetaMask?
Click the profile icon in the top right corner, go to Settings, open Advanced, and turn on Customize Transaction Nonce. With recent updates the option also appears by default: open the settings in the top right corner of the transaction screen and the custom nonce field shows up.
Where do I find the nonce of a pending transaction?
Go to a block explorer such as Etherscan, open the transaction details of the earliest stuck transaction, and look for the nonce. On some explorers you may need to click see more to reveal it.
How do I reset my MetaMask account to clear stuck transactions?
Back up your seed phrase first if you have not already. Then go to Settings, Advanced, and Reset Account, which clears the queued stuck transactions.

Replies (0)

No replies yet. Be the first to reply.