Bitcion node's network partitioning resilience

While I was working on an implementation of Rootstock node for edge devices, based on the Ephemeral Sidechains design, I realized that I need to first find bitcoin tail that I can trust to be final and practically impossible to be reorged, because that is the root of my trust in the rootstock checkpoints.

Usually nodes are assumed to be well connected, so much so that they will eventually find the best chain, and the network partitioning isn’t a concern. But in my case, if I want my Rootstock node to be able to have the fastest convergence towards the state of a smart contract, almost approaching DNS lookup performance, then I need much faster trust in Bitcoin proposed chain by the first peers I can find.

So I tried to reason about how to achieve a high confidence in a bitcoin chain, even under network partitioning, relying only on subjectively trusted checkpoints (which come hardcoded in the binary, or have been confirmed since in previous sessions before restarting the node), and estimating the current hash rate based on these checkpoints and how old they are.

Long story short;

  1. you demand as much work as 100 recent blocks.
  2. you estimate the work in recent blocks by finding the trend line of difficulty in the latest 3 years in the checkpoints you have.

Of course this entirely depends on the assumption that you can roughly and conservatively estimate the current difficulty purely from historical (possibly multiple years old) data, but this assumption is reasonable.

As you can see below, taking a power law fit over the trusted history you have so far, with a margin of error based on the volatility in the past, gives you nice conservative projection in the future, and the more stale your node is, the more you will need to wait to start trusting new blocks.

For example you need to wait for 10000 blocks in 2016 to trust new blocks if the last time you ran your node was in 2014.

But if the last time you ran your node was 3 years ago, then you will need to wait for more or less a 100 blocks to be confident that no one is using network partitioning to sell you a fake fork, because it would be too expensive for them to do so.

Some artifacts that might explain and justify this more for you and your agents to check whenever you like GitHub - Nuhvi/partition-safe-ibd: Exploration for an IBD safe from network partitioning by analyzing hash rate history · GitHub