Blockchain/Level X · Full circle/10.3 Living on bitcoin/Lesson 5
Building on bitcoin
Regtest, descriptors, and the discipline of public review
MaterialsA computer running Bitcoin Core (downloaded and verified)The bitcoin-cli reference (bitcoin-cli help)Documentation for BIP 174 and BIP 380
Wonder
- Why does a single line of code change in Bitcoin Core require months of discussion before it reaches a stable release?
- How do developers test consensus-critical logic without risking real funds or breaking the main network?
- What is the difference between a descriptor and a PSBT, and why are both essential for modern wallet development?
Explore
- Bitcoin Core provides two primary environments for testing: regtest and signet. Regtest allows developers to mine blocks instantly with no proof-of-work requirement, making it ideal for unit tests and rapid iteration on consensus rules. Signet (BIP 325) is a public test network whose blocks must also carry a signature from designated signers, so it keeps steady block times and cannot be flooded by hashrate; it suits testing against other people’s software without real money.
- The Remote Procedure Call (RPC) interface exposes Bitcoin Core’s internal state to external scripts. Developers use RPC commands to manipulate chains, inspect transactions, and trigger mining in regtest. This programmatic access is fundamental for building wallet software that needs to interact with a node’s data structures directly, bypassing the graphical user interface entirely.
- Descriptors define how keys are derived into spending conditions, while Partially Signed Bitcoin Transactions (PSBTs) facilitate multi-party signing workflows. BIP 174 standardized the PSBT format, allowing different entities—hardware wallets, mobile devices, or servers—to add signatures to a transaction without exposing private keys. This separation of key management from transaction construction is critical for secure multisig setups.
- The Bitcoin Dev Kit (BDK) and Lightning Dev Kit (LDK) abstract away the complexity of node management for application developers. BDK is a Rust library for descriptor-based wallets that can read the chain from Bitcoin Core, an Electrum server or an Esplora API, while LDK provides a lightweight implementation of the Lightning Network protocol suitable for mobile devices. These libraries lower the barrier to entry for building bitcoin-native applications without requiring deep systems programming knowledge.
- Public review is the backbone of Bitcoin’s security model. Changes proposed via pull requests undergo rigorous scrutiny from a global community of developers. The PR Review Club facilitates this by organizing regular sessions where contributors analyze diffs line-by-line. This collective intelligence catches subtle bugs and ensures that consensus changes are thoroughly understood before adoption, a process distinct from the rapid release cycles common in other software ecosystems.
- Start a private chain: run bitcoind -regtest -daemon, create a wallet with bitcoin-cli -regtest createwallet dev, and mine 101 blocks to one of its addresses with generatetoaddress so the first coinbase matures. Build a payment with walletcreatefundedpsbt, read it with decodepsbt, then sign and broadcast it with walletprocesspsbt and sendrawtransaction. Mine one more block and watch it confirm.
Key facts
- Regtest allows instant block mining with no proof-of-work requirement for isolated testing.
- Signet (BIP 325) blocks must be signed by designated keys, giving a stable public test network.
- BIP 174 defines the Partially Signed Bitcoin Transaction (PSBT) format for multi-party signing workflows.
- Output script descriptors in BIP 380 define key derivation paths and spending conditions for wallets.
- The Bitcoin Dev Kit (BDK) is a Rust library for building descriptor-based wallets on several chain back-ends.
- Public pull request review ensures consensus changes undergo rigorous, multi-layered scrutiny before release.
Exercise nine, six, three, one
9CollectIdentify 9 distinct components of the Bitcoin development ecosystem: regtest, signet, mainnet, RPC interface, descriptors, PSBTs, BDK, LDK, and PR Review Club. For each, note its primary purpose in the software lifecycle.
6ClusterGroup these 9 components into 6 categories by function: private testing, public testing, node interfaces, wallet standards, development libraries, and review.
3DistillReduce the 6 groups to 3 core principles that govern bitcoin software development: isolation for safety, standardization for compatibility, and transparency for security.
1CrystallizeWrite 1 sentence explaining why a PSBT is necessary when using a hardware wallet that cannot connect directly to a network node.
Fact check
Dates, figures and claims checked against the published sources listed below.