Cryptography
Science of data encryption — foundation of all blockchain security.
Cryptography is the mathematical science of protecting information through encryption — the foundation upon which the entire crypto ecosystem rests.
Types of cryptography in blockchain:
1. Hashing (SHA-256) • One-way function — you can't reverse a hash • Bitcoin uses SHA-256 for mining and addresses • Ethash (Ethereum PoW), Keccak-256 (Ethereum addresses)
2. Asymmetric cryptography (PKI) • Public key: can be shared with everyone • Private key: kept only by you • Transaction signed with private key, verified with public
3. Elliptic curve cryptography (ECDSA) • Bitcoin and Ethereum use secp256k1 curve • Schnorr signatures (Taproot) — more efficient alternative
4. Zero-Knowledge proofs • Prove knowledge without revealing it • zk-SNARKs, zk-STARKs
Hash function properties: