<p>You cannot undo a confirmed transaction trivially. That is one of the key benefits of a network like Bitcoin.</p>

<p>If your tx has only 1 confirmation, you might yet be able to drop it by mining two blocks on the parent of the block that contains tx_1. However, this requires you to have enough hashpower to be able to do so before someone extends the chain building on the block containing tx_1, which is non-trivial. Additionally, even if you succeed in this, there is still a chance that someone might mine on the block you dropped and turn that into the longer chain again.</p>

<p>Usually, blocks which have been confirmed 6 times are considered irreversible. Practically, unless you have access to a large amount of hashpower, even 1 confirmation is effectively irreversible on the bitcoin chain (although orphan blocks do occasionally happen)</p>

CC BY-SA 4.0
2018-05-17T14:46:14.390Z
Say I am tracking a specific bitcoin transaction 'TX_1'. A confirmed block had the transaction information after I decoded the block, and I updated my database as :  {transaction: 'TX_1', 'confirmation': 1}
now how do I increment the number of confirmation, assuming I am still listening to the network through ZMQ. Should I expect the same transaction 'TX_1' to be present in upcoming blocks?
merklexy
CC BY-SA 4.0
2018-05-17T15:00:59.260Z
When you receive the next block, check the prevblock hash. If it matches the block with your tx, increment by one. For the n+2 block, check the prevblock hash against the n+1 block, and increment by 1. So on and so forth. As long as new blocks keep building upon a chain including the block with your tx, it keeps adding confirmations
Raghav Sood
CC BY-SA 4.0
2018-05-17T14:11:14.657Z
2018-05-17T14:11:14.657Z
Raghav Sood
<p>Let's say if the transaction <strong>tx_1</strong> has one confirmation. But the <strong>tx_1</strong> is fraudulent. Can it be rolled back? Here I am storing the confirmed blocks and if my transaction is in the block-1 then the confirmation of <strong>tx_1</strong> is 1 and whenever the blocks come after the block-1 the confirmation will keep on incrementing. But after one confirmation, if the tx_1 is fraudulent then how to stop that transaction?</p>

<transactions><confirmations>
How to know whether my transaction is fraudlent after one confirmation?
merklexy
# How to know whether my transaction is fraudlent after one confirmation?

(Asked by: username_0 on 2018-05-17)

Let's say if the transaction **tx\_1** has one confirmation. But the **tx\_1** is fraudulent. Can it be rolled back? Here I am storing the confirmed blocks and if my transaction is in the block-1 then the confirmation of **tx\_1** is 1 and whenever the blocks come after the block-1 the confirmation will keep on incrementing. But after one confirmation, if the tx\_1 is fraudulent then how to stop that transaction?

**Tags:** transactions, confirmations


---

## 1 answers

### Answer by username_1 on 2018-05-17. Score: 2 | Accepted answer

You cannot undo a confirmed transaction trivially. That is one of the key benefits of a network like Bitcoin.

If your tx has only 1 confirmation, you might yet be able to drop it by mining two blocks on the parent of the block that contains tx\_1. However, this requires you to have enough hashpower to be able to do so before someone extends the chain building on the block containing tx\_1, which is non-trivial. Additionally, even if you succeed in this, there is still a chance that someone might mine on the block you dropped and turn that into the longer chain again.

Usually, blocks which have been confirmed 6 times are considered irreversible. Practically, unless you have access to a large amount of hashpower, even 1 confirmation is effectively irreversible on the bitcoin chain (although orphan blocks do occasionally happen)

> **Comments:**
> **username_0**: Say I am tracking a specific bitcoin transaction 'TX_1'. A confirmed block had the transaction information after I decoded the block, and I updated my database as :  {transaction: 'TX_1', 'confirmation': 1} now how do I increment the number of confirmation, assuming I am still listening to the network through ZMQ. Should I expect the same transaction 'TX_1' to be present in upcoming blocks?  
> **username_1**: When you receive the next block, check the prevblock hash. If it matches the block with your tx, increment by one. For the n+2 block, check the prevblock hash against the n+1 block, and increment by 1. So on and so forth. As long as new blocks keep building upon a chain including the block with your tx, it keeps adding confirmations  

---

