I am a DIANNA
developer. DIANNA uses Bitcoin chain as a base timestamp server and has built-in lightweight Bitcoin client based on BitcoinJ.
The primary target is make Bitcoin chain as thin as possible and safe enough simultaneously. I need an advice how to make it.
DIANNA really don't have to know what happened in Bitcoin some number of blocks ago. So I think to use Bitcoin checkpoints merged into secondary Merkle Tree in DIANNA block with hashes of checkpointed Bitcoin blocks:
genesis_hash chk1_hash@height1 chk2_hash@height2 ... chkN_hash@heightN
So the latest hash in this sequence can be considered as secondary-genesis where to start from.
The question is: how far it would be safe to make checkpoint from BitcoinCurrentBestHeight()?
I see some checkpoints in bitcoin code. But they are hardcoded and seems that there is no way to determine them automatically on new addition to this list.
So how is safe to do checkpointing every 100/1000/10000 blocks? What was the longest fork of Bitcoin chain?
Also some practical suggestions of similar procedures are welcome.