<p>Confirmations are nothing but just the number of blocks added after the block the transaction was added in. So accordingly, during the time of writing, the current block is 620093 and your transaction was added in block 615893</p>

<p>So if you subtract these two , current block - tx added block(620093 - 615893 = 4200), you will get the total number of confiramtions, which is near to your block confirmations (4198)</p>

<p>Hope this was helpful. Have a great day! </p>

CC BY-SA 4.0
2020-03-04T07:29:14.273Z
Thanks, great info!  Any idea how I can get the current block height?
MikeyE
CC BY-SA 4.0
2020-03-04T07:35:10.977Z
I should have looked at the same site I reference earlier.  After a quick search I found this URL, which returns the block `height` among other things as JSON.  https://blockchain.info/latestblock
MikeyE
CC BY-SA 4.0
2020-03-04T07:57:15.807Z
Yes, that's a great way to get the block height. Now you just to extract both of them and subtract them to get total confirmations
Hackeerrrr
CC BY-SA 4.0
2020-03-04T04:57:51.923Z
2020-03-04T04:57:51.923Z
Hackeerrrr
<p>According to blockchain.info, 4,198 confirmations have been received on the following Bitcoin transaction at the time of this writing. Give then following Bitcoin transaction as JSON (ref: <a href="https://blockchain.info/rawtx/406fe52a8cb99cfdc3ed6cc3e2ef461608e369943a9c1f4132421d3de425e66c" rel="nofollow noreferrer">transaction on blockhain.info as JSON</a>) how can I determine the number of confirmations?</p>

<p><a href="https://i.sstatic.net/RlMqR.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/RlMqR.png" alt="enter image description here"></a></p>

<p>Transaction as JSON</p>



<pre><code>{
   "ver":1,
   "inputs":[
      {
         "sequence":4294967295,
         "witness":"",
         "prev_out":{
            "spent":true,
            "spending_outpoints":[
               {
                  "tx_index":0,
                  "n":0
               }
            ],
            "tx_index":0,
            "type":0,
            "addr":"1BiYTVfoAWpEf5vTCVyWgWzsbdTbi3X4Lb",
            "value":4371338,
            "n":1,
            "script":"76a914758c92328cb8f0d5a9e2bc6a1b27b6fdf83fa86588ac"
         },
         "script":"483045022100f6d8e0e386079721dc286d25c88c5cddd8733ee3d93247f3ff0127e8aa7dcb9a02206ce2b7e524e4796e93688442dcc95bb7c8e2bcf3a46ac660633fac3e0becfd5e012102a9dba5ef4653f48190bf6b12130f001fe14cda8b8e2e06bf2e96b9cf3c442503"
      }
   ],
   "weight":760,
   "block_height":615893,
   "relayed_by":"0.0.0.0",
   "out":[
      {
         "spent":true,
         "spending_outpoints":[
            {
               "tx_index":0,
               "n":0
            }
         ],
         "tx_index":0,
         "type":0,
         "addr":"3BMEXDcDGPjGGR6MHiFiHRPfz6LeGeYYM3",
         "value":4366812,
         "n":0,
         "script":"a91469f3746a2b4246695de6ae4fd0d2c27221b1cd9d87"
      }
   ],
   "lock_time":0,
   "size":190,
   "block_index":0,
   "time":1580790109,
   "tx_index":0,
   "vin_sz":1,
   "hash":"406fe52a8cb99cfdc3ed6cc3e2ef461608e369943a9c1f4132421d3de425e66c",
   "vout_sz":1
}
</code></pre>

<transactions><transaction-verification>
Given a Bitcoin transaction as JSON data, how can I determine the number of confirmations?
MikeyE
# Given a Bitcoin transaction as JSON data, how can I determine the number of confirmations?

(Asked by: username_0 on 2020-03-04)

According to blockchain.info, 4,198 confirmations have been received on the following Bitcoin transaction at the time of this writing. Give then following Bitcoin transaction as JSON (ref: [transaction on blockhain.info as JSON](https://blockchain.info/rawtx/406fe52a8cb99cfdc3ed6cc3e2ef461608e369943a9c1f4132421d3de425e66c)) how can I determine the number of confirmations?

[![enter image description here](https://i.sstatic.net/RlMqR.png)](https://i.sstatic.net/RlMqR.png)

Transaction as JSON

```
{
   "ver":1,
   "inputs":[
      {
         "sequence":4294967295,
         "witness":"",
         "prev_out":{
            "spent":true,
            "spending_outpoints":[
               {
                  "tx_index":0,
                  "n":0
               }
            ],
            "tx_index":0,
            "type":0,
            "addr":"1BiYTVfoAWpEf5vTCVyWgWzsbdTbi3X4Lb",
            "value":4371338,
            "n":1,
            "script":"76a914758c92328cb8f0d5a9e2bc6a1b27b6fdf83fa86588ac"
         },
         "script":"483045022100f6d8e0e386079721dc286d25c88c5cddd8733ee3d93247f3ff0127e8aa7dcb9a02206ce2b7e524e4796e93688442dcc95bb7c8e2bcf3a46ac660633fac3e0becfd5e012102a9dba5ef4653f48190bf6b12130f001fe14cda8b8e2e06bf2e96b9cf3c442503"
      }
   ],
   "weight":760,
   "block_height":615893,
   "relayed_by":"0.0.0.0",
   "out":[
      {
         "spent":true,
         "spending_outpoints":[
            {
               "tx_index":0,
               "n":0
            }
         ],
         "tx_index":0,
         "type":0,
         "addr":"3BMEXDcDGPjGGR6MHiFiHRPfz6LeGeYYM3",
         "value":4366812,
         "n":0,
         "script":"a91469f3746a2b4246695de6ae4fd0d2c27221b1cd9d87"
      }
   ],
   "lock_time":0,
   "size":190,
   "block_index":0,
   "time":1580790109,
   "tx_index":0,
   "vin_sz":1,
   "hash":"406fe52a8cb99cfdc3ed6cc3e2ef461608e369943a9c1f4132421d3de425e66c",
   "vout_sz":1
}

```

**Tags:** transactions, transaction-verification


---

## 1 answers

### Answer by username_1 on 2020-03-04. Score: 2

Confirmations are nothing but just the number of blocks added after the block the transaction was added in. So accordingly, during the time of writing, the current block is 620093 and your transaction was added in block 615893

So if you subtract these two , current block - tx added block(620093 - 615893 = 4200), you will get the total number of confiramtions, which is near to your block confirmations (4198)

Hope this was helpful. Have a great day!

> **Comments:**
> **username_0**: Thanks, great info!  Any idea how I can get the current block height?  
> **username_0**: I should have looked at the same site I reference earlier.  After a quick search I found this URL, which returns the block `height` among other things as JSON.  https://blockchain.info/latestblock  
> **username_1**: Yes, that's a great way to get the block height. Now you just to extract both of them and subtract them to get total confirmations  

---

