basiliskawakens.xyz

How to fix a stuck pending transaction using nonce replacement

A pending transaction that never confirms is not stuck in any meaningful sense. It is queued. Ethereum processes transactions in strict nonce order. If you send data/reverted-transaction-reason-string/">transaction nonce 5 with a low gas price, and it does not get mined, then nonce 6, nonce 7, and every subsequent transaction from that wallet cannot proceed until nonce 5 is included. The network sees them all, but miners will not touch nonce 6 until nonce 5 is confirmed. This is not a bug. It is how the protocol works.

The nonce is a sequential counter attached to every address. Each new transaction must carry the next number in the sequence. A wallet's first transaction is nonce 0. The second is nonce 1. If you broadcast nonce 5 at 10 gwei and the market moves to 50 gwei, nonce 5 sits in the mempool indefinitely. Your wallet now refuses to send nonce 6, because the previous one is still pending. You have two ways out: replace the stuck transaction with a higher gas price, or cancel it.

MetaMask provides two buttons for this. Open the activity tab. Find the pending transaction. Click it. Two options appear: speed up and cancel.

Speed up resends the same transaction with a higher gas price. The nonce stays the same. MetaMask estimates a competitive price. You can adjust it manually. Once broadcast, miners see two transactions at the same nonce. They pick the one with the higher gas price. The original is ignored.

Cancel sends a replacement transaction with a value of zero ETH, to yourself, with the same nonce. It also uses a higher gas price. This effectively overwrites the original. The pending transaction vanishes. You can then send the next nonce normally.

These buttons fail sometimes. MetaMask may not show them for certain states, or the broadcast may not propagate. Then you need the manual method.

You need to know the stuck nonce. Go to Etherscan, enter your wallet address, and find the pending transaction. Its nonce is visible in the transaction details. Write it down.

Back in MetaMask, open settings. Go to advanced. Enable custom nonce. Now send a new transaction. Enter zero ETH. Send it to your own address. In the gas settings, choose a price that is meaningfully higher than the original - 20% to 50% more is typical. Then set the nonce field to the exact number you recorded. Confirm the transaction.

If you want to speed up rather than cancel, do the same thing but send the original recipient the same amount. That is the manual speed up.

Check Etherscan after a few minutes. The stuck transaction should show as replaced or canceled. The new one will appear with a different hash but the same nonce. Once it confirms, the block is cleared. Your wallet will accept the next nonce.

What if MetaMask does not let you set the nonce despite enabling the option? Some wallets, including MetaMask, block nonce editing for certain hardware wallets or for accounts imported via private key. The workaround is to use a different wallet interface. MyCrypto, MyEtherWallet, and Frame all allow custom nonce broadcasts. Import your MetaMask seed phrase or private key into one of them, set the nonce manually, and broadcast.

Be careful with import. Use a clean machine or a burner browser session. Move your funds to a fresh wallet afterward if you do not normally use that software.

There is a trap worth noting. If the stuck transaction involves an ERC-20 token, canceling it does not cancel the underlying approve or transfer. The token transaction remains in the mempool. If someone else picks it up later with a higher gas price, it could still execute. The safer approach is to replace it with a transaction that sends the token to yourself, not to cancel with zero ETH. The same nonce logic applies. But you must know the exact token contract and the recipient address. This is where viewing the original transaction input data, covered elsewhere on this site, becomes useful.

Etherscan shows your pending transaction in a separate tab on your address page. You can sort by nonce. This view confirms which nonce is blocking the queue. Once the replacement mines, refresh the page. The pending transaction should disappear. Your wallet can now proceed normally.

Keep your gas price reasonable from the start. Check current network conditions before sending. That prevents most nonce problems. But if one slips through, nonce replacement is a clean fix. It does not require contacting support, waiting for a node, or losing funds.

Not financial advice. basiliskawakens.xyz publishes market data and general information about digital assets. Crypto assets are volatile and you can lose everything you put in. Nothing here is a recommendation to buy, sell or hold, and we make no price predictions.

Prices are sourced from third parties and may be delayed or wrong. Verify anything you intend to act on against a primary source.

Back to on-chain data