2. Vadym Hrusha
Architect
blocksoft.biz
• Professional software development experience 10+ years
• Worked on Enterprise sector solutions for 8 years
• Involved in crypto industry since 2013
• Blockchain and network technologies enthusiast
• BlockSoft.biz group lead
2
3. ● General architecture
● Bitcoin cryptography algorithms
● Crypto wallet - functional modules
● Wallet - keys module functions
● Wallets by keys modules types
● Wallets cryptography algorithms
● Types of addresses
● Mnemonic phrase or seed phrase
● PBKDF2
Table of contents
6. ECDSA - Elliptic Curve Digital Signature Algorithm in
secp256k1 specification. Public and private keys are 256bit
SHA2-256 - Secure Hash Algorithm 2. Cryptographic hash
function. Consume any x bit message, return y=256bit
RIPEMD - RACE Integrity Primitives Evaluation Message
Digest. Consume any x bit message, return y=160bit
Base58 - Binary to text encoding. Represents any x bit
message into basic letters view.
Bitcoin cryptography algorithms
7. ● User Interface
● Keys generationmanagement
● Secure storage container
● Communication with node and other services like SPV
● Compilations of transactions
Crypto wallet - functional modules
8. ● Generate entropy
● RestoreBackup entropy
● Generate private keys using entropy
● Extract public keys from private keys
● Convert pub key to correct version of address
Wallet - keys module functions
9. ● Sequential Deterministic Wallet (BIP39)
○ All private keys are cryptographically linked with each other
○ No need to store all private keys, only the master private key
is enough
Wallets by keys modules types
● Basic Wallet
○ Private keys are not connected with each other in any way
○ This approach requires keeping and backuping of each and
every private key
● Hierarchical Deterministic Wallet (BIP32&BIP44)
○ Extended version of a deterministic wallet
○ All private and public keys are cryptographically linked
○ Only master key + chain parameters must be stored
12. 1 address => 1 public key
1 public key => several addresses
Types of addresses
13. P2PKH - pay to public key hash
P2SH - pay to script hash
P2WSH - pay to witness script hash
P2WPKH - pay to witness public key hash
Types of addresses
14. All algorithms used in Bitcoin: ECDSA, SHA2-256, RIPEMD
and Base58
and
PBKDF2 - Password Based Key Derivation Function 2 -
which is based on HMAC SHA2-512
For entropy generation usually OpenSSL is used
Deterministic wallet
cryptography algorithms
16. ● Usually using OpenSSL generating 128, 160, 192, 224 or
256bit of Entropy (ENT) or random
● Concatenate ENT with checksum (CS), ENT||CS
○ where CS is a first x bits of sha256(ENT)
○ where x = ENT/32
● Then split ENT_CS to groups of 11 bits
● 11bits = 211 = 2048 (seed words in dictionary)
Mnemonic phrase or seed phrase