A minimal but complete blockchain implementation in Python with CLI and optional REST API.
- SHA-256 hashing
- Proof-of-Work mining
- Transaction pool
- Chain validation
- Optional Flask REST API
python blockchain.py cliAvailable commands: add <sender> <recipient> <amount>, mine, chain, validate, quit
pip install -r requirements.txt
python blockchain.py serverEndpoints: GET /chain, POST /transactions/new, GET /mine, GET /validate
- Transactions are submitted to a pending pool
- Mining bundles pending transactions into a new block
- Proof-of-Work requires the block hash to start with
0000 - Each block references the previous block's hash, forming an immutable chain