cryptos
Pure Python from-scratch zero-dependency implementation of Bitcoin
...It deliberately avoids external dependencies so readers can inspect how the underlying cryptography and protocol mechanics work. The project implements SHA-256, finite-field elliptic-curve mathematics, Bitcoin key generation, addresses, and ECDSA digital signatures. It can parse and inspect legacy and SegWit transaction structures, although its transaction validation is intentionally incomplete compared with a full Bitcoin node. Block utilities cover headers, proof-of-work validation, and difficulty calculations. A lightweight network client can connect to Bitcoin peers, perform the protocol handshake, and request block headers. ...