Ethereum Flashcards
Ethereum protocols are sometimes referred to as
peer-to-contract systems
These are similar to a peer-to-peer systems, but with immutable, persistent programs known as smart contracts taking the place of a peer.
**what determines how much gas a transaction takes? What are typical gas usages for transactions?
.
a simple ETH transaction (to send ETH) takes how many bytes?
~110
an ETH transfer on a rollup takes how many bytes?
~12
What is associated with every operation on the Ethereum blockchain, or to be precise on the Ethereum Virtual Machine (EVM)?
an associated gas cost
adding two numbers costs how much gas?
3 gas
getting the balance of an account costs how much gas?
400
sending a transaction costs how much gas?
21000
at high level what should be known about the gas cost of smart contracts?
Smart contracts usually consist of multiple operations that together can cost even hundreds of thousands of gas.
transaction fee formula
gas cost (for each operation fixed defined amount) * gas price (variable, defined by the auction process)
gwei to ETH
1 bil gwei per ETH
what is the downside of the EVM being a Turing complete machine?
while this is one of the reasons the EVM is so powerful, this makes it vulnerable to the halting problem
the halting problem is what?
is the problem of determining, from a description of an arbitrary computer program and an input, whether the program will finish running, or continue to run forever.
how does ethereum derisk the halting problem? e.g. ensure a user can’t execute a program that never stops?
by introducing a gas cost associated with every operation
what does the EVM do before executing each operation in a transaction?
checks if there is enough gas left for that operation. In case there is not enough gas left, the whole transaction is reverted with “out of gas” exception and all state changes are rolled back. The user would still pay the transaction fee for the amount of work that has been done by the miner even if the transaction fails. This is again to avoid attacks on the network.