Ethereum Mastery Flashcards
A fundamental understanding of the ethereum blockchain from first principles. You will gain the rudimentary knowledge needed to build a solid foundation as a blockchain engineer.
What is mining ?
The process of creating a block of transactions to be added to a proof of work blockchain
What are the purposes of mining ?
- To enforce consensus rules
- Currency issuance as a reward to incetivize those who secure the system
What is a consensus mechanism ?
A set of rules that determine how nodes on the blockchain network, come to agree on the final state of the blockchain.
How is the target difficulty determined in a proof of work blockchain ?
The target difficulty is determined by how fast the network is able to produce blocks. The specification determined by the bitcoin standard is 2016 blocks every 2 weeks. If it takes lesser that the 2week period to produce 2016 blocks, it means the difficulty is low and hence is adjusted to a much higher value. The converse is also true.
Briefly describe the mining algorithm
Miners run an automated software that solves some computational difficult problem. The algorith is as follows:
- Get the previous block header and new transactions that should be added to the blockchain
- Append a nonce counter starting from zero to the data above
- Hash the data and compare the hash to the target difficulty
- If the hash is less than the target difficulty, submit the new block
- Else repeat steps 2 incrementing the nonce at each unsuccessful step
What is proof of work ?
It is the mechanism used to ensure security of a blockchain network, by ensuring that miners provide some proof that they expended energy to secure the network mostly, against forgery. This proof is in form of a cryptographic hash, which should be lesser than or equal to some target hash. The proof gurantees that a new block is secure and can be safely added to the blockchain.
What’s the formula or calculating the target in bitcoin ?
Since the target is represented in a field called bits
as packed hexadecimal, the formula to get the full target is thus
target = coefficient * 2^(8 * (index - 3))
What is Byzantine fault tolerance ?
The ability of a decentralized network to continue operating even if some of its nodes fail or act maliciously.
What is a block chain confirmation ?
A confirmation is the process of adding a valid block to the blockchain. For a transaction to be regarded a immutable (tamper proof) it should have additional blocks linked to it. These additional blocks gurantee that the transaction cannot be reversed. Each of these successfully mined blocks counts as a confirmation.
Eg Bitcoin network has a recommended confirmation of 6 which means 6 blocks taking an average time of 1hr. Since a new block is mined every 10mins
What does UTXO stand for ?
Unspent Transaction Output, it is the model used by bitcoin to keep track of user balances. UTXO’s are like denominations in a legal tender. You could have N number of bills of different denominations with a combined value of Y. Similarly you cant have X number of UTXO’s with a combined BTC value of Z.
Each UTXO has its own value in BTC
What is the coinbase param in the bitcoin block ?
It is the content of the input for a generation transaction (genesis block)
What is a Binary Search Tree
?
It’s a binary tree with the following properties
1. The keys of nodes to the left of a node are lesser than its key
2. The keys of nodes to the right of a node a greater than its key
3. The left and right subtrees of each node are themselves BSTs
What is a Merkle Tree ?
Also called a hash tree is a binary tree with the following properties;
1. Every leaf node store the hash of some data
2. Every node that is not a leaf, store the hash of its child nodes
The merkle tree provides a way to do efficient verification of data
Why are Merkle Trees useful ?
The allow for efficient verification of data, ie finding if some item belongs in a large dataset.
What is a Merkle root ?
Blockchain !
Its the hash derived from the hash of a set of transactions in a block
What is the Merkle path ?
It is the information required by a user to generate the expected root hash, from the hash of their transaction in a block.
What is a Merkle proof ?
A Merkle proof verifies the existence of a transaction in a specified block, without the need to examine all the transactions in the block.
What is a trie ?
A type of search tree that is used for locating specific keys in a set, keys are usually strings
What is a Radix trie (Patricia Trie) ?
A space-optimized
trie where every node that is an only child is merged with its parent. The effect is that every internal node has a most r
children, where r
is the radix of the trie.
What is a Patricia merkle trie ?
A cryptographically secure datastructure that can be used to store key value bindings. It combines the properties of Merkle trees and patricia tries.
What does Patricia stand for ?
Practical algorithm to retrieve information coded in alphanumeric
What 3 properties are of importance to the etherum in the block header ?
- state root
- transaction root
- receipts root
Where is the state root
derived from and what is it’s function ?
The state root is derived from the keccack-256 bit hash of the root of the state trie
. The state trie stores a mapping of addresses to account state (balance, nonce, codeHash etc)