2019-11-09
Ethereum Blockchain Quiz - 5 Questions You Should Know (Hard!)
Do you really know Ethereum well? Today I got 5 questions every Ethereum Blockchain Developer should know. Some are super easy, some are quite hard, none of them should feel unfamiliar.
Watch the video, you might learn something new today!!!
Link to YouTube Ethereum Blockchain Quiz Questions Comment below the YouTube Video if you got them all right or which one’s new to you – don’t cheat 😊
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 from metamask.io is a browser plugin. It makes interaction with the blockchain extremely easy and it can sign transactions with a private key, no matter on which network or blockchain node you are connected to. This means, it does not have to connect to Infura, it can connect with any blockchain via RPC. Answer B is out of the way. To sign transactions, you need a private key from somewhere and, in essence, yes, it generates and stores private keys, so A is the correct answer. Before MetaMask was invented, onboarding to Ethereum was pretty time consuming. Getting access to an Ethereum client via a RESTful API isn’t always so straight forward and fundamentally changed the way users start interacting with the blockchain. The earliest commit was 2015, it’s extremely well maintained and active and I can recommend it. Competitors, in terms of ease of use, might be Fortmatic and https://www.portis.io/
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
Did you think A? I always think A, because Ether is before Tether. But let’s see… Like Bitcoin, Ether is not the smallest unit on the Ethereum blockchain. The smallest unit is Wei, followed by Kwei, Mwei, Gwei, Szabo, Finney and Ether, so the correct answer is C. My favorite tool to get a great overview isn’t so much the Ethereum documentation it’s more the etherconverter which I found a fun tool to play around quickly. I hope you didn’t think it’s B? :)
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
In general, a nonce is usually a number that can only be used once. In this case it’s specifically against replay attacks, so answer A is the correct answer. Every time you send a transaction from an account on Ethereum, the nonce is increased starting at 0. So the first transcation would have the nonce 0, the second 1, the third transaction 2, and so on. You can’t skip any number. And since the network is public and every node has access to the same information it’s obviously easy to check that neither a number was used twice or skipped.
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
I couldn’t say it any better than the Solidity documentation itself: “Since the type of the result of an operation is always the type of one of the operands, division on integers always results in an integer. In Solidity, division rounds towards zero. This mean that int256(-5) / int256(2) == int256(-2).” In this case it would be -2. So A is the correct answer.
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
Appendix F. Signing Transactions of the Ethereum Yellow paper can help us out here. We can follow along how Addresses are generated. First, it’s assumed that a sender has a private key which is 32 bytes long. That means answer B is already incorrect, since we’re talking about bytes not characters. Leaves A or C. Furthermore, if we run ECSDAPUBKEY we get a 64 bytes long key, also called a public key. Which means answer A is correct. Now, the address are the rightmost 160-bits of the Keccack-hash of the public key. In other words, the last 40 hex characters of the hash, or the right 20 bytes, since 1 byte is 8 bit, 160 bits are 20 bytes. But that’s another story.
Comment below the YouTube Video and let me know if you got them all right.
If you like more like this, subscribe to my newsletter and to my YouTube Channel.