Examples#

This gallery walks through blockchainkit.wallets, one experiment per breakthrough on the wallets history page: the error-detecting codes behind addresses, from BCH codes and Verhoeff’s check digit to Base58Check, Bech32 and Bech32m; PBKDF2, scrypt and the brain wallets that had neither; hierarchical deterministic keys, mnemonic seed phrases and derivation paths; and shared control of keys, from P2SH multisig and threshold ECDSA to social recovery and ERC-4337.

Each script is self-contained and runs with python examples/wallets/<section>/<script>.py.

Address encodings#

Writing a key’s hash so that a typo is refused rather than paid.

Base58Check addresses (2009)

Base58Check addresses (2009)

Bech32 addresses (BIP173, 2017)

Bech32 addresses (BIP173, 2017)

Bech32m and the insertion flaw in Bech32 (BIP350, 2020)

Bech32m and the insertion flaw in Bech32 (BIP350, 2020)

Error-detecting codes#

Catching the mistakes people make when they copy a number.

BCH error-correcting codes (1959-1960)

BCH error-correcting codes (1959-1960)

Verhoeff’s check digit and detecting transpositions (1969)

Verhoeff's check digit and detecting transpositions (1969)

Shared control#

Removing the single point of failure: multisig, threshold signatures, guardians and smart accounts.

Pay-to-script-hash and multisig (BIP16, 2012)

Pay-to-script-hash and multisig (BIP16, 2012)

Threshold ECDSA (Gennaro and Goldfeder, 2018)

Threshold ECDSA (Gennaro and Goldfeder, 2018)

Social-recovery wallets (2021)

Social-recovery wallets (2021)

Account abstraction with ERC-4337 (2021)

Account abstraction with ERC-4337 (2021)

Key derivation#

One seed, written as words, for a whole tree of keys that every wallet can find again.

Hierarchical deterministic wallets (BIP32, 2012)

Hierarchical deterministic wallets (BIP32, 2012)

Mnemonic seed phrases (BIP39, 2013)

Mnemonic seed phrases (BIP39, 2013)

Multi-account derivation paths (BIP44, 2014)

Multi-account derivation paths (BIP44, 2014)

Key stretching#

Making every guess at a password cost time and memory, and what happens without it.

PBKDF2 key stretching (2000)

PBKDF2 key stretching (2000)

scrypt and memory-hard key derivation (2009)

scrypt and memory-hard key derivation (2009)

The brain-wallet drain (Vasek et al., 2016)

The brain-wallet drain (Vasek et al., 2016)

Gallery generated by Sphinx-Gallery