Is It Dangerous To Have Multiple Implementations Of Bitcoin?

1 year ago

This is an sentiment editorial by Bill Scoresby, a bitcoin-based tiny concern proprietor and writer of respective guides for bitcoin self-custody.

The bugs that precocious caused galore LND nodes to autumn retired of sync with the Bitcoin blockchain were astir apt caused by an alternate implementation.

Perhaps you are wondering, “Who successful the satellite is utilizing thing different than Bitcoin Core?” You mightiness not person known that different implementations of Bitcoin existed. Maybe you’re not definite what a antithetic implementation adjacent means.

Bitcoin Core began arsenic the bundle that Satoshi Nakamoto wrote successful C++ and released to the world. It has been updated with caller versions starring to the contiguous day. An alternate implementation is bundle that does the aforesaid happening arsenic Bitcoin Core — enforces the aforesaid statement rules — but is written differently, astir often successful a antithetic coding language.

How Did An Alternate Implementation Break Nodes On The Lightning Network?

One of the large Lightning Network node versions (LND) relies connected an alternate Bitcoin implementation called btcd. When a developer created a precise ample multisig transaction, btcd did not spot it arsenic valid due to the fact that it contained excessively overmuch witnesser data. Other Bitcoin implementations — astir importantly Bitcoin Core — had nary specified bounds connected Taproot transaction witnesser data, and truthful accepted the transaction and the artifact that contained it arsenic valid.

The effect was miners kept adding caller blocks connected the concatenation due to the fact that they weren’t utilizing btcd and according to their rules thing was wrong, but LND Lightning nodes couldn’t admit immoderate of these caller blocks due to the fact that they were built connected apical of the artifact containing that 1 transaction they saw arsenic invalid.

When the bug happened again connected November 1, it wasn’t conscionable LND nodes that were affected. Some electrs instances (an implementation of the backend server for Electrum Wallet) besides failed to scope statement with the remainder of the chain. While the LND nodes were enactment retired of statement due to the fact that of a akin contented successful btcd, it was an implementation of Bitcoin written successful Rust that caused the electrs nodes to autumn behind, including immoderate precise disposable servers run by mempool.space.

The bounds connected the size of witnesser data exists to forestall DoS attacks, and is simply a portion of Bitcoin Core arsenic good ( though Core has a larger bounds for Taproot transactions). It seems that the different 2 implementations that fell retired of sync had codification that maintained the smaller limit.

Very tiny differences successful implementations tin pb to a deficiency of consensus.

Having Multiple Implementations Of Bitcoin Is Dangerous

Satoshi didn’t similar the thought of aggregate implementations of Bitcoin. “I don’t judge a second, compatible implementation of Bitcoin volition ever beryllium a bully idea.” The crushed helium gave was, “So overmuch of the plan depends connected each nodes getting precisely identical results successful lockstep that a 2nd implementation would beryllium a menace to the network.”

Menace? What’s the large deal?

You’ve astir apt heard that the concatenation with the astir proof-of-work is the existent chain. When 2 antithetic miners find a artifact astatine the aforesaid time, the concatenation splits and different miners commencement gathering connected whichever artifact they perceive astir first.

As soon arsenic a caller artifact is added to 1 broadside of the split, astir nodes and miners judge that arsenic the caller existent concatenation and wantonness the different broadside of the split. These blocks are referred to arsenic stale blocks, though immoderate radical telephone them orphaned blocks.

Since the mean clip betwixt blocks successful Bitcoin is 10 minutes, it is apt the full web volition larn astir this caller artifact earlier 1 is added to the losing broadside of the split, and the concatenation with the astir enactment wins.

“Nodes volition travel the valid concatenation with the astir work…The cardinal connection present is valid. If the node receives a artifact that it determines invalid, it doesn’t substance however overmuch enactment is done connected apical of that block, the node volition not judge that chain.” — Andrew Chow

The cardinal connection is “valid.” The menace shows up erstwhile a miner finds a artifact that immoderate different miners and nodes deliberation isn’t valid. Miners who deliberation it is valid volition effort to physique caller blocks connected that chain. Miners who deliberation it isn’t valid volition effort to physique connected the past valid artifact they cognize about. The result: Two chains and nary mode to cognize which is true.

How successful the satellite would specified a happening travel to pass?

Well, arsenic we saw successful the lawsuit of the caller bug with LND nodes, if determination is simply a bug successful 1 implementation of Bitcoin that is not successful different implementations, it tin pb to a deficiency of statement astir whether a artifact is valid oregon not.

Bitcoin does not person a mechanics for fixing this. The assemblage extracurricular of the protocol has to determine what happens next. It sounds precise unpleasant.

So overmuch truthful that Bitcoin developer Peter Todd has said that other implementations request to lucifer Bitcoin Core bug-for-bug.

There you go: Multiple implementations are dangerous!

What Are The Other Implementations Of Bitcoin And Why Do They Exist?

First of all, astir everyone runs Bitcoin Core.

Luke Dashjr sees astir 43,000 nodes, 98% of which are moving Bitcoin Core and thing called Coin Dance sees adjacent to 15,000 nodes, 96% of which are moving Bitcoin Core. So, astatine the moment, it looks similar precise fewer radical are utilizing alternate implementations.

Nevertheless, determination are progressive projects that are trying to physique and support different codebases that instrumentality the Bitcoin protocol. They include:

Jameson Lopp has an fantabulous page with a much exhaustive database and links to each of the different implementations.

All of these projects person highly talented developers moving connected them, and each has existed for much than a fewer years. Why enactment truthful overmuch effort into thing that seems similar specified a problem?

Bitcoin is permissionless. Anyone tin download the chain; anyone tin interact with the network; and cipher tin halt you from coding oregon moving an alternate implementation.

Yet, clearly immoderate radical are successful charge of making changes to the Bitcoin repository and the process for choosing them seems informal. While determination is the Bitcoin Improvement Proposal (BIP) process for suggesting changes to Bitcoin Core, it is besides beauteous informal.

None of this is simply a nonstop problem. As Marty Bent points out, unsmooth statement tin beryllium a strength. If the process of changing Bitcoin is hard and unclear, it means that changes volition beryllium much thoroughly vetted.

The adjacent measurement of unsmooth statement is having much than 1 fashionable implementation.

Not Having Multiple Implementations Might Be More Dangerous

There tin beryllium nary uncertainty that it is already a precise hard occupation to beryllium 1 of the radical who has perpetrate entree to Bitcoin Core. In a satellite wherever Bitcoin plays a cardinal relation arsenic a monetary instrument, this occupation volition get overmuch much difficult. A tiny radical of developers could go a precise worthwhile target. At the precise least, their attraction volition beryllium sought successful bid to lobby for assorted inclusions oregon exclusions successful the adjacent bundle release.

Think astir the lobbying manufacture that presently exists successful politics. Why wouldn’t specified a happening make astir the radical who person perpetrate entree to the lone implementation of the Bitcoin protocol?

Like politicians now, they volition beryllium perceived to person entree to power. As such, radical volition people them, but these developers won’t person the musculus of a authorities to support them. What benignant of beingness is that going to be? Who would voluntarily take it?

At the extremity of the day, the planetary fiscal strategy is simply a beauteous dense value to remainder connected the shoulders of the tiny radical of radical who person perpetrate entree to 1 GitHub repository. Maybe not truthful antithetic from the planetary fiscal strategy we are trying to get distant from wherever people’s monetary aboriginal hinges connected the decisions of a fewer cardinal bankers.

Multiple Implementations To The Rescue!

The beingness and wide usage of aggregate implementations connected the Bitcoin web tin mitigate these pressures by making it overmuch much hard for a malicious histrion to alteration the Bitcoin protocol.

If participants successful the Bitcoin web are much evenly distributed among antithetic implementations, determination is much country for bully ideas to surface. Proposing changes to Bitcoin oregon rejecting them is simply a batch much decentralized if it isn’t each done successful 1 camp.

Clearly, utilizing antithetic implementations of Bitcoin increases the hazard of a concatenation split. A catastrophic concatenation divided — wherever a important information of nodes and miners accidentally forked disconnected — would not beryllium bully for Bitcoin, and surely not its price. But it wouldn’t endanger Bitcoin’s permissionless nature.

A centralized improvement situation wherever everyone lone builds connected Bitcoin Core could endanger permissionless-ness. The speech astir the taxable needs to code the risks of relying truthful heavy connected Bitcoin Core alternatively than focusing solely connected what problems mightiness beryllium caused by an alternate implementation.

There is simply a great, older article astir this debate by Aaron van Wirdum. You tin besides work a much recent, informative thread astir it.

This is simply a impermanent station by Bill Scoresby. Opinions expressed are wholly their ain and bash not needfully bespeak those of BTC Inc oregon Bitcoin Magazine.

View source