<p>A tx will only be included in a single block in any given blockchain.</p>

<p>Confirmations is simply a count of how many new blocks extend the chain. </p>

<p>If your tx is in block n, it has 1 confirmation. When block n+1 is mined, you need to check that the prevblockhash is the hash of block n. If it is, you now have 2 confirmations, since the chain has been mined. When block n+2 is mined, you check the prevblockhash against the hash of block n+1. If this is valid, you now have 3 confirmations, since block n+1 builds upon the block with your tx, and block n+2 builds upon block n+1. You can keep checking this for as many blocks as you feel necessary to guarantee that your tx will not be dropped. Most wallets/exchanges check until a tx has 6 confirmations.</p>

CC BY-SA 4.0
2018-05-17T15:05:01.940Z
2018-05-17T15:05:01.940Z
Raghav Sood
<p>Sorry for this naive question, but honestly it is going to be a great help for me.
Say I am tracking a specific bitcoin transaction(<strong>'TX_1'</strong>) form bitcoin core. A confirmed block had the transaction information after I decoded the block, and I updated my database as :  {transaction: <strong>'TX_1'</strong>, '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 (<strong>'TX_1'</strong>) to be present in upcoming blocks?</p>

<transactions><bitcoin-core><confirmations><zeromq>
How to increment the number of confirmation of a transaction?
Avik Samaddar
# How to increment the number of confirmation of a transaction?

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

Sorry for this naive question, but honestly it is going to be a great help for me.
Say I am tracking a specific bitcoin transaction(**'TX\_1'**) form bitcoin core. 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?

**Tags:** transactions, bitcoin-core, confirmations, zeromq


---

## 1 answers

### Answer by username_1 on 2018-05-17. Score: 3

A tx will only be included in a single block in any given blockchain.

Confirmations is simply a count of how many new blocks extend the chain.

If your tx is in block n, it has 1 confirmation. When block n+1 is mined, you need to check that the prevblockhash is the hash of block n. If it is, you now have 2 confirmations, since the chain has been mined. When block n+2 is mined, you check the prevblockhash against the hash of block n+1. If this is valid, you now have 3 confirmations, since block n+1 builds upon the block with your tx, and block n+2 builds upon block n+1. You can keep checking this for as many blocks as you feel necessary to guarantee that your tx will not be dropped. Most wallets/exchanges check until a tx has 6 confirmations.


---

