Sign up ×
Bitcoin Stack Exchange is a question and answer site for Bitcoin crypto-currency enthusiasts. It's 100% free, no registration required.

I'm very interested in doing some analysis of orphaned blocks, but to do so I'd have to have a good way of accessing them. seems like a good place to start but I don't want to abuse their API by scraping the entire Blockchain. Another attempt was to use ABE but after parsing nearly all the blockchain from my Disk (several days of work) I am unable to find a single orphaned block, and I'm starting to fear that the satoshi client prunes old orphaned blocks, which would be a pity.

Will I be able to find orphaned blocks with ABE, and if not what alternatives are there?

share|improve this question

2 Answers 2

up vote 2 down vote accepted

Orphaned blocks are stored in blkxxxx.dat files forever, though each node will know about different orphaned blocks. Bitcoin will print a list of all known blocks, including orphans, to debug.log if you pass it -printblocktree.

share|improve this answer
Uh, I didn't think about them not being stored on nodes that haven't seen them in the original broadcast. So nodes that weren't online when the orphaned blocks still had a chance of becoming legit will never see it? How long has the orphaned node to be abandoned until it is no longer announced? –  cdecker Jul 17 '12 at 9:03
@cdecker Blocks are only relayed across the network once; nodes won't relay a block if it has already been seen or if it doesn't extend the currently-longest chain. So nodes that aren't online when a block is broadcast won't see it unless it becomes part of the main chain. –  theymos Jul 17 '12 at 19:50
That confirms what I was seeing. So if there is no archive that kept a log of all transactions I won't be able to reconstruct forks at all, right? only has forks back to block 142257. Any idea where I can find more? –  cdecker Jul 18 '12 at 9:11
@cdecker Here's my printblocktree output on a node that's been running for a very long time: –  theymos Jul 18 '12 at 22:07

From what I can see, ABE works pretty much like the BlockExplorer in regards to orphaned blocks, which is to say it forgets them. It appears that only actively stores orphaned blocks, and even displays them in a neat list.

The only other way to analyse orphaned blocks is to keep a history of the last couple blocks and constantly keep checking whether they changed. This is the approach I used for testing a simulated 51% attack on the TestNet in my master thesis. However, orphaned blocks don't occur all that often. You can look into a question on that, or go directly to the stats.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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