Bitcoin Forum
October 22, 2021, 11:45:41 PM *
News: Latest Bitcoin Core release: 22.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Is there a way to parse the blockchain to see which blocks have spent coinbases?  (Read 577 times)
Taras
Legendary
*
Offline Offline

Activity: 1386
Merit: 1042


Please do not PM me loan requests!


View Profile WWW
March 09, 2014, 03:28:30 AM
 #1

There HAS to be a program for this or something. It's unbelievably stressful manually ciphering through one block at a time.
I mean blocks which have their coins spent after being mined.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
DannyHamilton
Legendary
*
Offline Offline

Activity: 2604
Merit: 2500



View Profile
March 09, 2014, 11:02:41 PM
 #2

There HAS to be a program for this or something. It's unbelievably stressful manually ciphering through one block at a time.
I mean blocks which have their coins spent after being mined.

As far as I know, the only way to know if the block reward has been spent is to search through the entire blockchain to see if ANY other transaction references the transactionID of the block reward in its list of inputs.

Any such program that is going to run efficiently would probably need to pre-process the entire blockchain loading all transactions into an indexed table that would allow you to query input hashes.

Blockchain.info has such as database, and using their API it would be exceedingly simply to create a short script that would find each block reward and determine if/when it was spent.

I'm not sure if blockchain.info would be very happy though with someone flooding their servers with almost 600,000 requests in a short period of time.

Barring that, you'll need to find (or write) a program that will parse the blockchain and load it into something like mySQL.
fbueller
Sr. Member
****
Offline Offline

Activity: 412
Merit: 250


View Profile
March 10, 2014, 11:46:08 AM
 #3

Such scripts are incredibly slow. I'm running a script at the moment to scan every block for payments to p2sh addresses (just check all outputs for ones going to addresses with version byte \x05) and it's taken about two weeks to get to block 180000, before it got painfully slow. I'm still leaving it run anyway, but I think a flexible resource to query the blockchain would be invaluable to researchers, especially those who can't code their own tools.

Bitwasp Developer.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!