There's no better way to learn how something works than by trying to reproduce it.
Paul Graham, "How to Do Great Work"
A Bitcoin node is the backbone of the Bitcoin network, functioning as a participant that validates transactions, maintains a copy of the blockchain, and ensure the integrity of the blockchain by enforcing consensus rules.
The Bitcoin_rules!
project is a comprehensive endeavor aimed at exploring the intricacies of Bitcoin's protocol, staring from the very basics of the protocol and building up to a fully functional Bitcoin node, (almost) from scratch. Bitcoin_rules!
goes beyond the surface-level understanding of Bitcoin: we delve into the technical aspects of building a full node, offering a deep dive into the inner workings of the Bitcoin network, protocol, and consensus.
Moreover, consider this as a contribute to the Bitcoin spread and adoption.
See references for documentations, references, and articles used building Bitcoin_rules!
. See also roadmap for the list of features and milestones.
Do not use this code in production stuff. Completeness, stability, and expecially security are not guaranteed.
At time main()
is almost empty. We are working on structures and algorithms.
For the moment, clone the repo and build it with:
cargo build
Run the unit tests:
cargo test --lib --bins
Run unit tests only (fast):
cargo test --lib --bins
Run unit tests and integration tests (slow):
cargo test
Run the node (cli app):
cargo run --bin brn
Feedback are welcome! Please open an issue or PR.
If you want to support this project, you can donate to:
- Rust for being a great language.
- Satoshi Nakamoto for bringing us here.