Well, i'm planning on developing a graph that shows bitcoin transaction average confirmation time per hour , but i have no clue where i can get transaction confirmation timestamps.

I'm running bitcoin core node with whole blockchain and sync up to date.

Any ideas ?


The time at which a transaction was confirmed can be found in the 4B timestamp in the block header (POSIX time encoding)

To compute average transactions confirmed/hour, you can consider the header timestamp and the number of transactions in each block in your considered timeframe. The first byte following the header represents the number of transactions in the block. However, you may want to exclude the coinbase tx from the transaction count for your purposes.

If you wish to compute the time between broadcasting and confirmation of a given transaction, you must have knowledge of when a transaction was specifically broadcast. Since this is only the case if you broadcast a tx yourself, you cannot compute this exactly. You can however, determine when a tx was first accepted to the mempool of your local node, and use that as a proxy. Bitcoind offers a tx subscription service which publishes newly accepted mempool txs over a zmq interface. By indexing these with local timestamps(time of mempool acceptance), your application can later determine the time passed to the confirmation of a previously indexed tx from a block which includes this tx and the block header timestamp.

  • 1
    Worth to note that the 4 byte timestamp in the block header isn't really an accurate description of when the block was actually broadcast to the network. – arubi Dec 23 '18 at 5:10
  • 1
    True though variances should average out over a large enough timeframe. Difficulty adjustment also based on timestamps. – James C. Dec 23 '18 at 19:48
  • Yea I was only mentioning because the required window in OP was one hour which is pretty short for relying on block times. But I guess for historical data and less accuracy it's not bad. – arubi Dec 23 '18 at 20:21
  • Well guys this isn't quit what i was initially looking for, i was looking for a way on getting a bitcoin transaction confirmations timestamps, i.e. the first three confirmations timestamps, so i can analyse the avg time for each confirmation and monitor it network wise. – Sameer Tarawneh Dec 24 '18 at 8:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.