Upgrade to Pro — share decks privately, control downloads, hide ads and more …

From zero to blockchain hero - Ethererum edition

From zero to blockchain hero - Ethererum edition

● What is blockchain?
● Blockchain taxonomy
● Ethereum
● Solidity (language for smart contracts on Ethereum)

Edi Sinovcic

October 23, 2019
Tweet

More Decks by Edi Sinovcic

Other Decks in Education

Transcript

  1. Agenda • What is blockchain? • Blockchain taxonomy • Ethereum

    • Solidity (language for smart contracts on Ethereum) • Practical part
  2. Adding a new node • In linked list nodes can

    be added to the end or to the front or anywhere else :) • In blockchains only at the end!
  3. Blockchains (2) Let’s replace pointers with cryptographic signatures. Every new

    node includes a cryptographic signature of the previous node (usually just a hash)
  4. So what are blockchains in the end exactly? • Distributed

    append-only databases • Multiple transactions in single block • Multiple blocks • Ordered (consistency) • Consensus based (multiple implementations) - BFT (Byzantine Fault Tolerant)! • Good article on distributed databases vs dlt’s (https://gendal.me/2016/11/08/on-distributed-datab ases-and-distributed-ledgers/)
  5. Blockchain Taxonomy • Actor - who can perform an action

    • Permissioned: restricted <write permission> OR restricted <validator permission> • Permissionless: public <write permission> AND public <validator permission> • Public: permissionless AND public <actor permission> • Private: permissioned AND restricted <actor permission>
  6. Common Term: Consensus • Algorithm that makes distributed nodes agree

    on validity of transactions in hostile environment • Implementations: ◦ PoW (Proof of Work) - Bitcoin, Ethereum 1.0 ◦ PoS (Proof of Stake) - Lisk, Ethereum 2.0 ◦ dPoS (delegated Proof of Stake) - EOS ◦ PoA (Proof of Authority) - Ethereum, Hyperledger Fabric (mostly private, permissioned implementations)
  7. Common Term: UTXO vs Account based • UTXO (Bitcoin) -

    An unspent transaction output • Account based (Ethereum) - the account / contract state is maintained externally (off-chain)
  8. Common Term: Gas • Turing completeness (infinite loops) • Ethereum

    (not in Bitcoin) - pay for execution • Gas price - https://ethgasstation.info/index.php • Gas limit - 21000 (normal)
  9. Ethereum • PoW consensus (PoA also possible - Clique) •

    Smart contract engine (EVM) - Solidity language (Turing Complete) • 15 seconds per block (on average - difficulty of mining changes) • Merkle Tree • Account based (not UTXO like Bitcoin) • Gas • Oracles (off-chain - on-chain communication) • Layer 2 solutions (scaling) - sidechains, plasma, zkp’s • Whisper - peer-to-peer communication between dApps • Swarm/IPFS - peer-to-peer data storage • dApps (Distributed Apps)
  10. Ethereum 2.0 • PoS consensus - validator - stake =

    32 ETH - 5647$ • Sharding • Beacon chains • Eth 1.0 as a shard! • Still in early development! (version 0 at 3.1.2020.)
  11. Common Term: ERC standards • ERC 20 - Utility tokens

    - ICO craze • ERC 721 - Non fungible tokens (Crypto Kitties) - games - unique • ERC 1400 - STO (Greyp Bikes) - legally binding in off-chain world ◦ KYC/AML • Stable tokens (DAI) ◦ 1 USD = 1 DAI ◦ Dollar price changes! -> Oracles (trust?) ◦ https://www.youtube.com/watch?v=L1erp9Gkesk • OpenZeppelin libraries (https://github.com/OpenZeppelin/openzeppelin-contracts/tree/master/contracts) • EIP (Ethereum improvement proposals) - https://eips.ethereum.org/
  12. Smart Contracts on Ethereum • Solidity, Vyper... • Compiles to

    byte-code that runs inside EVM • Contracts can interact between each other (contract can call functions from other contracts) • ABI (application binary interface) • Good Udemy tutorial: https://www.udemy.com/course/ethereum-and-solidity-the-complete-developers-guide/
  13. Learning by example • Metamask: https://metamask.io/ • Rinkeby faucet: https://faucet.rinkeby.io/

    • Hackmd: http://bit.ly/bcit-workshop • Remix IDE: https://remix.ethereum.org/ • Infura: https://infura.io/ • Code: https://gist.github.com/edisinovcic/ab30efa3d96679c4b8a88893b4c9650f • Birthday contract: https://medium.com/@k3no/making-a-birthday-contract-858fd3f63618