Job Interview
Do You Want to Work in Web3 - "Part 2"
In this article, we continue reviewing the basic concepts you must know before attending an interview for a position in Web3.
Cryptography
What is a hash collision?
A hash collision occurs when two different inputs generate the same hash.
What is symmetric key encryption?
Symmetric key encryption, also called private key cryptography, uses the same key to encrypt and decrypt messages.
What is asymmetric key encryption?
Asymmetric key encryption, also known as public key cryptography, uses two separate keys to encrypt and decrypt messages. First, a private key is randomly generated. Using a mathematical formula, the public key can be created from the private key. The public key can be shared with everyone, while the private key must be kept secret. Data is encrypted using one of the keys and decrypted with the other. Unlike symmetric encryption, only the encrypted data (not the key itself) must be transferred, making it more secure against man-in-the-middle attacks.
What is a Merkle tree?
A Merkle tree is a data structure used to efficiently summarize and verify large sets of data. A Merkle tree consists of the Merkle root, which is the root hash. The Merkle root is placed in the block header. In a Merkle tree, transaction hashes are considered the leaves. Each non-leaf node (branch) is a hash of the hashes of its child nodes.
Why are Merkle trees so important in BTC?
Without Merkle trees, each node in the network would have to maintain a complete copy of every transaction that has occurred in Bitcoin.
Explain the term “zero knowledge proof”.
It is a cryptographic method that allows one party to prove knowledge of certain information to another party without revealing the data in question.
Attacks
What is a 51% attack?
If a hacker manages to control 51% or more of the nodes, they will gain control over the entire network.
What is a reentrancy attack?
A reentrancy attack occurs when a function makes an external call to an untrusted contract. The untrusted contract then makes a recursive call back to the original function in an attempt to drain funds.
Name two ways to prevent reentrancy attacks.
• Implement the pattern of “checks-effects-interactions” (update the state before making external calls).
• Use a reentrancy guard (e.g., an OpenZeppelin modifier).
What is a replay attack?
A replay attack involves taking a transaction on one blockchain and maliciously or fraudulently repeating it on another blockchain. Two post-fork blockchains are vulnerable to this type of attack. For a replay attack to work, the two chains must share a common history.
How can a blockchain prevent replay attacks?
To prevent replay attacks, developers on one of the two post-fork blockchains can make a small change in the transaction rules. Ethereum prevents replay attacks on the same chain by using a transaction counter in each account. This nonce also prevents double spending.
If you liked this info, leave a comment!
To be continued...
Comments