Why
This PR introduces a small, feature-flagged prototype scaffold for Proof-of-Authority (PoA) + lightweight BFT and an experimental P2P routing layer. The goal is to provide a safe place to iterate on PoA/BFT and routing ideas behind a runtime flag (-enable-poa) without changing default behavior for users who do not opt in.
Summary of approach
- Add a minimal PoA/BFT module (poa::InitPoA / ShutdownPoA / IsPoAEnabled) and a placeholder experimental P2P routing layer (p2p::InitRouting / ShutdownRouting). These subsystems are initialized at startup only when -enable-poa is set.
- Hook initialization into src/init.cpp and include the new sources in CMakeLists.txt.
- Prototype changes include two consensus-impacting edits done during prototyping: src/consensus/amount.h (MAX_MONEY adjusted to allow effectively unlimited supply for experimentation) and src/validation.cpp (simple miner-cooldown check prototype). These are HIGH-RISK consensus changes and are present only for private/test usage/prototyping. They will cause a hard fork if enabled on a public network and require careful review.
What changed (high level)
- New files: src/poa/poa.h, src/poa/poa.cpp, src/p2p/routing.h, src/p2p/routing.cpp
- Modified startup/init to initialize PoA and routing when -enable-poa is set (src/init.cpp)
- Updated build to compile the prototype sources (src/CMakeLists.txt)
- Prototype consensus edits for experimentation: src/consensus/amount.h and src/validation.cpp
Important notes and review requests
- These edits are explicitly experimental. The PoA/BFT and routing code are scaffolding/placeholders with TODOs for validator registry, signed block proposals, signature aggregation, leader election, and P2P overlay algorithms.
- The consensus edits are dangerous. Reviewers should flag any unintended consensus changes. If the intent is to keep this PR non-consensus (only scaffolding), the consensus edits must be reverted and moved behind feature-guarding or removed entirely before wider review.
- No unit or functional tests are included. Adding tests and a test plan (regtest/testnet flows) is required before merging.
Testing / How to run
- Build as usual. Run bitcoind/bitcoin-qt locally. To enable the prototype behavior at runtime: bitcoind -enable-poa
- Exercise on a private regtest/testnet; do NOT enable on mainnet. The consensus edits will change chain rules and can cause forks.
Follow-ups
- Implement validator registry (on-disk + on-chain option), robust validator identity (pubkeys), and signed block headers.
- Replace ad-hoc miner identity heuristic with on-chain-registered validator identity and signed blocks.
- Add BFT commit layer (threshold signatures / multisig) and leader selection (round-robin or verifiable random) behind feature flag and tests.
- Design slashing/penalty and migration/upgrade plan; comprehensive security review required.
If any of the consensus edits should not be included in this PR, say so and I will revert them and push an updated branch.