Ethereum Flashcards

1
Q

What are Proof-of-work and proof-of-stake

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is Sybil resistance and sybil attack

A

Sybil attacks are when one user or group pretends to be many users.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is Ommer block

A
  • 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).
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Transaction Finality in PoW

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

How does PoW work

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the name of ethereum consensus mechanism

A

Gasper

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is attestation

PoS

A

The validator then sends a vote (called an attestation) in favor of that block across the network.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

How does PoS work

A
  • 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.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is PoS chain selection rule

A

The algorithm that measures the ‘weight’ of the chain.
The weight is the accumulated sum of validator votes, weighted by validator staked-ether balances.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Transaction Finality in PoS

A
  • 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”.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the inactivity leak

PoS

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is correlation penalty

PoS

A

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”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is temporary fork

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is Hard Fork

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

How much ether is creating with each block (in PoS)

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How much is Wei in ether

A

10^-18

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

How much is Gwei in ether

A

10^-9

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

What are bootnodes

A
  • 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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

How is time divided in ethereum (what is block time).
Name of interval and how many seconds.

PoS

A

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 well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

How does account / transaction nonce work

A

A crytopgraphic nonce is a technique to prevent replay attacks, and matches the purpose of the account nonce.

21
Q

How is public address created

A

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.

22
Q

EVM

A

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.

23
Q

How is ethereum state stored

A

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.

23
Q

What is Gas

A
  • 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.
24
Q

In what unit gas is denoted

A

Gas prices are denoted in gwei.

25
Q

Why do gas fees exist?

A
  • By requiring a fee for every computation executed on the network, we prevent bad actors from spamming the network.
26
Q

What is Layer 2

A
  • A layer 2 is a separate blockchain that extends Ethereum and inherits the security guarantees of Ethereum.
  • A layer 2 blockchain regularly communicates with Ethereum (by submitting bundles of transactions) in order to ensure it has similar security and decentralization guarantees.
27
Q

What is EOA

A

Externally Owned Accounts (EOA)
- Needed to participate in network.
- Controlled by private keys.
- Every account has a coin balance.
- Creating an account costs nothing

28
Q

What is Contract Accounts

A
  • Has code which can be executed (smart contract)
  • Can modify own state and interact with deployed smart contracts as well.
  • Creating a contract has a cost because you’re using network storage.
29
Q

Base Fee

A
  • The base fee is calculated independently of the current block and is instead determined by the blocks before it - making transaction fees more predictable for users. When the block is mined this base fee is “burned”, removing it from circulation.
  • The base fee is calculated by a formula that compares the size of the previous block (the amount of gas used for all the transactions) with the target size.
  • This exponential growth makes it economically non-viable for block size to remain high indefinitely.
30
Q

Why base fee is burned

London hard fork

A

Burning the base fee prevents various ways block producers could manipulate it otherwise. For example, if block producers received the base fee, they could include their own transactions for free and raise the base fee for everyone else.

31
Q

What is block size

London hard fork

A
  • Previously, the block size was constant.
  • The London Upgrade introduced variable-size blocks to Ethereum. Each block has a target size of 15 million gas, but the size of blocks will increase or decrease in accordance with network demand, up until the block limit of 30 million gas (2x the target block size)
32
Q

Beacon Chain Contract

A

All PoS stakes are stored in beakon chain contract.

33
Q

Block: gas_limit

A

maximum gas allowed in this block

34
Q

Block: gas_used

A

the actual amount of gas used in this block

35
Q

Block: state_root

A

root hash for the global state after applying changes in this block

36
Q

Block: graffiti

A

arbitrary data used to tag blocks

37
Q

Block: randao

A

a value used to select the next block proposer

38
Q

Block: attestations

A

list of attestations in favor of the current block

39
Q

Why would you send ether in tx to execute contract method

A

When the recipient address is a smart contract, this transferred ether may be used to pay for gas when the smart contract executes its code.

40
Q

Transaction: gasLimit

A

the maximum amount of gas units that can be consumed by the transaction.

41
Q

Transaction: maxPriorityFeePerGas

A

the maximum price of gas to be included as a tip to the validator

42
Q

Transaction: maxFeePerGas

A

the maximum price of gas willing to be paid for the transaction (inclusive of baseFeePerGas and maxPriorityFeePerGas)

43
Q

What is the name of the place where transaction end up just after send

A

unverified transactions pool (Mempool)

44
Q

What is transaction Receipt, what are important fields

A
  • Transaction Receipts record the transaction outcome.
  • Important fields:
    • status: String - ‘0x0’ indicates transaction failure , ‘0x1’ indicates transaction succeeded.
    • contractAddress: String - 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
    • logs: Array - Array of log objects, which this transaction generated.
45
Q

Types of transactions

A
  • Regular transactions: a transaction from one account to another.
  • Contract deployment transactions: a transaction without a ‘to’ address, where the data field is used for the contract code.
  • Execution of a contract: a transaction that interacts with a deployed smart contract. In this case, ‘to’ address is the smart contract address.
46
Q

What is dApp

A

A decentralized application (dapp) is an application built on a decentralized network that combines a smart contract and a frontend user interface.

47
Q

Ethereum node types

A
  • Full node
  • Light node
  • Archive node