<p>Unfortunately, at least for bitcoin and litecoin (and likely most bitcoin derivative block chains), the only way to get this information is to have a node/client listening at the time the transaction appears on the network.</p>

<p>Otherwise your client will simply <a href="https://bitcoin.stackexchange.com/questions/10732/what-is-the-difference-between-time-blocktime-and-timereceived">use the block's timestamp</a> for each transaction. </p>

<p>This design means that getting this information is only possible if using a third party who was maintaining a copy of the blockchain at that time, or potentially getting a dump of a trusted source's blockchain which should (I believe, although I haven't tested it myself) maintain the original client's timestamps. </p>

<p>Would be great if someone could confirm this. I will myself if I get the chance to test it but that might not happen any time soon.</p>

CC BY-SA 3.0
2018-03-15T02:06:32.297Z
2018-03-15T02:17:22.137Z
2018-03-15T02:17:22.137Z
GrayedFox
<p>Is it possible to calculate - <strong><em>or even reasonably estimate</em></strong> - how long it took for a transaction to be included in a block after it was first created?</p>

<p>I'm asking about already confirmed transactions which are already included on the blockchain - and all transactions - not just ones that belong to me.</p>

<p>I am currently building a project which scrapes a given blockchain for whatever info/attributes a user desires. You can <a href="https://github.com/GrayedFox/blockscrape" rel="nofollow noreferrer">check it out here</a> - be warned it's no where near ready for production and not even at version 1 yet - but the develop branch is getting close.</p>

<p>As I understand from the docs and <a href="https://bitcoin.stackexchange.com/questions/10732/what-is-the-difference-between-time-blocktime-and-timereceived">the answer to this question</a> the time received attribute is not, as some may think, the time a transaction was "received into a block" but rather the time when my client first noticed the transaction - this attribute is also not available when using <code>getrawtransaction</code>. So that's a no-go.</p>

<p>Ideally, I'm looking for the time that a transaction is created (sent) and the time it is included (confirmed) on a block.</p>

<p>Based on the above info my idea is:</p>

<ul>
<li>for new (unconfirmed) transactions we record the time that my node
first notices the transaction</li>
<li>then we record the time that my node
notices it is confirmed</li>
</ul>

<p>This would at least give me an indication as to how long it takes newly created transactions to be confirmed. Of course latency adds a huge amount of noise here, but it's at least a step in the right direction!</p>

<p>I would like to do this for existing, confirmed transactions if possible.</p>

<p>Thanks for your time.</p>

CC BY-SA 4.0
2018-05-15T08:02:18.487Z
I have been running a full node for some time now to extract a proxy for this information by keeping a real time tracker of transactions going through the raw mempool, adding a time stamp when **my node** first saw the transaction ID and then computing the time difference after the transaction has been included in a block...I do not see another way which would make it possible to determine the waiting time ex-post, e.g. after the transaction has been included in a block without tracking the raw mempool.
Stefan Voigt
<blockchain><bitcoind><litecoin>
How can I calculate how long it took a transaction to be confirmed?
GrayedFox
# How can I calculate how long it took a transaction to be confirmed?

(Asked by: username_0 on 2018-03-08)

Is it possible to calculate - ***or even reasonably estimate*** - how long it took for a transaction to be included in a block after it was first created?

I'm asking about already confirmed transactions which are already included on the blockchain - and all transactions - not just ones that belong to me.

I am currently building a project which scrapes a given blockchain for whatever info/attributes a user desires. You can [check it out here](https://github.com/username_0/blockscrape) - be warned it's no where near ready for production and not even at version 1 yet - but the develop branch is getting close.

As I understand from the docs and [the answer to this question](https://bitcoin.stackexchange.com/questions/10732/what-is-the-difference-between-time-blocktime-and-timereceived) the time received attribute is not, as some may think, the time a transaction was "received into a block" but rather the time when my client first noticed the transaction - this attribute is also not available when using `getrawtransaction`. So that's a no-go.

Ideally, I'm looking for the time that a transaction is created (sent) and the time it is included (confirmed) on a block.

Based on the above info my idea is:

* for new (unconfirmed) transactions we record the time that my node
  first notices the transaction
* then we record the time that my node
  notices it is confirmed

This would at least give me an indication as to how long it takes newly created transactions to be confirmed. Of course latency adds a huge amount of noise here, but it's at least a step in the right direction!

I would like to do this for existing, confirmed transactions if possible.

Thanks for your time.

**Tags:** blockchain, bitcoind, litecoin

> **Comments:**
> **username_1**: I have been running a full node for some time now to extract a proxy for this information by keeping a real time tracker of transactions going through the raw mempool, adding a time stamp when **my node** first saw the transaction ID and then computing the time difference after the transaction has been included in a block...I do not see another way which would make it possible to determine the waiting time ex-post, e.g. after the transaction has been included in a block without tracking the raw mempool.  

---

## 1 answers

### Answer by username_0 on 2018-03-15. Score: 0 | Accepted answer

Unfortunately, at least for bitcoin and litecoin (and likely most bitcoin derivative block chains), the only way to get this information is to have a node/client listening at the time the transaction appears on the network.

Otherwise your client will simply [use the block's timestamp](https://bitcoin.stackexchange.com/questions/10732/what-is-the-difference-between-time-blocktime-and-timereceived) for each transaction.

This design means that getting this information is only possible if using a third party who was maintaining a copy of the blockchain at that time, or potentially getting a dump of a trusted source's blockchain which should (I believe, although I haven't tested it myself) maintain the original client's timestamps.

Would be great if someone could confirm this. I will myself if I get the chance to test it but that might not happen any time soon.


---

