Are You an Ethereum Developer for Real? Answer These 5 Questions!

Hello friends! I received a reddit notification a few days ago from the r/ethdev subreddit. The reddit post was titled “Ethereum Blockchain Quiz – 5 Questions Every Blockchain Developer Should Be Able To Answer“.

Immediately I thought: damn! I need to answer these 5 questions! So I clicked, and enjoyed the quiz made by mr. VomTom.

I will link you to the original post&video at the end of the article, so you can have a chance to answer them by yourself too before checking the answers.

Don’t scroll the page down too fast or you’ll see the solutions before being able to answer everything. Let’s start!

Questions:

1. What’s MetaMask used for exactly?

A) A Browser plugin that generates and stores private keys
B) A browser plugin that must interact with Infura to sign transactions
C) A browser plugin that connects to Infura to mainly show your account balance

2. Which is the right order for Denominations on the Ethereum Blockchain?

A) Wei, Finney, Szabo, Ether, Tether
B) Finney, Szabo, Mether, Gwei
C) Gwei, Szabo, Finney, Ether

3. What is the nonce field used for in a transaction?

A) It’s a numerical field to protect against replay attacks
B) It’s a checksum of the hash of the previous block to verify the transaction order
C) It’s a sum of all ethers sent from the address

4. In Solidity, if you divide integer -5 by integer 2, the result is

A) -2, because the decimal is truncated (rounded to zero)
B) -3, because it’s always rounded
C) -2.5, because it’s automatically converted or casted into a float
D) It’s not possible, since Solidity only knows unsigned integers

5. Ethereum Addresses vs public keys vs private keys:

A) An address is 20 bytes long, a public key 64 bytes and the private key 32 bytes
B) An address is 20 characters long, a public key 32 characters long and a private key 64 characters long
C) There is no public key, the public key is the address, both are 20 bytes, the private key 32 bytes long

Allright, done? Let me know explain the answers, then I’ll let you enjoy the original content made by VomTom!

Answers

1. What’s MetaMask used for exactly?

A) A Browser plugin that generates and stores private keys
B) A browser plugin that must interact with Infura to sign transactions
C) A browser plugin that connects to Infura to mainly show your account balance

MetaMask is a wallet that lives as a browser extension and allows you to receive and send ETH/tokens to other wallets, while Infura is just the ethereum provider and remote service that powers MetaMask behind the scenes. So for these reasons it is trivial to eliminate B and C, and confirm answer A.

Easy question, but a good way to reinforce the concept that in the blockchain world a wallet is basically a software that manages your cryptographic keys, which ultimately give you control over receiving/sending funds.

2. Which is the right order for Denominations on the Ethereum Blockchain?

A) Wei, Finney, Szabo, Ether, Tether
B) Finney, Szabo, Mether, Gwei
C) Gwei, Szabo, Finney, Ether

What the hell is a Mether? Somebody that HODLs ethereum and does meth at the same time? Well for sure is not an ethereum related word, so I can cross out out answer B. Also answer A has to be eliminated because Tether is another cryptocurrency, which is completely unrelated with ethereum.

This questions is a reminder for everyone: know your ethereum denominations! How? Google it, or check out this awesome site.

3. What is the nonce field used for in a transaction?

A) It’s a numerical field to protect against replay attacks
B) It’s a checksum of the hash of the previous block to verify the transaction order
C) It’s a sum of all ethers sent from the address

Here you have to know what a nonce is, or else they all might make sense. I mentioned the nonce element in one of my previous articles (anatomy of an ethereum transaction), here’s the exact point in the video where I super quickly talk about it: https://youtu.be/u9dR66TdVGA?t=175.

So the nonce is a protection mechanism against replay attacks. Replay attacks are bad, they can cause financial losses for users and more importantly can cause big trust issue in the ecosystem. These attacks happen when somebody takes a transaction in one blockchain, and maliciously replays it on another blockchain, and keeps doing it to potentially drain the original sender account’s balance.

For example I can take a testnet ethereum transaction, and replay it on the mainnet to fraudulently obtain real funds. The nonce was implemented so that every account can “count” the transactions sent, and prevent this type of problem.

Do not confuse it with the Proof-of-Work nonce which is just random meaningless value that is adjusted to satisfy the PoW task of a soon-to-be-mined block.

4. In Solidity, if you divide integer -5 by integer 2, the result is

A) -2, because the decimal is truncated (rounded to zero)
B) -3, because it’s always rounded
C) -2.5, because it’s automatically converted or casted into a float
D) It’s not possible, since Solidity only knows unsigned integers

This one needs a bit of thinkings.. so… Let’s think!

Usually in static-typed languages like Java when you perform an operation between two variables of the same type you get a result of the same type. So for this reason I would say C) is crossed out. D) is also crossed out because signed integers are supported in solidity, they are declared with int.

The answer is definitely A) or B). I’m very undecided at this point because since (-5)/2 = -2.5 the result has to be -3 or -2, therefore rounded up or rounded down. What does solidity do with the rounding? Let’s ask uncle Google!

I searched for “solidity division rounding” and it pointed me immediately to the docs, a page search for “division and bang!

So now we know the answer is A). Moral of the story here? Always read the manual.

via GIPHY

5. Ethereum Addresses vs public keys vs private keys:

A) An address is 20 bytes long, a public key 64 bytes and the private key 32 bytes
B) An address is 20 characters long, a public key 32 characters long and a private key 64 characters long
C) There is no public key, the public key is the address, both are 20 bytes, the private key 32 bytes long

Here I rule out C) immediately because the public key and the address are two different things, the public key is usually longer because is part of a cryptographically strong (and therefore long) keypair. The address is what people use for transactions, so it needs to be a smaller string for convenience. Also remember:

Private Key --> Public Key --> Address. For one private key you deterministically get one address.

Let’s pick the final answer, which is A) because just by quickly checking the documentation you see that the the private key is a byte array of size 32 and the public key is a byte array of size 64.

Original Article

As mentioned before, I took the idea from this article: https://vomtom.at/ethereum-blockchain-quiz/ .

I strongly suggest you to watch the original video by VomTom (also embedded below), and to check out his website at vomtom.at ! He’s also an engineer and has 20+ years of experience in the field, so make sure you check out his content and subscribe to his channel.

the original video