Simple, educational blockchain implementation in Rust
ππ‘ Learn the basics of blockchain and P2P networking!
- β‘οΈ Peer-to-peer networking
- βοΈ Simple blockchain logic
- ποΈ Block creation (mining)
- π‘ Block broadcasting
- π¦ Written in Rust
RUST_LOG=info cargo runThis starts a local blockchain client.
Note: The blockchain is not persisted (in-memory only).
You can open multiple terminals to run several connected P2P clients.
| Command | Description |
|---|---|
ls p |
π₯ List connected peers |
ls c |
π Print the local blockchain |
create b $data |
βοΈ Mine a new block with $data and broadcast |
- When a block is created, it is broadcast to all peers. π¨
- Each node updates its blockchain if the new block is valid. π
- On startup, a node requests the blockchain from peers and adopts the longest valid chain. π
This project is for educational purposes only!
- π§ͺ Overly simplified, offline, inefficient, and insecure
- β Not suitable for production
- π οΈ Great for learning and experimenting
Have fun and happy hacking! ππ¦