Blockchain Cryptographic Principles Questions and Answers — Questions and Answers
Question 1: In public-key cryptography, what is the specific role of the sender's private key and the receiver's public key when creating a digital signature for a blockchain transaction?
- The sender's private key encrypts the message, and the receiver's public key decrypts it.
- The sender's private key signs a hash of the transaction, and the receiver's public key verifies the signature. (Correct answer)
- The sender's private key generates the transaction hash, and the receiver's public key adds it to the block.
- The sender's private key encrypts the entire block, and the receiver's public key confirms the transaction.
Correct answer: The sender's private key signs a hash of the transaction, and the receiver's public key verifies the signature.
A digital signature is created by taking a hash of the transaction data and then encrypting that hash with the sender's private key. This proves the sender authorized the transaction. Anyone can then use the sender's public key to decrypt the signed hash and compare it to a new hash of the transaction data to verify its authenticity and integrity.
Question 2: A developer is building a lightweight mobile wallet that needs to verify if a specific transaction is included in a block without downloading the entire blockchain. Which cryptographic structure is essential for enabling this functionality, often referred to as Simplified Payment Verification (SPV)?
- Public Key Infrastructure (PKI)
- Ring Signature
- Merkle Tree (Correct answer)
- Symmetric Key Algorithm
Correct answer: Merkle Tree
Merkle trees allow for efficient verification of data. In a blockchain, all transactions in a block are organized into a Merkle tree, and the Merkle root is stored in the block header. A lightweight client can verify a transaction by requesting a 'Merkle proof,' which consists of the transaction's hash and the branch of hashes connecting it to the root, without needing all transactions in the block.
Question 3: Why is Elliptic Curve Cryptography (ECC) widely preferred over RSA for generating key pairs in most modern blockchain protocols like Bitcoin and Ethereum?
- ECC keys are easier for humans to remember and transcribe.
- ECC provides a greater level of security with significantly smaller key sizes, leading to better efficiency. (Correct answer)
- RSA is a symmetric algorithm, whereas blockchain requires asymmetric cryptography.
- ECC allows for the recovery of lost private keys, while RSA does not.
Correct answer: ECC provides a greater level of security with significantly smaller key sizes, leading to better efficiency.
The primary advantage of Elliptic Curve Cryptography (ECC) is that it offers the same level of security as older algorithms like RSA but with much smaller key sizes. For example, a 256-bit ECC key provides comparable security to a 3072-bit RSA key. This efficiency is crucial for blockchain, as it reduces storage and bandwidth requirements, making the system faster and more scalable.
Question 4: In a Proof-of-Work (PoW) blockchain like Bitcoin, what is the primary function of a 'nonce'?
- It is a user's secret password for accessing their wallet.
- It represents the total number of transactions within a block.
- It is the public key of the miner who successfully solves the block.
- It is an arbitrary number that miners repeatedly change to find a valid block hash. (Correct answer)
Correct answer: It is an arbitrary number that miners repeatedly change to find a valid block hash.
A nonce (number used once) is a variable field in the block header that miners continuously change. By altering the nonce, they generate a new hash for the block header on each attempt. The goal is to find a nonce that results in a hash value below the network's current difficulty target, thus solving the cryptographic puzzle and winning the right to add the block to the chain.
Question 5: Which of the following is NOT a core property of a cryptographic hash function used in blockchain?
- Pre-image resistance (one-way)
- Deterministic output
- Reversibility (two-way) (Correct answer)
- Collision resistance
Correct answer: Reversibility (two-way)
Cryptographic hash functions are designed to be one-way, meaning it is computationally infeasible to reverse the function and determine the original input from the output hash (pre-image resistance). Reversibility would defeat the purpose of using hashes for security and data integrity, as it would allow anyone to uncover the original data. The other options—deterministic output (same input always produces the same output), and collision resistance (hard to find two inputs that produce the same output)—are essential properties.
Question 6: A user wants to send an encrypted message to another user on a blockchain-based platform. The sender uses the receiver's public key to encrypt the message. Which key must the receiver use to decrypt the message?
- The sender's public key
- The sender's private key
- The receiver's private key (Correct answer)
- A shared symmetric key
Correct answer: The receiver's private key
This scenario describes asymmetric encryption, also known as public-key cryptography. Data encrypted with a public key can only be decrypted by the corresponding private key. Therefore, the receiver must use their own secret private key to decrypt the message that was encrypted with their publicly available key.
In public-key cryptography, what is the specific role of the sender's private key and the receiver's public key when creating a digital signature for a blockchain transaction?