Wallet Cryptography 101 Steve Swing Substratum CTO @sswing
https://coldti.com/ Wallets Cold Storage
https://upload.wikimedia.org/wikipedia/commons/c/c6/ A_paper_printable_Bitcoin_wallet_consisting_of_one_bitcoin_address_for_receiving_and_the_ corresponding_private_key_for_spending.png Wallets Paper
https://mycelium.com/mycelium-entropy.html Wallets Mycelium Entropy
https://www.ledgerwallet.com/images/products/lns/ledger-nano-s-fold-large.png Wallets Ledger Nano S
https://www.ledgerwallet.com/images/products/lwb/ledger-blue-front-back-large.png Wallets LedgerBlue
https://shop.trezor.io/static/img/product/t1.jpg?v=1 https://shop.trezor.io/static/img/product/t1_white2.jpg Wallets Trezor
https://www.keepkey.com/wp-content/uploads/2014/08/12121301/shapeshift-large.jpg Wallets KeepKey
Software Wallets Bisq (Bitcoin Square)
https://en.bitcoin.it/wiki/file:capture-electrum.png Wallets Electrum
Mobile Wallets
Wallets A cryptocurrency wallet does not store coins or tokens like a fiat currency wallet or coin purse Cryptocurrency is stored in transactions or in SmartContracts on the blockchain Wallets are a mechanism to keep track of private and public keys Privacy and secrecy of private keys is critical to avoid loss
More Like Debit Card Just as debit cards are a means to access fiat currency in an electronic account Cryptocurrency wallets provide access to coins and tokens for transactions You must prove you have the private key
Wallets Downsides Paper - at risk for fire, flood, deterioration Brain - at risk due to death or mental incapacitation Software - at risk via unauthorized electronic access Hardware - recovery mnemonic phrase is lost or leaked
Terminology Public & Private Key Pairs Private keys decrypt data or messages encrypted with the corresponding public key Public keys verify signatures made by signing data with the corresponding private key HMAC - Hash-based Message Authentication Code SHA - Secure Hashing Algorithm SHA-1, SHA-2, SHA-3, SHA-256, SHA-384, SHA-512 (bits)
Bitcoin Improvement Proposals (BIP) https://github.com/bitcoin/bips/ BIP0032 - Hierarchical Deterministic Wallets BIP0038 - Passphrase-protected private key BIP0039 - Mnemonic code for generating deterministic keys BIP0044 - Multi-Account Hierarchy for Deterministic Wallets
BIP32 - Hierarchical Deterministic Wallets
BIP39 - Mnemonic Phrase Encodes ENTropy in multiples of 32 bits ENT - 128-256 bits Checksum (CS) = ENT/32 Mnemonic Sentence (MS) = (ENT + CS) / 11 ENT CS ENT+CS MS 128 4 132 12 160 5 165 15 192 6 198 18 224 7 231 21 256 8 264 24 ENT+CS grouped into 11-bit groups encoding a number 0-2047 serving as an index into a wordlist Wordlists: https://github.com/bitcoin/bips/blob/master/ bip-0039/bip-0039-wordlists.md
BIP39 Visualized Mnemonic Phrase (24 words) asset nose alarm toward marriage skull hole shoe drive feel trap joke vicious hollow trumpet case clap bullet bag merge proud cup mimic outside
BIP39 Visualized 256 bits of entropy 0db2cc17730885959b2e33434a9b9d3c2f38d9fa611929c3c44645bacc6b6334 00001101101 10010110011 00000101110 11100110000 10001000010 11001010110 01101100101 11000110011 01000011010 01010100110 11100111010 01111000010 11110011100 01101100111 11101001100 00100011001 00101001110 00011110001 00010001100 10001011011 10101100110 00110101101 10001100110 100 11101100 +8 bits checksum 264 bits
3 nybbles 0db 0000 1101 1011 2cc 0010 1100 1100 177 0001 0111 0111 308 0011 0000 1000 859 1000 0101 1001 59b 0101 1001 1011 2e3 0010 1110 0011 343 0011 0100 0011 4a9 0100 1010 1001 b9d 1011 1001 1101 3c2 0011 1100 0010 f38 1111 0011 1000 d9f 1101 1001 1111 a61 1010 0110 0001 192 0001 1001 0010 9c3 1001 1100 0011 c44 1100 0100 0100 645 0110 0100 0101 bac 1011 1010 1100 c6b 1100 0110 1011 633 0110 0011 0011 4ec 0100 1110 1100 BIP39 Visualized
BIP39 Visualized 12-bits 0000 1101 1011 0010 1100 1100 0001 0111 0111 0011 0000 1000 1000 0101 1001 0101 1001 1011 0010 1110 0011 0011 0100 0011 0100 1010 1001 1011 1001 1101 0011 1100 0010 1111 0011 1000 1101 1001 1111 1010 0110 0001 0001 1001 0010 1001 1100 0011 1100 0100 0100 0110 0100 0101 1011 1010 1100 1100 0110 1011 0110 0011 0011 0100 1110 1100 }22 rows (12 * 22 = 264)
BIP39 Visualized 11-bits 0000 1101 101 1001 0110 011 0000 0101 110 1110 0110 000 1000 1000 010 1100 1010 110 0110 1100 101 1100 0110 011 0100 0011 010 0101 0100 110 1110 0111 010 0111 1000 010 1111 0011 100 0110 1100 111 1110 1001 100 0010 0011 001 0010 1001 110 0001 1110 001 0001 0001 100 1000 1011 011 1010 1100 110 0011 0101 101 1000 1100 110 1001 1101 100 }24 rows (11 * 24 = 264)
BIP39 Visualized 11-bits 00001101101 10010110011 00000101110 11100110000 10001000010 11001010110 01101100101 11000110011 01000011010 01010100110 11100111010 01111000010 11110011100 01101100111 11101001100 00100011001 00101001110 00011110001 00010001100 10001011011 10101100110 00110101101 10001100110 10011101100
BIP39 Visualized 11-bits index 00001101101 109 10010110011 1203 00000101110 46 11100110000 1840 10001000010 1090 11001010110 1622 01101100101 869 11000110011 1587 01000011010 538 01010100110 678 11100111010 1850 01111000010 962 11110011100 1948 01101100111 871 11101001100 1868 00100011001 281 00101001110 334 00011110001 241 00010001100 140 10001011011 1115 10101100110 1382 00110101101 429 10001100110 1126 10011101100 1260
BIP39 Visualized 11-bits index word 00001101101 109 asset 10010110011 1203 nose 00000101110 46 alarm 11100110000 1840 toward 10001000010 1090 marriage 11001010110 1622 skull 01101100101 869 hole 11000110011 1587 shoe 01000011010 538 drive 01010100110 678 feel 11100111010 1850 trap 01111000010 962 joke 11110011100 1948 vicious 01101100111 871 hollow 11101001100 1868 trumpet 00100011001 281 case 00101001110 334 clap 00011110001 241 bullet 00010001100 140 bag 10001011011 1115 merge 10101100110 1382 proud 00110101101 429 cup 10001100110 1126 mimic 10011101100 1260 outside
BIP44 - Multi-Account Hierarchy for Deterministic Wallets Defines 5 levels in BIP32 Path m / purpose' / coin_type' / account' / change / address_index ' (prime) indicates a hardened derivation path (0x80000000) purpose e.g. 44 (0x8000002C) coin type e.g. ETH = 60' (see https://github.com/satoshilabs/slips/ blob/master/slip-0044.md for full list) note 60 (0x8000003C) account from 0 to n (hardened) 2 31-2 32-1 (0x80000000-0xFFFFFFFF) change 0 = external, 1 = internal (applies to BTC et. al.) address index from 0 to k (k = 2 31-1) (0x00000000-0x7FFFFFFF)
MyEtherWallet
MyEtherWallet
MyEtherWallet Purpose
MyEtherWallet Coin Type
MyEtherWallet Account
MetaMask
Wallet Safety Internet Safety Applies Extreme care of password hygiene, privacy, and security Unique passwords MFA or 2FA Social engineering exploits, Phishing, Scams, Nefarious trickery and chicanery
Wallet Safety Keep software up-to-date OS Browser Security patches Shared access with family and friends
Wallet Safety Keep your mnemonic recovery phrase secret Don't photograph your mnemonic recovery phrase Store your mnemonic recovery phrase carefully Fade proof ink Waterproof Fireproof Insect proof Test your mnemonic recovery phrase
Offline Usage Airgapped Hardware USB/Flash/Memory card storage Docker Image Virtual machine Electron App Local stand-alone html pages
Offline Examples Docker: MyEtherWallet Electron: BIP39 Page
Diversification Multiple hardware wallets Multiple hardware wallet initializations Maintain assets on several different wallet types
Considerations Survivor access Leave instructions in safe deposit box On file with estate attorney Keep access instructions up to date when things change
Questions @sswing https://github.com/steveswing Ohio Linux Fest 2pm Saturday 10/13/2018 https://substratum.net @SubstratumNet https://youtube.com/substratumnetwork