The field guide · rule 11 of 16
On a blockchain, wait until it is final
The newest blocks can be replaced. Wait for confirmations, count each transaction once, and refuse old requests.
What it means
Blockchains have their own ways of going wrong. The newest blocks can be replaced by others (engineers call this a reorg), so wait for enough confirmations before treating money as received. Make sure each transaction is counted once, and that a signed request cannot be sent again later.
What goes wrong without it
A deposit is credited as soon as it appears. Its block is replaced, the deposit disappears, and the customer has already withdrawn the money.
How I build it
- My chain-intelligence service reads a little behind the newest block, replaces any saved block that the chain rewrites, and credits a payment only after enough confirmations. One transaction can only ever pay one order.
- My mining pool never trusts a miner's claimed result. It rebuilds the work and checks it itself.
- My trading software numbers its exchange requests in rising order, so an old request cannot be replayed.
Ask your team
- How many confirmations do you wait for before you credit a deposit?
- What happens to a credit if its block is replaced?
- Can one transaction ever be counted twice?
How a review checks this
For products that touch a blockchain, the payments check covers confirmations, replaced blocks and double counting.
Request a reviewThe offer: Payments and ledger integrity checkCheck your system in one minute