Ethereum Flashcards
What are Proof-of-work and proof-of-stake
- Not consensus protocols
- They are actually Sybil resistance mechanisms and block author selectors; they are a way to decide who is the author of the latest block.
What is Sybil resistance and sybil attack
Sybil attacks are when one user or group pretends to be many users.
What is Ommer block
- Ommer blocks were valid blocks created by a miner practically at the same time as another miner created the canonical block, which was ultimately determined by which chain was built on top of first.
- Miner of the ommer block was also rewarded (with smaller amount of eth).
Transaction Finality in PoW
- It’s possible that a user could see a successful transaction included in a block, only to see that block promptly orphaned and replaced with a different block (due to temporary forks).
- You must wait for chain to get longer. Cryptocurrency exchanges will wait for up to 50 blocks for a transaction to be treated as “confirmed”
How does PoW work
Miners must find combination and order of transactions, and find some value nonce, that combined calculates hash that satisfy an arbitrary, difficult condition.
Condition example: block must start with 6 zeros.
What is the name of ethereum consensus mechanism
Gasper
What is attestation
PoS
The validator then sends a vote (called an attestation) in favor of that block across the network.
How does PoS work
- In every slot a validator is randomly selected to be the block proposer. They bundle transactions together, execute them and determine a new ‘state’ and send new block.
- In every slot, a committee of validators is randomly chosen, whose votes are used to determine the validity of the block being proposed.
What is PoS chain selection rule
The algorithm that measures the ‘weight’ of the chain.
The weight is the accumulated sum of validator votes, weighted by validator staked-ether balances.
Transaction Finality in PoS
- On proof-of-stake Ethereum, this is managed using “checkpoint” blocks
- Validators vote for pairs of checkpoint epochs that it considers to be valid.
- If a pair of checkpoints attracts votes representing at least two-thirds of the total staked ETH, the checkpoints are upgraded.
- The more recent of the two (target) becomes “justified”. The earlier of the two is already justified because it was the “target” in the previous epoch. Now it is upgraded to “finalized”.
What is the inactivity leak
PoS
The inactivity leak bleeds away the staked ETH from validators voting against the majority, allowing the majority to regain a two-thirds majority and finalize the chain.
What is correlation penalty
PoS
The amount of ETH slashed depends on how many validators are also being slashed at around the same time. This is known as the “correlation penalty”.
What is temporary fork
When two blocks are created at the same time by two different nodes, the respective peers of those diverging nodes will be operating on two different versions of the blockchain.
What is Hard Fork
When community disagrees on blockchain rule, part can use old chain, and part can use new chain (i.e. with new consensus or some security patch).
How much ether is creating with each block (in PoS)
- The total amount issued depends on the number of validators and how much ether they have staked.
About 1/8 of the total issuance goes to the block proposer; the remainder is distributed across the other validators.
How much is Wei in ether
10^-18
How much is Gwei in ether
10^-9
What are bootnodes
- These are well-known, relatively reliable IP addresses that can be used to create a sufficiently large pool of network peer connections.
- Every major Ethereum node software has a hardcoded list of bootnodes.
How is time divided in ethereum (what is block time).
Name of interval and how many seconds.
PoS
In Ethereum, time is divided up into twelve second units called ‘slots’.
Assuming all validators are online and fully functional there will be a block in every slot, meaning the block time is 12s.
1 Epoch = 32 Slots
How does account / transaction nonce work
A crytopgraphic nonce is a technique to prevent replay attacks, and matches the purpose of the account nonce.
How is public address created
It’s derived from the public key.
You get a public address for your account by taking the last 20 bytes of the Keccak-256 hash of the public key and adding 0x to the beginning.
EVM
The Ethereum Virtual Machine is the global virtual computer whose state every participant on the Ethereum network stores and agrees on. Any participant can request the execution of arbitrary code on the EVM; code execution changes the state of the EVM.
Compiled smart contract bytecode executes as a number of EVM opcodes.
How is ethereum state stored
In the context of Ethereum, the state is an enormous data structure called a modified Merkle Patricia Trie, which keeps all accounts linked by hashes and reducible to a single root hash stored on the blockchain.
What is Gas
- Gas points are used to specify the fees inside of Ether, for ease of computation using standard values.
- Ethereum has specified gas points for each type of operation.
- If the fee specified and the gas point in the transaction are not sufficient, it is rejected. This is similar to mailing a letter with insufficient postage.