Sub topic 7
Why a confirmed transaction cannot be reversed
This chapter assumes you know what a blockchain is and have sent crypto from a wallet or exchange. It also assumes you can read hexadecimal strings. You should already know that an address is derived from a key pair, and that each network keeps its own ledger. Here you will learn why a transaction, once confirmed, cannot be undone, and what is still possible before and after that point.
What a transaction commits to
A transaction is a message that you sign with your private key. The signature proves you authorized exactly this message and nothing else. On an EVM network such as Ethereum, the signed message contains:
- the recipient address
- the amount of the native coin
- optional data, which is how token transfers and contract calls are encoded
- a nonce, a counter of how many transactions your address has already sent
- fee settings
- a chain ID, which names the network the transaction is meant for
Nodes check the signature, the nonce, and whether your balance covers the amount plus fees. They do not check whether the recipient is the one you intended. The recipient field is only a value you signed. If you pasted the wrong address, or chose a network where the recipient does not control the matching key, the transaction is still valid. Every rule the network enforces is satisfied.
Why nobody can reverse it
Three properties combine to make a confirmed transaction final.
- Blocks are chained by hashes. Each block contains the hash of the previous block. Changing an old transaction changes its block's hash, which breaks every later block. To rewrite history, an attacker must rebuild all the blocks after the change and persuade the network to accept the new version.
- Rewriting is expensive. On proof-of-work chains such as Bitcoin, the attacker needs more computing power than the rest of the network combined. On proof-of-stake chains such as Ethereum, finalized blocks can only be reverted by destroying a large amount of staked value, at least one third of all stake.
- There is no administrator. No company, support desk, or admin key can edit the ledger. Thousands of independent nodes run the same rules. A node that accepted an edited history would disagree with all the others and be ignored.
A bank can reverse a payment because one organization controls the ledger and the rules allow disputes. A public blockchain has no such party. A "reversal" would need a new transaction signed by the current holder of the funds. For a wrong-network send, that holder is whoever controls the private key behind the receiving address, and that may be nobody you can contact.
The stages of a transaction
Finality is not a single moment. It builds up as more blocks are added on top of the one containing your transaction.
The table shows what you can still do at each stage.
| Stage | What it means | Can you undo it? |
|---|---|---|
| Signed, not broadcast | The signed data exists only on your device | Yes. Discard it. |
| Pending | Nodes hold it in a waiting pool (the mempool) | Sometimes. Replace it or cancel it, as described below. |
| Included, 1 confirmation | One block contains it | Almost never. A short reorg is possible but unusual. |
| Several confirmations | More blocks sit on top | No, in practice. |
| Finalized | The protocol treats the block as permanent | No. |
Pending transactions can sometimes be replaced
On account-based chains such as Ethereum, each transaction has a nonce, and only one transaction per nonce can ever be included. If your transaction is stuck pending, you can broadcast a new one with the same nonce and a higher fee. Many wallets offer this as "speed up" or "cancel". A common cancel is a zero-value transfer to yourself with the same nonce.
This is a race, not a guarantee. Block producers choose which transaction to include, and if the original is included first, the cancel fails and the original stands. It also only helps if the original transaction is still pending. A transaction that confirms within seconds leaves no time to replace it.
On Bitcoin, the equivalent is replace-by-fee (RBF). It works only on transactions that signal replaceability, and again only until a block includes them.
Reorganizations and why confirmations are counted
Two block producers can create valid blocks at nearly the same moment. The network briefly has two competing tips, then settles on one. The transactions in the losing block go back to pending, and the same transaction usually gets included in a later block. This is a reorganization, or reorg.
Short reorgs of one or two blocks do happen. Deep reorgs are extremely rare on large networks. Confirmations are the number of blocks stacked on top of your transaction, counting the block that contains it. Each one makes a reorg exponentially harder.
Typical conventions differ by network:
- Bitcoin: many services wait for 3 to 6 confirmations. Finality is probabilistic and never reaches absolute certainty.
- Ethereum: blocks are finalized after about two epochs, roughly 13 minutes. Wallets and exchanges can ask the node for the
finalizedblock. - Solana: nodes report commitment levels called
processed,confirmedandfinalized. Exchanges generally credit deposits atfinalized. - Smaller or newer chains: chains with less hash power or stake are cheaper to attack. Ethereum Classic suffered deep reorgs in 2020, and some exchanges required hundreds of confirmations afterward.
Checking confirmations yourself
This script asks an EVM node whether a transaction succeeded and how many confirmations it has. It uses only the Python standard library. Set RPC_URL to your node or provider endpoint and pass the transaction hash as an argument.
import json
import os
import sys
import urllib.request
def rpc(url: str, method: str, params: list):
body = json.dumps(
{"jsonrpc": "2.0", "method": method, "params": params, "id": 1}
).encode()
req = urllib.request.Request(
url, data=body, headers={"Content-Type": "application/json"}
)
with urllib.request.urlopen(req, timeout=15) as response:
data = json.load(response)
if "error" in data:
raise RuntimeError(data["error"])
return data["result"]
def describe(url: str, tx_hash: str) -> str:
receipt = rpc(url, "eth_getTransactionReceipt", [tx_hash])
if receipt is None:
return "No receipt yet: the transaction is pending or unknown to this node."
included_in = int(receipt["blockNumber"], 16)
head = int(rpc(url, "eth_blockNumber", []), 16)
succeeded = int(receipt["status"], 16) == 1
confirmations = head - included_in + 1
finalized = rpc(url, "eth_getBlockByNumber", ["finalized", False])
is_final = finalized is not None and included_in <= int(finalized["number"], 16)
return (
f"status={'success' if succeeded else 'reverted'} "
f"confirmations={confirmations} finalized={is_final}"
)
if __name__ == "__main__":
print(describe(os.environ["RPC_URL"], sys.argv[1]))Run it as RPC_URL=https://YOUR-RPC-ENDPOINT python check_tx.py 0xYOUR_TX_HASH. Two details matter for this chapter:
- The
statusfield reports whether the transaction's execution succeeded. A status ofrevertedmeans the contract call failed and your funds did not move, though you still paid the fee. Asuccessstatus means the network did exactly what you signed, even if what you signed was a mistake. - The
finalizedtag is an Ethereum feature. Other EVM networks may not support it, and the script then reportsfinalized=Falseor raises an error from the node. For those networks, read the network's documentation for its finality rule.
What "irreversible" does not mean
The word is often stretched too far, so keep these limits in mind.
- Funds are not destroyed. After a wrong-network send, the funds usually still exist on some ledger. They may be unreachable to you, but they are not erased. Later chapters cover when someone can retrieve them.
- A voluntary return is possible. If the recipient controls the destination address and agrees, they can send the funds back with a new transaction. This is a new payment, not a reversal.
- Smart contracts can add their own rules. Some contracts, such as escrow, time-locks, and some stablecoin contracts, can pause, freeze, or reclaim balances. Those are features of the contract, not of the base ledger. Do not assume your token has them.
- Social intervention is a rare exception. In 2016, the Ethereum community voted to fork the chain to return funds stolen in the DAO attack. That required near-unanimous community support for a very large theft. An individual's mistaken transfer will never qualify.
- Failed transactions are not reversals. If a transaction never confirms because the fee was too low or the nonce was wrong, nothing moved. That is different from undoing a confirmed one.
How this connects to wrong-network sends
When you send on the wrong network, every step above still works as intended. Your wallet signs a valid transaction, nodes on the selected network accept it, and a block includes it. The recipient address may be one that nobody controls on that network, or one that an exchange does not monitor. The network has no way to ask whether you meant a different one.
This is why the rest of the tutorial focuses on prevention and on realistic recovery paths. Once a transaction is confirmed, the protocol cannot help you. Only the party controlling the destination can.
Summary of key points
- A signed transaction is valid if the signature, nonce, balance, and chain ID check out. The protocol does not verify your intent.
- Hash-linked blocks, the cost of rewriting them, and the lack of any administrator make confirmed transactions final.
- Finality grows with confirmations. Conventions differ by network, and smaller networks need more caution.
- Before inclusion, you may replace or cancel a pending transaction by reusing its nonce with a higher fee. This is a race and is not guaranteed.
- After inclusion, only a new transaction from the current holder of the funds can move them.
Exercise
You send tokens and your wallet shows the transaction as pending for two minutes because the fee was low. You realize you chose the wrong network. Which action has a chance of working, and why is it not guaranteed?
Show answer
Broadcast a replacement with the same nonce and a higher fee, for example a zero-value transfer to your own address. It is not guaranteed because block producers pick which transaction to include. If the original is included first, it confirms and the replacement is dropped, because only one transaction per nonce can be included.
Exercise
A transaction receipt shows status "success" and 40 confirmations on a major network. A colleague says that "success" means the funds reached the person you intended. Explain what is wrong with that claim.
Show answer
Success only means the transaction executed as signed. The network never checks who you intended to pay. If the address or network was wrong, the transfer still succeeds, and with 40 confirmations on a major network it is effectively final.
Exercise
Why do some exchanges require many more confirmations on small chains than on Bitcoin or Ethereum?
Show answer
A chain with little hash power or stake is cheaper to attack, so an attacker can more plausibly rewrite recent blocks. More confirmations make such a deep reorg harder to pull off. Ethereum Classic's 2020 reorgs are an example.