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 - 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 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.