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

FWIW: this might be somewhat relevant to BitVM(x) and the Union Bridge. Because every BitVM construction needs to solve the problem of the canonical chain, existing solutions depend on trusted watchtowers, but maybe an estimate of future cumulative work + a maximum age can be sufficient.

The maximum age is necessary because the older the checkpoint is the easier for someone to build a fork in the future to match a lower work threshold in the past. (somewhat explained in the writeup repo above).

But the maximum age, requires a constant refreshing of the locked funds. This might be made easier by always prioritizing oldest pegins for future pegouts. This way it maybe be viable to keep the oldest pegin at less than 4 years old, which is around the maximum age that I am going with so far.

As for my application, I plan to deal with anchors older than 4 years by analyzing peer ips and hope that I can get a secondary heuristic of whether or not there is a network partitioning happening.

I would love if anyone has any advice.

Update: I found another way to estimate future hash rate, using the famous power law price estimate (the conservative fitting over historical bottoms), and using the hashrate-price correlation I previously shared here.

This estimate is holding up much better, and it shows that it takes an attacker more than 5% of all the available PoW to pass my network partitioning filter. That costs 100s of millions of dollars, so I am satisfied that it is good enough.



1 Like