Slide 1

Slide 1 text

Blockchains & co with only ~120’ Release 4 - 11/23/2018 ✿✿✿✿ ʕ •ᴥ•ʔ/ ︻デ═一 Cette œuvre est mise à disposition selon les termes de la Licence Creative Commons Attribution 4.0 International.

Slide 2

Slide 2 text

Pierre-Yves Lapersonne software developer pylapersonne.info

Slide 3

Slide 3 text

several parts 1. History 2. Blockchains 3. Cryptocurrencies 4. ÐApps 5. Use cases 6. Laws

Slide 4

Slide 4 text

history

Slide 5

Slide 5 text

crypto-anarchism, cypherpunk and mathematics... ● 1992: cypherpunks ○ Timothy May ○ The Cypherpunks Mailing List ○ release of The Cyphernomicon (1994) ○ missions including protection of privacy using encryption ○ crypto-anarchism ● 1998: b-money ○ Wei Dai ○ b-money, an anonymous, distributed electronic cash system ○ base of future blockchains: proof of work, transactions, broadcast ● 2005: bit gold ○ Nick Szabo ○ Bit Gold: Towards Trust-Independent Digital Money 5

Slide 6

Slide 6 text

and shit happened. ● 2008: subprimes crisis ! ○ too much speculation ○ massive loss of money for people ○ some banks were definitely closed ○ some banks were nationalized ○ loss of confidence to usual financial systems ● 2008: Bitcoin ○ Satoshi Nakamoto ○ Bitcoin: A Peer to Peer Electronic Cash System ○ birth of the 1st cryptocurrency! 6

Slide 7

Slide 7 text

the first block ● 3 January 2009 ○ 1st mined block - block genesis ○ 1st blockchain started ○ 1st transaction including a troll 7

Slide 8

Slide 8 text

the first blockchain ● new paradigm, new hopes ○ decentralized architecture ○ without regulation ○ unfalsifiable content ○ not anonymous ○ holds only bitcoin transactions ○ based on a fair consensus: mathematical challenge ○ dedicated to micro-transactions 8 bitcoin BTC 1 milli-bitcoin mBTC 0.001 micro-bitcoin μBTC 0.000001 satoshi sat 0.00000001 millisatoshi msat 0.00000000001

Slide 9

Slide 9 text

blockchains

Slide 10

Slide 10 text

1a - transaction ● sender ● receiver ● balance of tokens ● payload (depending to the blockchain in use) 10

Slide 11

Slide 11 text

inside a transaction (Bitcoin) 11 sender address 139emjfbkBGkE..............KMRS blockchain.info receiver address 19ZVvhHpnd3Tc..........NNCAmn

Slide 12

Slide 12 text

inside a transaction (Ethereum) 12 smart contract code of smart contract etherscan.io

Slide 13

Slide 13 text

1b - transactions ● triggered once registered in the blockchain ● each transaction has a cost (Tx fees) ● transactions are stored inside a pool before being added ● Tx fees order the transactions 13 Number of BTC transactions in pool (10/30/2018) bitcointicker.co

Slide 14

Slide 14 text

2 - block ● gathers several transactions ● contains useful details for the blockchain, e.g. : ○ timestamp ○ transaction fees ○ relay ○ difficulty, nonce ○ hashtree root ○ ... ● must be added only 1 time 14

Slide 15

Slide 15 text

15 inside a block mining pool hash of block #493761 root of the hash tree blockchain.info

Slide 16

Slide 16 text

3a - consensus ● miners may solve a hard mathematical problem to choose the one who will add the block and trigger the transactions stored inside ● challenge = consensus ○ Proof Of Work ○ Proof of Stake ○ Proof of Authority ○ Proof of Importance ○ ... 16 ? ? ? ? ?

Slide 17

Slide 17 text

3b - proof of work 1. build of a local block with ○ hash of previous block ○ hashtree root for tx ○ difficulty ○ ... 1. find the golden nonce, i.e. the random value with makes the block hash lower than the difficulty ➔ brute force! 17 Blockchain Bitcoin Ethereum Monero Dogecoin Difficulty 7 184 404 942 702 2 986 685 821 724 284 61 820 335 411 2 716 801 Block time 10’50’’ 14.3’’ 2’2’’ 1’2’’ ● 11/07/2018 ● bitinfocharts.com hash n-1 hash algorithm hash n nonce

Slide 18

Slide 18 text

3c - block mining ● with CPU or GPU ● with FPGA or ASIC ● with mining pools 18 Distribution of hashrates in Bitcoin blockchain (11/09/2018) blockchain.info/pools

Slide 19

Slide 19 text

3d - rewards ● blockchains are alive thanks to their transactions ● transactions use tokens ● tokens should be released regularly ➔ how can we make the system dynamic and attractive? Miners earn transaction fees and rewards 19 Blockchain Reward USD Bitcoin 12.5 BTC $ 81 846.75 Bitcoin Cash 12.5 BCH $ 7 865.63 Bitcoin Gold 12.5 BTG $ 392.38 Litecoin 25 LTC $ 1 373.5 ZCash 12.5 ZEC $ 1 626 Ethereum 3 ETH $ 660.24 Ethereum Classic 4 ETC $ 38.96 Monero 3.6 XMR $ 400.176 ● 11/07/2018 ● bitinfocharts.com

Slide 20

Slide 20 text

4a - blockchain 20 ● each block has a fingerprint of the previous block (hash) ● each block has a fingerprint of the previous block (hash) hash n-1 hash n hash n-2 bloc n - 1 bloc n bloc n + 1 hash hash

Slide 21

Slide 21 text

4b - blockchain ● each block has a fingerprint of the previous block (hash) 21 hash n-1 hash n hash n-2 bloc n - 1 bloc n bloc n + 1 hash hash ● each block has a fingerprint of the previous block (hash) ● to corrupt a block, we must modify all the following blocks ● a strong protocol is applied to check the blockchain and ensure its integrity hash of corrupted block

Slide 22

Slide 22 text

5 - network ● the blockchain is replicated in each node of the network ● if we want to corrupt a blockchain, we have to corrupt all blockchains before the next update ● this kind of attack implies too much energy and computational power 22 full node lite node

Slide 23

Slide 23 text

cryptocurrencies

Slide 24

Slide 24 text

2090 ? 24

Slide 25

Slide 25 text

2090 cryptocurrencies in use at least (899 coins + 1191 tokens) ● 11/07/2018 ● coinmarketcap.com 25

Slide 26

Slide 26 text

tokens or not tokens... “Simple” cryptocurrencies ● more for “1st generation blockchains” Tokens ● related to “2nd generation blockchains” ● implement ERC20 or ERC721 standards ● used with smart contracts 26

Slide 27

Slide 27 text

ERC {20 | 721} ERC 20 ● fungible ● ~ implemented by a lot of cryptocurrencies ● looks like fiat currencies ● can be sliced into smaller fragments ERC 721 ● not fungible (= unique) ● cannot be sliced ● “manufactured collectible” 27

Slide 28

Slide 28 text

types of tokens payment tokens ● dedicated blockchains ● inherent value ● for financial transactions ● real cryptocurrencies security/equity tokens ● represent assets ● can be seen like securities, derivatives, ... ● used in ICO 28 utility tokens ● provided access to services ● dedicated for use cases

Slide 29

Slide 29 text

bubbling world 29 ETH vs ETC ● June 17, 2016 ● hack of TheDAO ● ~ 3 600 000 stolen ETH (~ 70 000 000 USD at the time) ● → hard fork to cancel the theft (Ethereum) ● a part of the community refused ● = birth of Ethereum Classic (no fork)

Slide 30

Slide 30 text

bubbling world 30 BTC vs BTG vs BCH... ● upgrade of BTC blockchains with SegWit to increase speed of transactions and blocks sizes ● → contentions in community ● = hardfork (07/2017) giving birth to Bitcoin Cash ● need to mine bitcoins without ASIC ● = hardfork (10/2017) giving birth to Bitcoin Gold

Slide 31

Slide 31 text

really bubbling world 31 (ノಥ益ಥ)ノ ... vs BCHABC vs BCHSV ● November 2018 ● a civil war between two camps... ● conflict between rich people about vision, control, influence (and also block sizes) ● Craig Wright vs Roger Ver (and the rest of the world) ● hashwar to get rid of the opponents ● = hardfork splitting Bitcoin Cash to Bitcoin ABC and Bitcoin SV

Slide 32

Slide 32 text

not a fork story... but a spaghetti story (-‸ლ)

Slide 33

Slide 33 text

Bitcoin ● January 3, 2009 ● limited quantity to 21 millions of BTC ● 1 BTC = 6 544.28 USD ● 10’5’’ blocktime ● 12.50 BTC + Tx Fees rewarded ● hashrate of 47.46 Ehash/s ● proof of work (Hashcash) Grandpa cryptocurrency 33 BitInfoCharts (11/07/2018)

Slide 34

Slide 34 text

Bitcoin ● no privacy ● not anonymous ● too few minable without mining pool ● massive speculation ● very bubbling ● network consumption ~ 1% of world energy consumption Grandpa cryptocurrency 34

Slide 35

Slide 35 text

Monero ● April 18, 2014 ● unlimited quantity of XMR ● 1 XMR = 111.6 USD ● 2’2’’ blocktime ● 3.63 XMR + Tx Fees rewarded ● hashrate of 502 Mhash/s ● proof of work (CryptoNight) “secure, private, untraceable” (today) 35 BitInfoCharts (11/07/2018)

Slide 36

Slide 36 text

Monero ● sender address is protected (Ring Signatures) ● receiver address is protected (Stealth Addresses) ● transaction balance is protected (Ring Confidential Transactions) ● broadcast of transactions is protected (Kovri) ● XMR balances not related to public addresses “secure, private, untraceable” (today) 36

Slide 37

Slide 37 text

ZCash ● October 28, 2016 ● limited quantity to 21 millions of ZEC ● 1 ZEC = 130.88 USD ● 2’32’’ blocktime ● 12.50 ZEC + Tx Fees rewarded ● hashrate of 2.27 Ghash/s ● proof of work (Equihash) Snowden approved 37 BitInfoCharts (11/07/2018)

Slide 38

Slide 38 text

ZCash ● sender and receiver addresses are shielded (z-addr) or not (t-addr) ● z-addr are protected with a Non Interactive Zero Knowledge Proof method (zk-SNARK) ● public blockchain but private project driven by the Zerocoin Electric Coin Company Snowden approved 38

Slide 39

Slide 39 text

Ether ● July 30, 2015 ● unlimited quantity of ETH ● 1 ETH = 220.11 USD ● 14.3’’ blocktime ● 3 ETH + Tx Fees rewarded ● hashrate of 238 Thash/s ● proof of work (Ethash) Ethereum powered 39 BitInfoCharts (11/07/2018)

Slide 40

Slide 40 text

Ether Ethereum powered 40 ● token for the 1st blockchain of 2nd generation ● cryptocurrency in use for smart contracts

Slide 41

Slide 41 text

Basic Attention Token Be brave 41 ● May 31, 2017 ● hosted on Ethereum ● 1 BAT = 0.33 USD ● created by Brendan Eich ● integrated to Brave browser ● designed to value and price humain attention (for fair ads) ● 30’’ to raise 35 millions USD during the ICO

Slide 42

Slide 42 text

42 ● ICO from 12/01/2017 to 01/01/2018 ● hosted on Ethereum ● 1 CO2 = 3.81 USD ● trade the carbon using tokens ● try to build a “blockchain green ecosystem” (not a joke) Climatecoin Save the planet, trade the carbon

Slide 43

Slide 43 text

Ðecentralized apps

Slide 44

Slide 44 text

the 2nd generation of blockchains ● 2013: Ethereum ○ Vitalik Buterin ○ was only 19 y.o.! ● blockchains are: ○ decentralized ○ replicated (distributed) ○ not regulated ○ use tokens ○ have blocks with financial transactions ● and what if we put programs in blockchains? ○ Ðecentralized applications The Ethereum Experience 44

Slide 45

Slide 45 text

programs in blockchain! 45 ● use of virtual machine ○ Ethereum Virtual Machine (EVM) ● transactions have bytecode in payload ● execution of programs are conditioned ○ tokens are used to process instructions ■ ETH, ETC, ... ○ each instruction has a cost ■ gas ● nodes of network check outputs of programs ● Ethereum can be seen as kind of “slow” database/register ● Ethereum Yellow Paper ● Gas Costs from Yellow Paper

Slide 46

Slide 46 text

a gas story 46 ● gas is used so as to evaluate: ○ costs of instructions ○ fees of transactions (TxFees) ○ value of transactions earned by miners final cost of the transaction, earned by miner wei = unit for gas the amount of gas to burn to process the program of the smart contract, which depends to the amount of code to process ● the lower the price is, the less gainful the transaction is, the later the transaction will be mined ● allow to involve the cost of the transaction

Slide 47

Slide 47 text

TxFees in Ether based on gas 47 Ether = Tx Fees = Gas Limit * Gas Price ETH Gas Station

Slide 48

Slide 48 text

a new paradigm 48 ● “Old” paradigms ○ sequential ➞ 1 computer processing series of N instructions ○ parallel ➞ 1 computer processing K (in N) instructions at the same time (threads) ○ distributed ➞ X computers processing samples of the N instructions ● Decentralized paradigms ● X computers processing at the same time the N instructions ● programs are duplicated in computers ● no more unique server or backend which hosts the program →no authorities to trust →no centralisation to fail →but slower than centralized solutions

Slide 49

Slide 49 text

layers of Ðapps 49 The Ethereum Experience

Slide 50

Slide 50 text

architecture of web Ðapps Ethereum blockchain (dev) Ethereum network (prod) web server smart contract sources (.sol) smart contract ABI (.js, .json) web app (.html, .css, .js, ...) hosting compilation inclusion deployment web browser

Slide 51

Slide 51 text

logic with smart contracts 49 ● have balance of tokens and unique address ● the code is law ● hosted in the blockchain ● once deployed, cannot be ○ removed ○ modified ● if bugs or flaws appear ○ write a new contract! 51 More about smart contracts ÐApps on Ethereum with Solidity

Slide 52

Slide 52 text

need to optimize Ðapps on blockchains 52 ● Ðapps must be optimized ○ choose the best functions ○ be aware with storage of data ○ use the most suitable data types ○ decrease complexity of functions ● If the program is: ○ dirty ○ heavy ○ not enough well written ➔ may burn a lot of gas ➔ must be expensive in Ether

Slide 53

Slide 53 text

use cases

Slide 54

Slide 54 text

which use cases? 54 ● payment ○ e.g. Keplerk ● products tracking ○ e.g. IBM Food Trust ○ e.g. Connecting Food ● fight against censorship, fake news... ○ e.g. PUBLIQ ● citizenship ○ e.g. online vote using blockchains ● insurance ○ e.g Etherisc ● documents and securities transfer, ...

Slide 55

Slide 55 text

laws

Slide 56

Slide 56 text

governments and states may be scared 56 ● forbidden ○ e.g Algeria, Bolivia, China, Ecuador, Egypt, Iran, Morocco ● more or less regulated ○ e.g Canada, France, Singapore, USA ● supported ○ e.g Estonia, Japan ● used for national cryptocurrencies ○ e.g Estonia (Estcoin?), Venezuela (Petro)

Slide 57

Slide 57 text

conclusion

Slide 58

Slide 58 text

blockchains & cryptocurrencies 58 ● are not yet mature enough ● may be censored, controlled or regulated by governments ● are occulted by the hype around Bitcoin (-_-)” ● enhance and boost innovations and technical challenges (ノ^_^)ノ we can think using a new framework: decentralization

Slide 59

Slide 59 text

thanks!

Slide 60

Slide 60 text

links (⌐□_□)

Slide 61

Slide 61 text

Tools ● BitInfoCharts ● Coinbase ● ETH Gas station ● Ethereum Natural Specification Format ● Ethereum Network Status ● Ethernodes ● Etherscan ● Etherscan ByteCode to Opcode Disassembler ● Etherscan gas price ● Ganache ● Geth ● Infura ● Loom

Slide 62

Slide 62 text

Tools ● Metamask ● Mist ● Monero Blockchain Explorer ● Open Zeppelin ● Porosity ● Remix IDE ● State of the ÐApps ● Truffle ● Web3 ● Zchain

Slide 63

Slide 63 text

References ● 9 Types of Consensus Mechanisms That You Didn’t Know bout, Daly Bit ● A 101 Noob Intro to Programming Smart Contracts on Ethereum, ConsenSys ● Basic Attention Token, basicattentiontoken.org ● Basic Attention Token (BAT), Brave Software ● Bitcoin: A Peer-to-Peer Electronic Cash System, Satoshi Nakamoto ● Bitcoin: The Cryptoanarchists’ Answer to Cash, Morgen E. Peck ● Bitcoin Cash’s ‘Mining War’ Escalates as Blockchain Hard Fork Approaches, Nikhilesh De ● Bitcoin Is Terrible for the Environment, Emily Atkin ● Bit Gold and Bitcoin, In Search Of Satoshi ● Bloc Genesis, bitcoin.fr ● Blockchain Security Mechanisms, Shaan Ray ● Climatecoin, climatecoin.io ● Create Your Own Crypto-currency with Ethereum, ethereum.org ● Crossing Over to Web3 - An Introduction to Decentralised Development, Luke Hedger ● CryptoKitties, cryptokitties.co ● Cryptomonnaies - mode d’emploi en 20’, Pierre-Yves Lapersonne ● ÐApps on Ethereum with Solidity, Pierre-Yves Lapersonne ● Decentraland, decentraland.org ● Demystifying Hashgraph: Benefits and Challenges, Yaoqi Jia ● Ethash, github.com/ethereum Web sites visited on 11/23/2018

Slide 64

Slide 64 text

References ● Ethereum ERC 721 vs ERC 20, Patrick Goh ● Ethereum: Ether, Ether Gas, Gas Limit, Gas Price & Fees [...], Sudhir Khatwani ● Ethereum “Gas” - How it works, steemit.com ● Everything You Need to Know About [...] Sapling Upgrade [...], John Westbrook ● Full-stack smart contract development, Júlio Santos ● Hashgraph wants to give you the benefits of blockchain without the limitations, Samantha Stein ● Hedera Hashgraph, hederahashgraph.com ● How to build your own Ethereum based ERC20 Token and launch an ICO in next 20 minutes, Sandeep Panda ● Hyperledger, hyperledger.org ● Introduction to Smart Contracts, solidity.readthedocs.io ● Kovri, getkovri.rg ● La Révolution des Blockchains, Pierre-Yves Lapersonne ● Ledger Legends, ledgerlegends.com ● Les bitcoins dans les bureaux de tabac, une information fumeuse, Maxime Vaudano & Pierre Breteau ● Les cryptomonnaies sont-elle halal ?, Gregory Raymond ● Multisignature, en.bitcoin.it ● Proof of Work vs Proof of Stake: Basic Mining Guide, blockgeeks.com ● Reversing EVM bytecode with radare2, Fedor Sakharov ● Ring Confidential Transactions, Shen noether, Adam Mackenzie and Monero Core Team ● Ring signature, wikipedia.org Web sites visited on 11/23/2018

Slide 65

Slide 65 text

References ● Stealth Address and Key Management Techniques in Blockchain Systems, N. Courtois, R. Mercer ● Swarm, swarm-guide.readthedocs.io ● The Cyphernomicon, nakamotoinstitute.org ● The Ethereum Experience, Ethereum ● The Next Generation of Distributed Ledger Technology, iota.org ● The Story of the DAO - Its History and Consequences, Samuel Falkon ● The Tangle, Serguei Popov ● The Tangle: an Illustrated Introduction, Alon Gal ● Types of Consensus Protocols Used in Blockchains, Evan Tan ● Types of tokens. The four mistakes beginner crypto-investors make, ICOscoring ● Understanding Blockchain Fundamentals, Part 1: Byzantine Fault Tolerance, Georgios Konstantopoulos ● Understanding Segregated Witness, Jimmy Song ● Vie privée, telle est ma devise, Pierre-Yves Lapersonne ● W-ETH, weth.io ● Walking Through the ERC721 Full Implementation, Karen Scarbrough ● WBTC, www.wbtc.network ● What are Sidechains?, Shaan Ray ● When I say mine you say Coinhive, Pierre-Yves Lapersonne ● Whisper, github.com/ethereum Web sites visited on 11/23/2018

Slide 66

Slide 66 text

Credits ● Logo of AudioCoin - ?, modified with GIMP ● Logo of Augur - AugurProject, CC BY-SA International 4.0, modified with GIMP ● Logo of Basic Attention Token - Bradley Richter, CC BY-SA International 4.0, modified with GIMP ● Logo of Brave - Copyright © Brave Software Inc.. All Rights Reserved, modified with GIMP ● Logo of Bitcoin - Bitboy, public domain, modified with GIMP ● Logo of Bitcoin ABC - ?, modified with GIMP ● Logo of Bitcoin Cash - Amaury Sechet, CC0 1.0 Universal Public Domain Dedication, modified with GIMP ● Logo of Bitcoin Gold - Bitcoin Gold, public domain, modified with GIMP ● Logo of Bitcoin SV - ?, modified with GIMP ● Logo of climatecoin - ?, modified with GIMP ● Logo of Code d’Armor - Copyright © Code d'Armor. All Rights Reserved. ● Logo of CSS3 - icones8.fr ● Logo of Dash - dash.org, CC BY-SA International 4.0 ● Logo of Dogecoin - Copyright © The Ðogecoin Project. All Rights Reserved, modified with GIMP ● Logo of ENSSAT - Copyright © ENSSAT. All Rights Reserved. ● Logo of eosio - eosio, block.one, public domain, modified wih GIMP ● Logo of Ethereum - Ethereum Foundation, CC BY Unported 3.0, modified with GIMP ● Logo of Ethereum Classic - Ethereum Classic, CC0 1.0 Universal Public Domain Dedication, modified with GIMP ● Logo of Filecoin - Copyright © Protocol Labs. All Rights Reserved, modified with GIMP ● Logo of Ganache - Copyright © Consensys. All Rights Reserved, modified with GIMP ● Logo of Gnosis - Copyright © Gnosis Ltd. All Rights Reserved, modified with GIMP ● Logo of Golem - Copyright © Golem Factory GmbH. All Rights Reserved, modified with GIMP ● Logo of HTML5 - Copyright © W3C, CC BY 3.0 ● Logo of IOTA - Copyright © IOTA Foundation. All Rights Reserved, modified with GIMP ● Logo of Kairos - Copyright © Kairos AR, Inc. All Rights Reserved. ● Logo of JavaScript - javatpoint.com, modified with Gimp ● Logo of Litecoin - Losh1212, CC BY-SA International 4.0, modified with GIMP ● Logo of MetaMask - metamask.io, modified with GIMP ● Logo of Monero - The Monero Project, CC BY 3.0, modified with GIMP ● Logo of Ripple - Ripple, public domain, modified with GIMP ● Logo of Solidity - Copyright © Ethereum Foundation, CC BY-SA 3.0, modified with GIMP ● Logo of Truffle - Copyright © Consensys. All Rights Reserved, modified with GIMP ● Logo of ZCash - Copyright © ZCash. All Rights Reserved, modified with GIMP ● Pictures - Freepik, Flaticon Basic License ● Bitcoin free icon - Pixel Buddha, Flaticon Basic License ● Exploding free icon - OCHA, CC 3.0 BY ● Invisible person of clothes free icon - Freepik, Flaticon Basic License ● Troll Face Png Available In Different Size - freeiconspng.com ● Runner silhouette running fast free icon - Freepik, Flaticon Basic License

Slide 67

Slide 67 text

No content