A blockchain in pure Python, zero dependencies
A whole blockchain โ keys, UTXO, proof-of-work, and a P2P network โ in readable, dependency-free Python.
Most "build a blockchain in Python" tutorials stop at a linked list of hashes. LarzChain is the real thing, built from first principles and zero dependencies โ you can read the whole thing.
What's in it
- Cryptography โ pure-Python secp256k1 ECDSA (RFC-6979), base58check addresses, no
coincurveor OpenSSL binding. - Transactions โ a UTXO model, like Bitcoin.
- Blocks & consensus โ SHA-256d proof-of-work, difficulty retargeting, most-work chain with reorgs.
- A node โ an HTTP/JSON peer-to-peer network with handshake, gossip and sync.
- Even a Postgres-free everything โ the whole stack is the standard library.
It's the same zero-dependency ethos as the Larz framework. Read how it works, or clone it and step through the code.
git clone https://github.com/larz-scripter/larzchain
cd larzchain
python3 -m larzchain wallet-new # make an address
python3 -m larzchain node --mine # run + mine on the testnetFAQ
Yes โ the cryptography, the node, the networking, everything is the Python standard library. There is nothing to pip install.
That's a great use. It's small, readable and open source (MIT), and it implements the real mechanisms โ keys, UTXO, proof-of-work, and peer-to-peer consensus.
No โ it's correct but slow, which is fine for a testnet. A native fast-path (coincurve) is a possible optional add later.