How about following rule:
when a block is generated, the block 120 blocks deep the chain is checkpointed, *if*
- current hashing power is more than half of the to-be-checkpointed block
How do you measure current hashing power?
Do you mean difficulty must be at least 50% of what it was 120 blocks ago? That isn't much protection since difficulty doesn't change very often.
Does this guarantee solving problems with forked chains? Only the chain is checkpointed which has majority of the hashing power.
The problem with checkpointing is what happens if there is a reversal.
For example, if I launch a 51% attack starting from behind the checkpoint, then all new nodes will follow my chain.
Nodes that were offline will also follow my chain.
Nodes that were online would follow the other chain.
This forks the network and it can't heal itself.
I think sending the entire header tree would help here. A new node that connects would see that there was a 120+ block fork. It could warn the user that the chain is potentially unstable at the moment.
Nodes would be able to see that there was a fork that would have caused a checkpoint.
Still thinking good formula to estimate if the hashing power is more than half.. both blocks difficulty and time should be considered. And maybe some safety reserve, so variations on block times does not affect the result.
Including block time is risky, since it creates an incentive to mess with the field. An attacker could set it to whatever he likes (but not to far in the future).
Faking high hash rate means earlier block times, so the future rule doesn't apply. If I produce a sequence of blocks with timestamps 1 second apart, it will seem like a massive hash rate.
Edit: when a new soft checkpoint is made, the previous one can be forgotten, ie there need not to be more than one soft checkpoint at a time.
If they are both on the same chain, then keeping the old one has no effect one way or another.
What do you mean by soft? The rule could be that a fork 120 blocks longer can displace a checkpoint. This would at least allow the network to re-sync.
Clients could enter emergency mode using this rule.
- find longest chain (L)
- find any other chain which
-- forked more than 120 blocks ago
-- where the fork is at least 120 blocks long
-- has a weight of at least (L's weight - 120 blocks)
The hard checkpoints also speed up validation. They could do that without acting as checkpoints.
Validation would start at the last hard checkpoint that is on the longest chain.
If the entire chain was displaced by a higher POW chain, then nodes would accept the new chain. They would have to verify it in its entirety.