Libconsensus separated repository (was Bitcoin Core and hard forks)



Summary:

The discussion is centered around separating current-libconsensus from theoretical future-libconsensus in the Bitcoin Core code. The goal is to decouple all consensus rules from the rest of the Bitcoin Core code and move it to a subrepository or subtree like libsecp256k1. However, there are concerns that separating current-libconsensus now may make completing future-libconsensus harder.The plan is to complete future-libconsensus that implements ALL consensus rules and expose more things than VerifyScript through its API. Bitcoin Core will always keep using future-libconsensus, but the only question is whether it will use it through the C API or as a subtree/subrepository. Libbitcoin uses a fork of libsecp256k1 and would probably do the same with the consensus library if it was cleanly isolated.Once future-Bitcoin's API is completed and the code is in a different repo, how Bitcoin Core is using the API instead of the sources directly of any importance to other implementations is unclear. The Satohi client has been using all along and it will use it forever. There is a plan to move from OpenSSL to libsecp256k1 for validation too, and a separate mailing list for consensus-only things might be useful.The author discusses the possibility of schism consensus-rules changes in cryptocurrency, and how they can be avoided by protecting implementations against forced changes. They express that ideally, consensus changes would be uncontroversial or not happen at all.The author is maintaining a fork of consensus sources until they are properly isolated from the satoshi client and the client uses the actual library. They do not see it as important to wedge the consensus library into the repository/build for bitcoind and Bitcoin-QT, and believe it is straightforward to maintain the consensus library independently.The use of future-libconsensus through a subtree instead of API is not a preference or goal, but rather a necessity in completing and separating future-libconsensus. Finally, the author expresses their willingness to work on the project but notes that fear of consensus bugs is what keeps people on the satoshi client, and that lack of time may also be a factor.


Updated on: 2023-06-10T03:38:42.560268+00:00