Examples#

Runnable experiments for every subpackage, built from the scripts under examples/<name>/. Each one includes assertions, a figure, a “What to look for” guide, and an exercise. Download any of them as a Python script or a Jupyter notebook, or run it in the browser with JupyterLite. The guided A guided course: from fingerprints to shared history gives a learning order across subpackages.

Cryptography

blockchainkit.crypto

Hashing and commitments, Diffie-Hellman and RSA, blind signatures, secret sharing, elliptic curves, and Schnorr proofs and signatures.

Examples

Ledgers

blockchainkit.structures

Merkle trees and proofs, signed transfers, blocks, ledger state, and cumulative-work fork selection.

Examples

Agreement

blockchainkit.consensus

Proof-of-work search and its expected cost, catch-up probabilities, and stake-weighted proposer selection.

Examples
blockchainkit.network

Peer graphs, logical clocks, gossip and reliable broadcast, Kademlia and its attacks, block relay, forks, and transaction privacy.

Examples

Execution

blockchainkit.vm

A deterministic 256-bit stack machine with gas and atomic failure, Turing machines, Bitcoin Script, and smart contracts and their attacks.

Examples