05 Blockchain 02 Flashcards
Describition of PoW
–>including transaction on the ledger requires computational effort and thus is costly
* Miners solve cryptographic puzzle to maintain the ledger
* These puzzles consists of finding a nounce–>this is a special number that results in a hash of that block with a particular pattern
POW: What is a Nounce
Nounce= a special number that when added to the block results in the hash of that block
POW: NOunce characteristics
- the hash has to start with a certain number of zeros that depends on the difficulty of the network
—>This difficult level is adjusted automaticaöy every 2016 blocks to keep the average time between two blocks at about 10 minutes
–>finding the correct nounce is done by try and error
What is done after finding the Correct Nounce?
PoW
–>The miner broadcasts the solution to the network
* it appends the block of transatiom, including the nounce, to the ledger
* The other miners (nodes) can verify the nounce results in a correct hash is computationally easy
Describe the 51% Attack in context of blockchains bitcoin with PoW
The blocks are all cryptographically linked by including the hash of the previous block in the new block
* to make changes or minor modifications to a previous block would require to re-do all the work starting with that block
–>this can in the long run only happend if the person controls 51% of the computational power of the network
What are the two mining incentives?
-
Block rewards through newly generated coins
* successful miners receives bitcoins these reward halves rougly every four years
* in about 2140 the reward is expected to be zero -
Transaction fees from users
* capacity in each block is limited —>users can optinally pay a fee to minizers to incentivize them to include their transaction in a block
–>During times of blockchain congestion, the fees can reach very high levels
What is included in the Block header? Bitcoin
The Block header contains:
* Bitcoin protocol number
* CUrrent difficult level
* Timestamp
* previous block header hash
* Merkle root hash of hased transactions
* Nounce
What is Unspent Transaction Output
Nodes track unspent transaction output (UTXO)
* the bitcoin transactions list input and output addresses
–>UTXO is the output of a transaction and exists until it is used as input for another transaction
–>How many UTXTO´s reside in a given address is computed by counting all prior UXTOs that list this address as their destination
What is Unspent Transaction Output
UTXO means Unspent Transaction Output and
describes how Bitcoin for example tracks the amount of bitcoins a wallet has, furthermore it is a technology that explains how transactions are made on the blockchain.
UTXO model behaves more like cash instead of a bank account
Explaing the unspent transaction output
Works like a wallet, if one has 50 BTC, 1- 30 BTC and 1-20 BTC and wants to send 35 btc
–>Will use both addresses (30 BTC and 20 BTC) and send that to the other addresses, additionally there will be a new “change address” created where the remaining “Unspent transsaction outpu” go in (30+20 - 35) = 15 BTC
What is a Mempool?
New transactions are broadcasted to the whole network, the ones that are valid wait to be included in a block
–>These waiting transactions (confiremed) are stored in the mempool
What does the Mempool mean for the transaction within?
Everyone can see the transactions in the mempool:
* Trading intentions might be revealed
* Front running poses a serious problem —> insider trading
what does the Hashrate meansure?
The Hashrate measure the computing power within the Bitcoin network
* the total network hashrate has increased tremendously
–>The mining difficulty adjust automatically, but what matters for miners is their relative share of computating power
why were Mining pools created in the first place?
For an individual miner it is extremely unlikely to get the block reward
–>Thus to get a more stable stream of income, miners join in mining pools
–>Each members of a pool contribute computational power
How is reward in mining pools distributed?
- the rewards are typically distributed according to member´s contributed hashrate
- pool operators keeps a small percentage to cover administrative costs
–>relatively few mining pools represent a large part of overall Bitcoin mining, raising concerns about centralization
PoW Externalitites
–>electricity is the main input for PoW mining, thus miners tend to be located in areas with cheap energy
- uses vast amounts of energy
- energy market spillover effects to local businesses and households
- Bitcoin could have a considerable impact on the climate
–>a lot of the engery comes from gray energy
Ethereum platform short describtion (provides…
Ethereum network proved a base layer computation platform based on a programmable blockchains
–>used for
- executing smart contracts
- runing decentralized applications (dApps)
Ethereum Governance and difference to Bitcoin? conserning changes?
Much more so than Bitcoin, the Ethereum protocol is subject to changes
e.g:
- changes to how fees, difficulty, or block rewards are calculated
- increasing scalability, privacy, efficiency, and flexibility
- switich to different consensus mechanism
How are changes in the Ethereum like protocol implemented?
Changes are usually implemented via a “hard fork”
Hard fork and soft fork
hard fork: is a change to the protocol that requires the creation of a new blockchain using the updated protocol, where miners pick the chain they want to continue by appending to that chain
soft fork: is a forward-compatible change to the rules.
–>It doesn’t create a new blockchain simply updates the protocol without splitting the network into two separate chains
How does the governance model of Ethereum work?
- Users suggest changes to ethereum using off-chain channels of Ethereum Improvement Proposals (EIP) and Ethereum Requests for Comment (ERC)
- EIP´s are discussed (particulary among core developers)) and then suggested for adoption via a fork or dropped
Critism in the governance model of Ethereum
- Some critize the governenance model as being too centralized and dependent on a core team of developers and the founder Vitalik Buterin
Which tracking method for accounts and balance does Ethereum use?
Etereum uses an account-based model that tracks the balance of each account (as part of the “global state”)
Advantages of the ACcount-based model over UTXO
- The account based model may be more intutive thant UTXO
- need to keep track of order of transaction from an account (every transaction has a number)
- UTXO may offer more privacy
- Obtaining the current state of the nework is easier for “liegt” clients/nodes in an account-based model
Account types in the Ethereum network
There are two types of accounts:
1. Externally owned accounts (EOAs)
2. Contract accounts
–>All accounts can eqully access and interact with the Ethereum network
What does each Account in the Ethereum network have?
- unique, crpytopgrahic address
- nounce
- Current ether balance
- Contract code
- Data storage
What are External owned accounts?
Controlled by (human) end users that have access to the private key for sending transactions
* have a balance and can send transactions
* do not have associated code
What are contract accounts?
=Completely controlled by associated code that can contain pretty much any type of calculation.
–>once set up the code itself cannot change
* Contract account have a balance and can transfer ether (or other tokens)
How is a execution of the code in a contract account triggered?
Only trigged by transactions from EOAs or from other contract accounts
* contacts do not just run in the background
* everything that is happening in the network is always set in motin by EOAs
How are Transactions between contact accounts called?
They are called “internal transactions or “messages” and will not be permantly put on the blockchain
How does Ethereum prevent a programm from running to long on the blockchain?
–>Put a price tag on computing resources
* Chrage a fee called gas for using the network
* Transactions have to include the amount of gas and the price the sender is willing to spend on executing the transaction.
Gas prices typically expressed in gwei
Transaction execution and gas?
As the transaction is excetued, gas is used for every computational step
- unspent gas is retunred to the sender
- if exection not finished an gas is not enough, everything is reversed and gas is sent back
What are the functionalities of Contract accounts?
- Transfer funds
- Create new digital tokens
- Exchange different tokens (as in decentralized exchanges)
- Trigger code from other contract accounts
- Construct derivatives with automated payouts
Are these smart contacts smart?
These “smart contracts” are permanently kept on the blockchain
–>They are not really smart and not necessarily a (legal) contract
–>more like a vending machine
–>Code is law
What is the main use of smart contracts?
The main use of smart contracts is the creation of new tokens, many of whcih are utility tokens
–>Ethereum contains several standards for new tokens that use the Ethereum blockchain
–>ERC-20 for fungible tokens
–>ERC-721 for non-fungible tokens
–>ERC-1400 for security tokens