The Rust version can be found here, blog post here
readcoin is a minimal proof-of-work cryptocurrency based on the Bitcoin protocol.
The latest version implements mining, header validation (block hashes form a chain and satisfy proof-of-work) and transaction validation (sender has not been spent token and signature is valid). For simplicity, difficulty is set at a constant and each token is indivisible.
We implement the Bitcoin protocol through multiple iterations:
- v1 - starting point of mining and header validation only, each block as a bytestring.
- v2 - include blockchain class implementation with encode/decode semantics.
- v3 - include Merkle tree and transaction validation.
- v4 - include balances and full block validation.
- v5 - include elliptic curve signature and verification.
The term readcoin refers to a blog by the author on readcoin.com (no longer operational). The first article can be found here. A blog post series with step-by-step discussion of the implementation is currently in progress; posts published so far are here.
Running the code requires installation of two packages.
pip install python-dotenv cryptographyThe environment variable NODE_IP needs to be set up as messages are sent via UDP.
echo 'NODE_IP='"$(ipconfig getifaddr en0)" > src/.envNext respectively run each line in different terminal windows.
python src/node.py 7000
python src/node.py 8000
python src/node.py 9000