I have been thinking lately about how bitcoin protocol rules are currently specified mostly in the code itself (i.e the Bitcoin core) scattered BIPs and developer documentation. I know this has worked well for about 17 years now but subtle differences in interpretation occasionally pop up between between implementations and even between versions of Core. We've seen edge cases in block acceptance, mempool policy and consensus rules that in theory could lead to chain splits if not caught early.
I came across this post on the
Bitcoin dev mailing list and it caught my attention. btc-verified: formalizing the Bitcoin protocol". The idea is to create a more formal, machine readable specification of the protocol. So this got me wondering.
How feasible would it be to have a single, executable reference specification that could serve as a golden model for consensus rules? Could this reduce the risk of consensus divergence, catch bugs earlier and make it easier for alternative clients to stay perfectly in sync?
I'm thinking this would slow down development too much but what other downsides do you foresee?
I'm wondering if investing in a formal executable spec could make the protocol more robust long term especially as the network grows and we consider more complex soft forks.
Sorry if the post is a bit lengthy.