Ethereum Transaction: How To Modify Or Cancel It

If you've used the Ethereum network before, you've likely experienced a transaction that takes longer than usual to confirm. This happens because of the way the miners prioritize transactions – users who offer higher fees get priority. Fixing it might sound complicated, but it's easier than you might think. And it works with ether (ETH) and all ERC20 tokens.


Firstly, keep in mind that a transaction that has already been confirmed cannot be replaced, reverted, or canceled. There may be times when network congestion makes cryptocurrency transactions ineffective. In cases of high transaction volume, you may have to wait hours or days for your transaction to complete.

Occasionally, the blockages will disappear by themselves if the gas fee decreased or if the pending transaction failed. The process of modifying or canceling an Ethereum transaction cannot be sped up simply by stopping it. However, there are a few steps that can be taken to accelerate the process. In fact, it consists of replacing a pending transaction with a new one that pays higher fees.

With this guide, we will show you how to use modify or cancel your Ethereum transaction with easy methods. It is not as complicated as it might seem! 

Let’s dive right in.

What is Ethereum?

A blockchain-based software platform, Ethereum powers thousands of decentralized applications (DApps) as well as its native cryptocurrency, Ether (ETH). the latter can be sent and received globally without third parties influencing the process.

Ethereum was first proposed by Russian-Canadian programmer Vitalik Buterin in 2013 as a platform for self-executing, permanent, and immutable decentralized applications, with diverse use cases ranging from finance to gaming and art.

As Ethereum smart contracts, Dapps are often referred to as smart contracts as they are Ethereum protocols that automatically execute predefined conditions and agreements, such as transaction processing. A smart contract enables the sending, canceling, and resolving of Ethereum transactions within its scope.

What is an Ethereum transaction?

A transaction is a cryptographically signed instruction from an account.

In Ethereum, there are two types of transactions: 

  • Contract deployment transactions, which are transactions without a receiver, 
  • Regular transactions, which are the easiest way to move ETH from one wallet to another.

An Ethereum transaction sent by a regular user includes the sending party's identifier or a signature generated when the sender's private key signs the transaction and confirms whether the sending party authorized that Ethereum transaction. Senders and recipients are asked to supply a receiving address and amount of Ethereum, information about transaction fees, and an optional field for including arbitrary data as part of a regular Ethereum transaction.

In order for an Ethereum transaction to become valid, it must be mined and the sender must pay a fee.

Miners create new Ethereum by verifying legitimate transactions. They are rewarded for this work by receiving a reward. By solving a cryptographic (mathematical) puzzle, a miner validates a transaction. The proof-of-work system (PoW) of Ethereum is similar to Bitcoin's ( BTC) in that it prevents cyberattacks from a single person or group.

A transaction fee is required for users to use Ethereum's blockchain. The fee protects the Ethereum network from sloppy or malicious computation tasks such as users spamming the blockchain with many unrelated transactions.

Ethereum transaction lifecycle

Ethereum transactions progress from the unknown state to the confirmed block after going through a series of stages.

  • Unknown. A transaction that has not been seen or processed by the network falls into an unknown state.
  • Pending. When a transaction is in the pending stage, it is being awaited by the miners for them to complete the transaction. This is called a pooled transaction, which is also known as the "mempool." Because miners prioritize greater gas prices, transactions with lower gas values may languish in the pending stage for long periods of time. It is possible that the transactions with the cheapest gas will never be picked up, remaining in the pending status forever.
  • In block. Once a miner has successfully mined a transaction within a block, he is considered to be in the in-block state. Known as mined transactions, in-block transactions occur within the block. The pending state of a transaction in a block might be reinstated if the block is forked. Mined transactions (transactions in the block state) are known as forked transactions once they are reversed by the network.
  • Replaced. Transactions can be moved from pending to replaced when either of the following circumstances is met:
  1. As soon as the same nonce is used again from the same sender, the transaction enters block state, or
  2. We see that another transaction from the same sender will enter the pending stage with the same nonce, but with a higher gas price.

Ethereum Transaction confirmations

The number of confirmations of an Ethereum transaction is the number of blocks created since the first block to contain it.

Ethereum transactions need to be confirmed at least once before they can be considered complete. Typically, the higher the gas fee, the more certain the Ethereum network is of processing and recognizing the transaction.

There can be reorganizations of recent blocks, creating the impression that the transaction is going bad. In reality, it may appear to be wrong, but be included in another block and remain valid. As new blocks are mined, the better the immutability of the transaction becomes, that is, the less likely there is to be a reorganization.

The Confirmations

The transaction fee is a payment made by miners to block them. Ethereum transactions are sent via the blockchain by paying the transaction fee.

As blockchain transaction fees are related to gas, a pricing mechanism used on Ethereum's network that reflects the computation required to process each transaction, the fees are also referred to as gas fees. A transaction's computational costs are calculated as a percentage of gas cost.

In contrast, each unit of gas is accompanied by an ETH price. Users can set their own gas limit, which is the maximum amount of gas units they will consume for a transaction, and the price of gas, which depends on the complexity of the transaction.

What is an Ethereum nonce?

Ethereum nonces refer to all validated transactions sent from an Ethereum address and are abbreviations for "number used once only."

A nonce calculation is considered a necessary mechanism for determining the order in which transactions are processed in Ethereum wallets that broadcast multiple transactions simultaneously. The Ethereum wallet applications usually handle nonce management on behalf of users.

How to cancel an Ethereum transaction?

Ethereum transactions can be canceled in two ways: in-application cancellation and setting a custom nonce. When users submit Ethereum transactions with a low gas price, they usually linger pending for hours. For this reason, users will need to change the Ethereum transactions.

For users to resolve this issue, they must keep in mind that canceling a transaction is only possible while it's still in the network queue. Their first step should be to verify whether the transaction has been completed using a block explorer. It is mainly necessary to paste the transaction hash, also known as an Ethereum transaction ID, and if a block explorer shows "pending," users can still opt to cancel the transaction.

In-application cancellation is the most convenient method to cancel a stuck Ethereum transaction. This method requires users to exit their Ethereum wallet and close their browser, then re-open their browser and log back into Ethereum wallet again.

However, if these steps fail to solve the problem, the second option could save the day.

If you wish to cancel a pending Ethereum transaction using a custom nonce, you need to generate a 0 ETH transaction to your own address at a high gas price so that a previous transaction does not get stuck. The user must record the nonce used by the original pending transaction before sending the second transaction. Users should then reuse the nonce noted by the original pending transaction.

The oldest Ethereum transaction or the one with the lowest nonce value should be the first one users try to execute if they have multiple pending Ethereum transactions.

How to speed up an Ethereum transaction?

In Ethereum, gas can be added to slow transactions to speed them up. Adding gas to slow transactions may lead Ethereum miners to prioritize them.

Users who set the gas price too low may be outbid and the transaction will remain pending if other users outbid the user's price. In a stuck transaction, the network will not confirm any new transactions from the same wallet address until the first transaction has been confirmed.

Users can choose between waiting for the network to accept the set price for the original request or resubmitting the request with a higher gas fee. In their Ethreum wallet, click on the "speed up" button to make the transaction proceed more quickly. In the event that the previous step does not work, users can select the Advanced tab to manually set the gas price.

The blockchain explorer can check the transaction by posting its hash so users can determine whether the transaction was successful. You will need to refresh the page after a few minutes if the transaction does not appear immediately.

Can Ethereum transactions be reversed?

It is not possible to revert already executed Ethereum transactions in Ethereum wallets.

When Ethereum users set up a transaction that accidentally sends funds to the wrong address or sends too much ETH, they can cancel it while it is still pending. In the case of a successful transaction that has been added to the next block, which means it has been confirmed, it cannot be reversed. Due to the immutability of the Ethereum blockchain, data entered into blocks cannot be reversed. Before clicking the send button, it is crucial to ensure that the transaction details are accurate.

Last but not least, it is worthwhile noting that many blockchain startups have already developed mechanisms that can be used to reverse Ethereum transactions.

Closing Thoughts

It can be very frustrating to submit an Ethereum transaction only to find that the gas price is higher than yours. As if this wasn't bad enough, your Ethereum wallet is unable to be used until the pending transaction has been confirmed or failed.

The network fees can sometimes drop enough to automatically clear stuck transactions. However, it can take some time for this to happen. A stuck transaction can be canceled by performing a simple zero token transfer before the transaction gets stuck. You will have to pay sufficient gas fees in order to cancel the transaction successfully.