**CRYPTOGRAPHY CONCEPTS.** This an article explaining some main concepts in Ethereum's cryptograhy. I'll be breaking down the concepts so a lay man could understand. **1. What is the difference between encryption and cryptography?** Encryption involves hiding so only intended recipient can read it.Encryption is like a sub section of cryptography. WHILE Cryptography is the whole technology used to to prove knowledge of a secret without revealing that secret (e.g., with a digital signature) or to prove the authenticity of data (e.g., with digital fingerprints, also known as hashes).It is the whole science of secret communication. **2.What makes a hash function cryptographically secure?** This five properties make it secure: i. It is deterministic, that is same inputs always gives same output. ii. It only happens in one way.That means a hash function cannot be reversed. iii. Collision Resistant. That is two different inputs should NEVER produce same output "Dog" and "Cat" should NEVER both hash to "abc123" iv. Fixed output size. No matter how long the input is th output size would be the same length. **3. How SHA-256 is used in Bitcoin's proof of work?** This process involves the following steps: i. Miners take the block header, which includes the hash of the previous block, a timestamp, the Merkle root of transactions, and the nonce. ii. They apply double SHA-256 hashing—the block header is hashed once with SHA-256, and the result is hashed again. iii. The goal is to find a hash output that is less than or equal to the current network difficulty target, which is adjusted every 2016 blocks (approximately every two weeks) to maintain an average block time of 10 minutes. iv. Since the hash output is unpredictable and changes dramatically with even a single-bit input change (due to the avalanche effect), miners must use brute-force trial and error, incrementing the nonce millions of times per second. v. The first miner to find a valid hash broadcasts the block to the network. Other nodes verify the solution quickly—easy to verify, hard to compute—ensuring network consensus and security. This mechanism prevents tampering, double-spending, and network attacks, as altering any past block would require re-mining all subsequent blocks **4. How Ethereum Uses Keccak-256 (SHA-3)?** Keccak-256 is the cryptographic hash function used by Ethereum, serving as the foundation for its security, data integrity, and core operations. 1. Block Hashing 2. Transaction Hashing 3. Address Generation 4. Merkle Patricia Tries 5. Smart Contract Execution (EVM) 6. Event Logs 7. Proof-of-Work Ethereum uses Keccak-256 to hash blocks, transactions, addresses, state, and smart contract data, ensuring integrity, immutability, and efficient verification across the entire protocol. **5. Difference between symmetric and asymmetric encryption.** ** Symmetric encryption uses a single shared key for both encryption and decryption, making it fast and efficient for large-scale data protection like file encryption, databases, and full-disk encryption. WHILE Asymmetric encryption, also known as public-key cryptography, uses a pair of mathematically related keys: a public key for encryption and a private key for decryption. This eliminates the need to securely share a secret key, enhancing security for key exchange, digital signatures, and authentication. **6. How public/private key pairs work (focus on ECDSA used in Ethereum and Bitcoin)?** The private keys are at the heart of all user Interactions woth Ethereum. The private keys are like a physical key that you should never share and the public key is like an open padlock you could share with everyone. How they are generated: Step 1: Generate a random 256-bit number This is your PRIVATE KEY Step 2: Do special math on it (elliptic curve) This gives you your PUBLIC KEY Step 3: Hash the public key Take last 20 bytes = Your ADDRESS The public key can be derived from the private key and never vice-versa. **7. How Digital Signatures Verify Transaction Authenticity?** i. Hash Creation: A unique cryptographic hash (fingerprint) of the transaction data is generated using a secure algorithm like SHA-256. Any change to the transaction alters the hash completely. ii. Signing: The sender encrypts this hash with their private key, creating the digital signature. Only the sender’s private key can produce this signature, proving ownership. iii.Mathematical Verification: The recipient uses the sender’s public key to decrypt the signature and retrieve the original hash. They independently compute a new hash from the received transaction. iv. Comparison: If the decrypted hash matches the newly computed hash, the transaction is confirmed to be unaltered and authentic, proving it came from the rightful signer **8. What are Merkle Trees and there structure?** In cryptography and computer science, a hash tree or Merkle tree is a tree in which every "leaf" node is labelled with the cryptographic hash of a data block, and every node that is not a leaf (called a branch, inner node, or inode) is labelled with the cryptographic hash of the labels of its child nodes. Merkle Tree Structure is a hierarchical data structure used in cryptography and computer science to efficiently verify the integrity of large datasets. It is built using cryptographic hash functions, where: Leaf nodes are hashes of individual data blocks (e.g., transactions in a blockchain). Non-leaf (internal) nodes are hashes of their child nodes, created by concatenating and hashing the values of the children. The root node, known as the Merkle root, is the hash of the entire dataset and acts as a unique fingerprint for all data in the tree. **9. How Merkle Roots Provide Data Integrity in Blocks?** A Merkle root is a single hash that cryptographically summarizes all transactions in a block. That root acts like a fingerprint for the entire transaction set. **Merkle roots provide data integrity by** ** cryptographically committing an entire set of transactions into a single hash, making any tampering immediately detectable while enabling efficient, trust-minimized verification.** 1. Tamper Detection Because the Merkle root is stored in the block header, and the block header is itself hashed and linked to the next block, any modification breaks the chain instantly. 2. Efficient Verification (Merkle Proofs) 3. Compact Storage **10. Why Merkle Trees Are Efficient (Merkle Proofs)?** Merkle Trees are efficient because they enable cryptographic verification of data inclusion in a large dataset using a minimal amount of information. i.Logarithmic Proof Size ii. Compact Proofs iii. Space and Computation Efficiency iv.Trustless Verification: v. Scalability and Security In short, Merkle Trees provide efficient, secure, and scalable data verification, making them foundational to blockchain systems like Bitcoin and Ethereum. **11. How does the Merkle Tree use hashing to secure the blockchain? ** Merkle Trees use cryptographic hashing to secure blockchain by creating a hierarchical structure that ensures data integrity and enables efficient verification. i. Hashing Process: Each transaction in a block is first hashed individually to form leaf nodes. These hashes are then paired and re-hashed to create parent nodes, repeating this process until only one hash remains—the Merkle root. ii. Data Integrity: Any change to a single transaction alters its hash, which cascades up the tree, changing the Merkle root. This makes tampering immediately detectable. iii. Efficient Verification: Nodes can verify a transaction’s inclusion in a block using only the Merkle root and a small set of sibling hashes (a Merkle proof), requiring minimal data and computation. iv. Security Features: The use of collision-resistant hash functions like SHA-256 ensures that identical hashes from different inputs are computationally infeasible, protecting against data substitution. v. Blockchain Integration: The Merkle root is stored in the block header, linking blocks together and serving as a cryptographic fingerprint of all transactions in the block. **12. If I have your public key, can I find your private key? Why or why not?** NO you can't find my private key if you have my public key. Why? Public-key cryptography is built on one-way mathematical functions. In Ethereum (and most blockchains), keys use elliptic curve cryptography. If you try to get a private key from a public key it gives you the Discrete Logarithm Problem. No computer in existence can solve this for a 256-bit key. **13. The difference between zk-SNARKs and zk-STARKs.** zk-SNARKs and zk-STARKs are both zero-knowledge proof systems used to verify computations without revealing underlying data, but they differ significantly in design, security, and performance. i. Trusted Setup zk-SNARKs: Require a trusted setup involving a Common Reference String (CRS). If the setup secrets are not destroyed, malicious actors could forge proofs. zk-STARKs: Do not require a trusted setup, using publicly verifiable randomness instead, enhancing transparency and security. ii. Proof Size and Verification zk-SNARKs: Generate smaller proofs and verify faster, making them ideal for applications where bandwidth and speed are critical (e.g., privacy coins like Zcash). zk-STARKs: Produce larger proofs and have slower verification times, though they scale better with complex computations. iii.Scalability zk-SNARKs: Verification time grows linearly with input size. zk-STARKs: Exhibit high scalability, with verification efficiency improving significantly for large or complex computations. iv. Quantum Resistance zk-SNARKs: Based on elliptic curve cryptography (ECC), which is not quantum-resistant. zk-STARKs: Use hash functions, making them resistant to quantum attacks. v. Transparency zk-SNARKs: Less transparent due to reliance on a trusted setup. zk-STARKs: More transparent—anyone can verify the proof generation process without trusting a third party. vi. Use Cases zk-SNARKs: Best for systems where proof size and speed are key (e.g., DeFi, privacy-preserving transactions). zk-STARKs: Preferred where transparency, scalability, and quantum resistance are priorities (e.g., Starknet, zkPorter, supply chain verification). In summary, zk-SNARKs offer efficiency and compactness, while zk-STARKs prioritize security, transparency, and scalability—making the choice dependent on specific application needs. **Conclusion** Cryptography is the invisible backbone of everything Ethereum does. From the moment you create a wallet to the moment a transaction is confirmed on-chain, every step is protected by the mathematical concepts covered in this material.