Why Ethereum Transactions Get Stuck in the First Place
Every pending transaction competes with others for block space. Miners (or validators, after the merge to proof-of-stake) prioritize transactions that offer higher gas fees. If your gas price is below the current market average, your transaction sits in the public waiting room called the mempool. The problem is compounded by the fact that your transaction also locks your nonce—a sequential number that prevents double-spending. While that nonce is occupied, you cannot send another transaction from the same address unless it uses that same nonce.The Role of the Nonce in Cancellation
Your wallet assigns each outgoing transaction a nonce, starting from 0 and increasing by 1. If transaction #5 is stuck, you cannot send a new transaction with nonce #6 because the network processes transactions in nonce order. The only way to move forward is to replace nonce #5 with a new transaction that has the same nonce but a higher gas price. If the replacement gets mined, the original is discarded.
Why "Cancel" Is a Misnomer
You are not telling the network to forget your original request. Instead, you are sending a competing instruction: a 0-value transfer to yourself (or a higher-fee version of the original transfer) that uses the same nonce. The network only includes one transaction per nonce, so whichever gets mined first wins.
Method 1: Cancel via Your Wallet's Built-In Feature
Most modern wallets, including Coinbase Wallet and MetaMask, offer a "speed up" or "cancel" button when a transaction is pending. This is the safest path because the wallet automatically handles the nonce and fee calculations.Step-by-Step for Coinbase Wallet
- Open the app and navigate to the "Activity" or "History" tab.
- Locate the pending transaction and tap on it.
- Look for a "Speed Up" or "Cancel" option. If you see "Cancel," tap it.
- The wallet will offer to send a 0-value transaction to your own address with a higher gas price. Confirm the new fee.
- Wait for the replacement to be mined. Once confirmed, the original transaction will show as "Failed" or "Dropped."
If your wallet does not show a cancel button, you must use the manual method below.
Method 2: Manual Cancellation Using a Custom Nonce
This method is for users comfortable with advanced settings. The goal is to create a new transaction that uses the exact same nonce as the stuck one but with a higher gas fee and no meaningful value.Find Your Stuck Transaction's Nonce
Open a block explorer like Etherscan and search for your wallet address. Look at the "Pending Txns" tab. The nonce is displayed next to each pending transaction. Write it down.
Send the Replacement Transaction
- In your wallet, enable "Advanced" or "Custom" gas settings (often found in the transaction preview screen).
- Set the recipient to your own address.
- Set the amount to 0 ETH.
- Manually input the nonce number you wrote down.
- Set a gas price that is at least 10–20% higher than the current network average. Do not use a fixed number; check a live gas tracker first.
- Send the transaction.
If your wallet does not allow editing the nonce, you cannot use this method—use a wallet that supports it or import your private key into a tool like MyEtherWallet temporarily.
What to Do If the Cancellation Itself Gets Stuck
Sometimes the replacement transaction also sits pending because you set the gas price too low again or because the network spiked. Do not panic. You have two options.Speed Up the Replacement
If your wallet supports "Speed Up," use it on the replacement transaction. This will send another transaction with the same nonce but an even higher gas fee. This is safe because it simply overwrites the previous replacement.
Wait for the Original to Expire
Pending transactions do not live forever. Most nodes drop them after a certain number of blocks (often around 300 blocks, which is roughly an hour, but this varies). If you do nothing, the stuck transaction may eventually be dropped from the mempool, freeing your nonce. However, this is not guaranteed, and some transactions can linger for days.
Prevention: How to Avoid Future Stuck Transactions
The best fix is to never get stuck in the first place. Here is a quick comparison of fee-setting strategies: | Strategy | Risk Level | Best For | | --- | --- | --- | | Wallet's "Suggested" fee | Low | Normal transfers during calm network periods | | Manual low fee | High | Only if you are willing to wait hours | | "Speed Up" immediately after sending | Low | Urgent transfers during congestion | | Setting a custom nonce manually | Medium | Advanced users controlling multiple pending txs |- Always check a live gas tracker before sending, not a fixed fee from memory.
- If you are in a hurry, pay the "fast" fee instead of the "standard" fee.
- For large or time-sensitive transfers, consider using a Layer-2 network like Arbitrum or Optimism, where fees are a fraction of Ethereum's and congestion rarely causes stuck transactions.