dimanche, mai 02, 2021

Mastering Blockchain - Imran Bashir - Part II

 


 


Chapter 11: Ethereum 101

  • Vitalik Buterin conceptualized Ethereum (https://ethereum.org)
  • Decentralized Applications (DApps): this concept is in contrats to Bitcoin, where the scripting language is limited and only allows necessary operations.
  • Ethereum 1.x: Proof-of-Work (PoW)
  • Ethereum 2.x: Proof-of-Stake (PoS)
  • Serenity release is ETH2.0.
  • Ethereum, just like any blockchain, can be visualized as a transaction-based state machine.
  • The transaction is digitally signed by the sender as proof that he is the owner of the ether.
  • The transaction is then picked up by nodes called miners on the Ethereum network for verification and inclusion in the block.
  • The details of the transaction can be visualized: https://etherscan.io/
  • This hash is the unique ID of the transaction that can be used to trace this transaction throughout the blockchain network.
  • The Ethereum network is a peer-to-peer network where nodes participates in order to maintain the blockchain and contribute to the consensus algorithm.
  • Ethereum client is Geth: provides various functions such as mining and account management.
  • Keys and addresses: The private key is a generated randomly and is kept secret; whereas public key is derived from the private key. Addresses are derived from public keys and are 20-byte codes to identify accounts. 
  • Accounts are one of the main building blocks of the Ethereum blockchain. They are defined by pairs of private and public keys.
  • Ethereum is a transaction-driven state machine.
  • In case of transaction failure due to insufficient account balance or gas, all state changes are rolled back except for the feee payment, which is paid to the miners.
  • The Contracts Accounts: the code is executed by the EVM (Ethereum Virtual Machine) by each mining node on the Ethereum network.
  • Accounts allow interaction with the blockchain via transactions.
  • A transaction in Ethereum is a digitally signed data packet using a private key that contains the instructions that either result in a message call or contract creation.
  • Nonce: the nonce is a number that is incremented by one every time a transaction is sent by the sender. It must be equal to the number of transactions sent and is used as a unique identifier for the transactions.
  • Gas price: the gas price represents the amount of Wei required to execute the transaction.
  • A block is a data structure that contains batches of transactions. Transactions can be found in either transactions pools or blocks. In transaction pools, they wait for verification by a node, and in blocks, they are added after successful verification.
  • Ehtereum's PoW is called Ethash and was originally designed to be ASIC resistant.
  • Recursive Length Prefix (RLP) is linked to serialization and deserialization which are also referred as marshaling and un-marshaling respectively. Some commonly used serialization formats include XML, JSON, YAML, protocol buffers and XDR.
  • Message calls result in a state transition. A message call is the act of passing a message from one account to another. If the destination account as an associated EVM code, then the EVM will start upon the receipt of the message to perform the required operations.
  • Messages are similar to transactions; however, the main difference is that they are produced by the contracts.
  • A call basically runs message call transactions locally on the client and never costs gas nor results in a state change.
  • At a fundamental level, the Ethereum blockchain is a transaction and consensus-driven state machine.
  • Code hash: this is an immutable field that contains the hash of the smart contract code that is associated with the account.
  • After the Decentralized Autonomous Organization (DAO) hack, a hard fork was proposed: Ethereum classic and its currency represented by ETC, whereas the hard-forked version is ETH.
  • The EVM is a simple stack-based execution machine that runs byte code instructions to transferm the system state from one state to another. Last In First Out (LIFO).
  • EVM optimization is an active area of research.
  • WebAssembly (Wasm) was developed by Google, Mozilla and Microsoft.
  • Precompiled contracts can potentially become native extensions and might be included in the EVM opcodes in the future.
  • Next hard fork release of Ethereum called Berlin will introduce new pre-compiled contracts for BLS12-381 curve operations with other updates.

Links

Acronyms

  • OOG: Out of Gas
Translation
  • immutable: immuable

Aucun commentaire: