Describe the issue
It takes a long time and consumes a lot of resources to synchronize beginning at the Genesis block. Many people don't want to spend that opportunity cost. The Genesis block is a checkpoint with an empty UTXO set. Lets let people start from (Periodic UTXO Merkle Tree + Checkpoint Block) Checkpoints instead of the Genesis block.
Expected behaviour
- Close Bitcoin
- Delete the blocks, chainstate, and database folders.
- Start Bitcoin
- Send and receive transactions
Actual behaviour
- Close Bitcoin
- Delete the blocks, chainstate, and database folders.
- Start Bitcoin
- Watch the grass grow, paint dry, etc.
- Use Electrum. *Comic relief, come on guys, such a hard audience!
What version of bitcoin-core are you using?
0.13.2
Suggested Solution
Every CheckpointPeriod number of blocks, maybe every 1 week, 1 month, or 3 months:
- Block is determined by client to be a Checkpoint Block.
- UTXO set is atomically: sorted by txid, placed into an independently reproducible Merlke tree
- Resulting hash from Step 2 Merkle tree is hashed with Checkpoint Block Hash. This is called the Checkpoint Hash.
- Look through Checkpoint Hash messages from other nodes. Puts into a Trustworthy Checkpoint Hash List any signed by a Set of Public Keys Considered as *Trustworthy (SPKCT). SPKCT is loaded with data from a json file, which can be updated by the user, maybe client restart required.
- Client verifies Checkpoint Hash signatures in the SPKCT.
- For each Trustworthy Checkpoint Hash, compare with Checkpoint Hash computed at Step 3. a. All match: life as normal b. Discrepancy: Alarm user: Trustworthy node is compromised/mistaken c. List empty: Alarm user: Trustworthy nodes unreachable, suspect serious network problems
- Trustworthy here means as trustworthy as the signature used to sign the Genesis block.
Given the above is standard practice...
- When a pruning client is first started, it can ask the network for the latest (or some CheckpointVerifyBlockWindow blocks back) Checkpoint, and start from there instead of the Genesis block.
- Also, if a pruning client hasn't connected to the network in a long time, it could potentially again start synchronizing from the latest Checkpoint instead of from where it disconnected. This might require the wallet support utxo-only coins better. I forget, do blocks contain a Merkel tree hash for the transaction hashes?
- This could also be used to jump start a client to get it working immediately, and then if the user wants build up from the Genesis block in the background.
Security/Reliability Improvement
My proposed solution actually helps identify numerous problems. For example:
- If a portion of the network gets disconnected, it can now be detected
- If a computer is compromised or there is some computational error in the UTXO state, it can now be detected
Security Model Alert
If a user decides to start synchronization from a Checkpoint, such requires more trust than starting from the Genesis block. This is because a UTXO set cannot be self-verified without beginning synchronization at the Genesis block. But... I think my proposal does a pretty good job of identifying if someone lies. See "Security/Reliability Improvement", think about instead of loading the latest Checkpoint, load say 10 Checkpoints back or something. Ultimately I think my suggestion results in almost as good of security as starting synchronization at the Genesis block.