6.2 System Architecture Flashcards
World Computer: State Machine, Properties
All participants are using …
Users issue … to call programs on the computer
Everyone shares the same resources and …
The computer has no explicit, single …
Using the computer’s resources …
the same computer
transactions
storage
owner
costs money
Ethereum Virtual Machine
1. What is a virtual machine in a blockchain?
Virtual machines (VM) are…that imitate real machines.
- What is the Ethereum Virtual Machine (EVM)?
EVM was the first virtual machine to be placed on a blockchain network, allowing programmers to …
It has a … designed by Vitalik Buterin, which allows developers to execute programs on the Ethereum blockchain.
Running operations on EVM have associated costs denominated in ….
World state refers to …
mechanisms for creating instances of software
conduct calculations on the blockchain in runtime
stack-based architecture(what does that mean?)
gas
all accounts and smart contracts with their respective storage.
EVM State Machine
Unlike Bitcoin where state refers to .., in Ethereum, state represents … Hence, Ethereum is more than a distributed ledger, it is a ..
EVM specifies an … for state changes on Ethereum.
Formally, EVM can be specified by the following tuple:
(…, transaction, …, code,…, stack, …, gas)
The block_state represents the world state of the whole blockchain including … –>All Ethereum accounts controlled by a …
UTXOs owned by addresses; accounts and smart contracts with their storage; distributed state machine
execution model
block_state; message; memory; pc
all accounts, contracts and storage;
private key
Accounts on Ethereum
Ethereum uses an … ledger where each distinct address represents a …(remember that Bitcoin uses a transaction-based ledger model)
Ethereum supports two types of accounts:
Externally Owned Account: Accounts that are …
Accounts that are … do not have any code stored on the blockchain.
This type can be seen as the default …
It can sign transactions, …, and send Ether from one account to another.
The origin of any transaction is always an account controlled by a private key.
account-based; separate, unique account
controlled by private keys and owned externally
controlled by a private key
wallet of a user
issue smart contract functions calls
Types of accounts supported by Ethereum
2. Smart contract accounts which are controlled by …
Smart contracts are treated as …
Contracts can send messages to other accounts, both …
They can’t issue … themselves.
They have a … for reading and writing.
their code
account entities with their own, unique address
externally controlled and smart contracts
a transaction
persistent internal storage
Ethereum account is a 4-tuple containing the following data:
(nonce, balance, contract_code, storage)
Explain those terms.
nonce: An increasing number that is attached to any transaction to prevent double spending attacks.
balance: current account balance in Ether
contract code: bytecode representation of the account. If no contract code present; then the account is externally controlled.
Storage: the data storage used by the account, empty by default. Only contract accounts can have their own storage.
A transaction is a … that is always sent by an EOA. Ethereum state transitions are …
A transaction contains the following data:
The recipient of the transaction
…
The amount of ether to transfer from the sender to the recipient
…
AGASLIMITvalue, representing the …
AGASPRICEvalue, representing …
Transaction Fee = Gas Used x GASPRICE
Transactions can be addressed to …
signed data package; triggered by transactions
A signature identifying the sender;
An optional data field – data field is used for function call arguments (e.g. function inputs);
maximum amount of gas you are willing to consume on a transaction
the unit fee the sender pays per computational step;
a smart contract or another EOA
A message is very similar to a transaction. Messages are only sent by …, i.e., they are not mined into a block like transactions.
A message contains:
The sender of the message (implicit)
…
The amount of ether to transfer alongside the message
…
AGASLIMITvalue
Whenever a contract …, a virtual message is sent.
Whenever an EOA calls a method on a contract, a … is sent.
contracts and exist only virtually
The recipient of the message; An optional data field
calls a method on another contract
transaction
Executing EVM opcodes use …and therefore …
Each opcode costs a certain amount of gas which may depend on …, e.g., the number of bytes to be allocated.
Opcodes such as … are more expensive than simple operations like ADD or PUSH1.1
The opcode for selfdestruct (address) uses …
computational resources; has an associated fee called gas
the arguments of the operation
SSTORE, which places data into the storage,
negative gas as it frees up space on the blockchain.
A smart contract is a …or contracts.
They can be used to execute functions, … or store data.
Each smart contract is an …, i.e., has its own address.
Smart contracts have some peculiarities compared to traditional software.
set of functions that can be called by other users
send ether
account holding object
Smart contracts: Security
The .. requires special attention on security.
Once deployed, a contract is publicly accessible by anyone on the network with the following information:
….
OPCODE
…
Furthermore, the… is accessible (function calls + actual arguments).
Smart contracts – once deployed – cannot be …
development process of smart contracts
Address of the smart contract; Number of public functions and their hash signature
whole transaction history
changed or patched anymore
Smart contracts as closed systems
Smart contracts can’t access any data from ….
There are no HTTP or similar network methods implemented to call external services. This is on purpose to prevent … (there are also no functions to generate random values).
Currently, the only way to write smart contracts using external data (e.g. weather data, traffic data etc.)
is to use oracles. Oracles are basically third-party services that … and write the data via a special smart contract to the blockchain. Other smart contracts can now …
outside the blockchain on their own
non-deterministic behavior once a function is called
verify data from web services
call the oracle contract to get the data.