Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ethereum A to Z

297 views

Published on

이더리움 A to Z, Account, Wallet, Ethash, Dag, Sharding, Plasma, Raiden Network, bitcoin, blockchain, ethereum, 이더리움

Published in: Engineering

Ethereum A to Z

  1. 1. A to Z dongsamb@gmail.com 17.09.18
  2. 2. Ethereum - Mining Pool https://etherscan.io/stat/miner?range=7&blocktype=blocks f2pool
  3. 3. Ethereum - Node info • 17.09.17 22 • Geth : 70% • Parity : 19% • Swarm : 6% • https://ethernodes.org/network/1 Geth Parity swarm 1.7.0 1.6.7 1.6.6
  4. 4. Ethereum - Currency, Market
  5. 5. Ethereum - Market Capitalization
  6. 6. • startGas = gas limit • startGas is the term in the Ethereum White Paper • gasLimit is the term in the Ethereum Yellow Paper, • software, such as Geth and web3.js, simply uses the term “gas”. • gas Price 
 - Gas https://media.consensys.net/ethereum-gas-fuel-and-fees-3333e17fe1dc
  7. 7. - ( MyEtherWallet, MetaMask ) • Gas Price, Gas Limit
  8. 8. - ( Mist )
  9. 9. -
  10. 10. - 1. , . 2. =STARTGAS * GASPRICE . 
 Sender NONCE +1. 3. GAS=STARTGAS 
 1 5Gas . 4. . 
 . 
 smart contract , . 
 . 5. , , .
 6. , . APPLY(S, TX) -> S’
  11. 11. - Merkle Trees
  12. 12. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  13. 13. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  14. 14. Appendix - Merkle Tree https://brilliant.org/wiki/merkle-tree/ https://bitcoin.org/en/developer-reference#merkle-trees
  15. 15. Appendix - Patricia Tree https://ethereum.stackexchange.com/questions/6415/eli5-how-does-a-merkle-patricia-trie-tree-work
  16. 16. Appendix - Merkle Patricia Tree https://ethereum.stackexchange.com/questions/6415/eli5-how-does-a-merkle-patricia-trie-tree-work
  17. 17. Blockchain Demo https://anders.com/blockchain/
  18. 18. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  19. 19. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  20. 20. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  21. 21. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  22. 22. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  23. 23. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  24. 24. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  25. 25. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  26. 26. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  27. 27. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  28. 28. https://github.com/MetaMask/IPFS-Ethereum-Hackathon/
  29. 29. - Code Execution, EVM • (EVM: Ethereum Virtual Machine): 
 
 
 (state) 
 
 network, filesystem, 
 , Smart contract ( Library, Deligatecall ) • 1. : LIFO(Last-In-First-Out) value push pop . 2. : 3. : Key/value (simpleDB). • , , .
  30. 30. 1 ASIC resistance hashrate 2 Light client verifiability Hasimoto : ASIC resistance, IO-bound, making memory read Dagger : memory-hard computation, but easy validation
 ( by Vitalic Buterin) , Dagger Dagger Hasimoto Ethash 30,000 1GB PoW hash - PoW, Mining Centralization
  31. 31. Yellow Paper ( )
  32. 32. // datasetSizes is a lookup table for the ethash dataset size for the first 2048 // epochs (i.e. 61440000 blocks). var datasetSizes = []uint64{ 1073739904, 1082130304, 1090514816, 1098906752, 1107293056, 1115684224, 1124070016, 1132461952, 1140849536, 1149232768, 1157627776, 1166013824, 1174404736, 1182786944, 1191180416, 1199568512, 1207958912, 1216345216, 1224732032, 1233124736, 1241513344, 1249902464, 1258290304, 1266673792, 1275067264, 1283453312, 1291844992, 1300234112, 1308619904, 1317010048, 1325397376, 1333787776, 1342176128, 1350561664, 1358954368, 1367339392, 1375731584, 1384118144, 1392507008, 1400897408, 1409284736, 1417673344, 1426062464, 1434451072, 1442839168, 1451229056, 1459615616, 1468006016, 1476394112, 1484782976, 1493171584, 1501559168, 1509948032, 1518337664, 1526726528, 1535114624, 1543503488, 1551892096, 1560278656, 1568669056, 1577056384, 1585446272, 1593831296, 1602219392, 1610610304, 1619000192, 1627386752, 1635773824, 1644164224, 1652555648, … // datasetSize calculates and returns the size of the ethash mining dataset that // belongs to a certain block number. The dataset size grows linearly, however, we // always take the highest prime below the linearly growing threshold in order to // reduce the risk of accidental regularities leading to cyclic behavior. func datasetSize(block uint64) uint64 { // If we have a pre-generated value, use that epoch := int(block / epochLength) // ex) 4,240,505 / 30,000 == 141 if epoch < len(datasetSizes) { // 2048 return datasetSizes[epoch] } // No known dataset size, calculate manually (sanity branch only) size := uint64(datasetInitBytes + datasetGrowthBytes*uint64(epoch) - mixBytes) for !new(big.Int).SetUint64(size / mixBytes).ProbablyPrime(1) { // Always accurate for n < 2^64 size -= 2 * mixBytes } return size } - PoW, Mining Centralization
  33. 33. Smart Contract • Github • ERC-20 • EIP • ERC-20 • Zeppelin example • Token, •
  34. 34. Github https://github.com/ethereum/go-ethereum
  35. 35. Github
  36. 36. Github
  37. 37. Github
  38. 38. Ethereum Github https://github.com/ethereum
  39. 39. Ethereum Github - Wiki https://github.com/ethereum/wiki/wiki/White-Paper
  40. 40. Ethereum Github - Wiki https://github.com/ethereum/wiki/wiki/[Korean]-White-Paper
  41. 41. Ethereum Github - Wiki https://github.com/ethereum/wiki/wiki/[Korean]-White-Paper
  42. 42. Ethereum Github - Wiki https://github.com/ethereum/wiki/wiki/[Korean]-White-Paper
  43. 43. Ethereum Github - pyethereum https://github.com/ethereum/pyethereum
  44. 44. https://github.com/ethereum/pyethereum/graphs/contributors
  45. 45. Ethereum Github - Contribution ( Buterin )
  46. 46. Ethereum - research • python PoC( proof of concept ) • pyethereum -> go-ethereum(geth) • sharding, casper
  47. 47. Ethereum Github - sharding https://github.com/ethereum/sharding
  48. 48. raiden-network Github - raiden https://github.com/raiden-network/raiden
  49. 49. Ethereum Github - EIP https://github.com/ethereum/EIPs
  50. 50. Ethereum Github - ERC https://github.com/ethereum/EIPs/issues/16 https://ko.wikipedia.org/wiki/RFC ERC : Ethereum RFC 

  51. 51. Ethereum Github - ERC ERC : Ethereum RFC(Request for Comments)
 Popular RFCs • HTTP/1.1 Protocol - RFC 2616 • Uniform Resource Locator URL - RFC 1738 • TCP Protocol - RFC 793 • Transport Layer Security Protocol - RFC 5246 • eMail - RFC 2822 • SMTP Protocol - RFC 5321 • SIP Protocol - RFC 3261 • FTP Protocol - RFC 959 • RTP Protocol - RFC 3550 https://github.com/ethereum/EIPs/issues/16 https://ko.wikipedia.org/wiki/RFC https://tools.ietf.org/html/rfc2616
  52. 52. Ethereum Github - ERC https://github.com/ethereum/EIPs/issues
  53. 53. ERC-20, ERC https://github.com/ethereum/EIPs/issues/20
  54. 54. Smart Contract - ERC-20 https://github.com/ethereum/EIPs/issues/20 Smart contract a b
  55. 55. Smart Contract - ERC-20 https://github.com/ethereum/EIPs/issues/20
  56. 56. Smart Contract - ERC-20 ? EIP-20? https://github.com/ethereum/EIPs/blob/master/EIPS/eip-20-token-standard.md
  57. 57. Smart Contract - zeppelin example
  58. 58. Smart Contract - , Token
  59. 59. Smart Contract - , Token
  60. 60. Smart Contract - , Token
  61. 61. Smart Contract - , Token
  62. 62. Smart Contract - , Token
  63. 63. Smart Contract - , Token
  64. 64. Smart Contract - , Token
  65. 65. Smart Contract - , Token
  66. 66. Smart Contract - Security • DAO ( 2016.06 ) DAO smart contract ( ) 
 2 , 
 
 blockchain , 
 , transaction block chain hard fork 
 
 hard fork ( ) Ethereum Classic • DoS ( 2016.09 ) DoS 
 
 
 
 gas Hard fork • PARITY smart contract 
 
 Parity Multisig Wallet Edgeless, Swarm City, æternity ICO Wallet 150,000 ETH 
 initWallet public 
 Parity Multisig Wallet Smart contract
  67. 67. Smart Contract - Security, Bug Bounty
  68. 68. Smart Contract - Random EVM Smart Contract Random Random Seed EVM Contract EVM , Seed Random ex) block timestamp, block height , smart contract random seed smart contract 
 EVM
  69. 69. Smart Contract - Oracle Smart contract Oracle
 
 ex) Prediction Market, score
 , ETH 
 
 
 Oraclize API
  70. 70. Ethereum Scalability Raiden Network Lightning Network Sharding Metropolis Plasma ?Casper
  71. 71. Ethereum
  72. 72. Metropolis • Vitaliks latest thinking on transition to PoS: • PoW -> PoW with PoS "on top" -> Hybrid PoW/PoS -> PoS • Stages: • 1. PoS would finalize blocks after PoW has de facto finalized them anyway. • 2. After a couple of month: implement clients that favor PoS. • 3. Cut down PoW block reward, increase PoS validator reward. • 4. Hybrid PoS scheme parametrize between PoW and PoS at 0-100 scale
  73. 73. Metropolis Block , 
 PoS ( Casper ) , 
 
 , 5->3 
 
 (Byzantium) -> 17.09.18 (Constantinople) -> 18
  74. 74. Metropolis EIP 86 (“abstraction”) •  Make the protocol as simple as possible •  Any account in the call execution chain can pay for gas •  Instead of only the account that sent the transaction •  A recipient, or middle account, could pay the gas cost •  Helps anonymization, instead of needing to use only one account to pay for gas EIP 98 (removal of intermediate state roots) •  Goal: Make it easier to process transactions in parallel EIP 96 (EVM-ification) •  Try to make light clients more secure EIP 100 (target block time including uncles) •  Security upgrades EIP 101 (big integer precompile) •  Make it easier to verify certain types of cryptography •  Ethereum supports elliptic curve cryptography •  RSA encryption is used by others, and is currently computationally inefficient to verify in Ethereum EIP 116 (STATIC_CALL) •  Under consideration •  Can call a contract and be sure you’re not changing anything; not writing to the state EIP 195 (Pure call) •  Even more static version of STATIC CALL •  Can’t write or read EIP 140 (throw opcode) •  Throws an exception without consuming all remaining gas EIP 141 (invalid opcode)
  75. 75. Metropolis EIP 86 (“abstraction”) •  Make the protocol as simple as possible •  Any account in the call execution chain can pay for gas •  Instead of only the account that sent the transaction •  A recipient, or middle account, could pay the gas cost •  Helps anonymization, instead of needing to use only one account to pay for gas EIP 98 (removal of intermediate state roots) •  Goal: Make it easier to process transactions in parallel
  76. 76. Metropolis - Byzantium fork ( 10 ) • Geth 1.7 – Megara • EIP 98: Removal of intermediate state roots from receipts (#14750). • Expanded by EIP 658: Embedding transaction return data in receipts (#15014). • EIP 100: Change difficulty adjustment to target mean block time including uncles (#14733). • EIP 198, EIP 212 (197) and EIP 213 (196): Precompiled contracts for modular exponentiation; elliptic curve addition, scalar multiplication and pairing (#14959, #14993). • EIP 214 (116): Expanding the EVM with static contract calls (#14978). • EIP 211: Expanding the EVM with dynamically sized return data (#14981). • EIP 206 (140): Expanding the EVM with cheap state revertals (#14983). • EIP 649: Delaying the difficulty bomb and reducing the block reward (#15028). • EIP 684: Preventing overwriting contracts (Byzantium prep) (#15039). https://blog.ethereum.org/2017/09/14/geth-1-7-megara/
  77. 77. Serenity serenity, Ethereum 2.0, with 4 primary research directions: 1. casper, the proof-of-stake algorithm. 2. scalability, by processing transactions in parallel and moving away from the paradigm where every node in the network has to absolutely process every transaction. 3. zkSNARK, addressing privacy. 4. Upgrading the evm (Ethereum Virtual Machine).
  78. 78. Ethereum Scalability Sharding Raiden Network (lighting network) Plasma
  79. 79. Ethereum Scalability - Sharding https://github.com/ethereum/wiki/wiki/Sharding-FAQ 0x1 0x2 0x3 0x4 … Challenges Cross shard communication
 Single-shard takeover attacks Fraud detection …
  80. 80. https://lightning.network/ Ethereum Scalability - Raiden Network https://raiden.network
  81. 81. • Bitcoin Lightning Network • ERC-20 Token https://lightning.network/ Ethereum Scalability - Raiden Network https://raiden.network
  82. 82. Ethereum Scalability - Raiden Network https://raiden.network/101.html
  83. 83. Ethereum Scalability - Raiden Network https://answers.thenextweb.com/s/vitalik-buterin-13gxQB
  84. 84. Ethereum Scalability - Plasma Plasma: Scalable Autonomous Smart Contracts Joseph Poon and Vitalik Buterin https://medium.com/chain-cloud-company-blog/plasma-in-10-minutes-c856da94e339 http://plasma.io Lightning Network
  85. 85. Map Reduce
  86. 86. Ethereum Scalability - Plasma
  87. 87. Discussion
  88. 88. Thank you!
  89. 89. Ethereum Scalability - Raiden Network https://raiden.network
  90. 90. https://github.com/ConsenSys/EthOn
  91. 91. Ethereum Test Network • Etherscan Testnet
  92. 92. Appendix - bitcoin vs ethereum
  93. 93. Appendix - SHA-3 ( Keccak )
  94. 94. Appendix - SHA-3 ( Keccak )
  95. 95. // fnv is an algorithm inspired by the FNV hash, which in some cases is used as // a non-associative substitute for XOR. Note that we multiply the prime with // the full 32-bit input, in contrast with the FNV-1 spec which multiplies the // prime with one byte (octet) in turn. func fnv(a, b uint32) uint32 { return a*0x01000193 ^ b // ^ == xor } // fnvHash mixes in data into mix using the ethash fnv method. func fnvHash(mix []uint32, data []uint32) { for i := 0; i < len(mix); i++ { mix[i] = mix[i]*0x01000193 ^ data[i] } } FNV (Fowler/Noll/Vo) is a fast, non-cryptographic hash algorithm with good dispersion FNV hashes are designed to be fast while maintaining a low collision rate. The FNV speed allows one to quickly hash lots of data while maintaining a reasonable collision rate. The high dispersion of the FNV hashes makes them well suited for hashing nearly identical strings such as URLs, hostnames, filenames, text, IP addresses, etc. Appendix - fnv ( FNV hash )
  96. 96. - Prev Hash : (parent hash) Nonce : 64 , Timestamp : time() Uncles Hash(ommer hash) : SHA-3 (256 ) / ommer " " Uncle Beneficiary : (fees) 160 Logs Bloom : ( ) ( ) Difficulty : Extra Data : Block Num Gas Limit Gas Used Mix Hash : 256 State Root : (SHA-3 ) Transaction Root : (SHA-3 ) Receipt Root : (SHA-3 )

×