Skip to content

savarin/readcoin-python

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

66 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

readcoin-python

The Rust version can be found here, blog post here

TL;DR

readcoin is a minimal proof-of-work cryptocurrency based on the Bitcoin protocol.

Context

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.

Installation

Running the code requires installation of two packages.

pip install python-dotenv cryptography

The environment variable NODE_IP needs to be set up as messages are sent via UDP.

echo 'NODE_IP='"$(ipconfig getifaddr en0)" > src/.env

Next respectively run each line in different terminal windows.

python src/node.py 7000
python src/node.py 8000
python src/node.py 9000

About

minimal proof-of-work cryptocurrency based on the Bitcoin protocol - Nov 2021

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages