Slide 1

Slide 1 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Blockchain The technologies behind Bitcoin, Ethereum, ICOs… Aaron Li [email protected] Oct 28, 2017

Slide 2

Slide 2 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Me & Blockchain • Miner 2011-2012 • Built several mining clusters and tools • Evangelist / supporter 2011 - • Investing / trading occasionally • Interested in core tech / products / apps https://www.linkedin.com/in/aaronqli/

Slide 3

Slide 3 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) What is Bitcoin? Ethereum? ICO? Blockchain?

Slide 4

Slide 4 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) History: 2008 - Present Tech: P2P Distributed Cryptographic Ledger Coins: Bitcoin, Ethereum, Litecoin, … Applications: Finance, Law, Businesses, Computing, … Jobs: Security, Infrastructure, Trading, Applications, …

Slide 5

Slide 5 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Basic Technical Topics • Blockchain Overview • Proof of Work, Transactions, Consensus • Bitcoin • Mining: Hardware, Pools, Mechanism… • Ethereum • Ether, Smart Contract, Applications • Others: Litecoin, ICO, …

Slide 6

Slide 6 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) History

Slide 7

Slide 7 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2008 - Bitcoin Paper Satoshi Nakamoto image from: Google Image

Slide 8

Slide 8 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) https://bitcoin.org/bitcoin.pdf

Slide 9

Slide 9 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) • Decentralised digital currency • Backed by math & algorithms • No government / company control • Low fee P2P international transfer • “Anonymous” & verifiable transactions What is Bitcoin? https://youtu.be/Gc2en3nHxA4 https://www.weusecoins.com/

Slide 10

Slide 10 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) What is Bitcoin? • 1 Bitcoin = 1 BTC = 1 (Ƀ, ฿, …) • BTCs are stored in an address • e.g. 3J98t1WpEZ73CNmQviecrnyiWrnqRhWNLy • Max circulation: 21 millions (by ~2033) • Minimum unit: 0.00000001 (1e-8) = 1 satoshi • Transaction = one address send BTC to another

Slide 11

Slide 11 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) image from: weusecoins.com

Slide 12

Slide 12 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) image from: weusecoins.com

Slide 13

Slide 13 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2009 - Early days Open Source Software & early supporters

Slide 14

Slide 14 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) bitcoin.org July, 2009 image from: archive.org

Slide 15

Slide 15 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) image from: archive.org

Slide 16

Slide 16 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin in 2009 - 2011 • No applications • People just doing it for fun • Almost no one accepts Bitcoin • First community: bitcointalk.org

Slide 17

Slide 17 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin in 2009 - 2011 • 10,000 Bitcoins = 2 pizzas • Alpaca Socks • First vendor accepting Bitcoin image from: Google Image search

Slide 18

Slide 18 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2011: Tipping Point https://bitcoincharts.com/charts/ mtgoxUSD#czsg2010-10-29zeg2012-10-30ztgSzm1g10zm2g25zvzcv

Slide 19

Slide 19 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) What happened in 2011? GPU Mining Mass Media Reports Alternatives & Forks (Litecoin, etc.)

Slide 20

Slide 20 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2011: My first miner 15 GPUs (HD5850) Power: 4kWh Cooling: Water / Fan @ Balcony & Tent

Slide 21

Slide 21 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2012 - 2015 + Speculators (non-tech people) + Exchanges (- MtGox) + Merchants (Shipito, Overstock, …) + Services (POS, Wallets, …)

Slide 22

Slide 22 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2012 - 2015 https://bitcoincharts.com/charts/ bitstampUSD#czsg2012-10-29zeg2015-10-30ztgSzm1g10zm2g25zvzcv

Slide 23

Slide 23 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2015 - Now The Biggest Thing “Decentralised Turning Complete Virtual Machine” image from: ethereum.org

Slide 24

Slide 24 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) What is Ethereum? • Decentralised Computer • Run “Smart Contracts” (programs) • Turing-complete machine • Use Ether (ETH) to operate • Not a currency, but is treated as one https://ethereum.org/

Slide 25

Slide 25 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) 2015 - Now: Other Big Things ICOs Ripple, Tether, BitGo, Qtum, … Coinbase & GDAX Regulations: SEC, China, US Laws …

Slide 26

Slide 26 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Now https://coinmarketcap.com/

Slide 27

Slide 27 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Trading Coinbase: Good for starters. Easiest to setup. High fees (1-5%) Use credit card / banks. Need ID verification. Support BTC, ETH, LTC in USA, Canada, Australia, Singapore, most Europe USA based (reports earning to IRS!)

Slide 28

Slide 28 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) GDAX: Professional version of Coinbase; Low fees (0% - 0.3%) limit/stop orders, depth graph, order book, history, … margin trading (temporarily unavailable) USA based (reports earning to IRS!) Trading

Slide 29

Slide 29 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Trading Bitstamp: Professional exchange, low fees (0% - 0.3%) Supports BTC, XRP, LTC, ETH and many fiat currencies

Slide 30

Slide 30 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Others See bitcoincharts.com

Slide 31

Slide 31 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Initial Coin Offering (ICO) • Similar benefits compared to IPO: • Allow general public to participate • Raise large sum of money ($1M’s - $100M’s) • Public trust, public audit & examination New way to raise money for a project / company

Slide 32

Slide 32 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) • Better than IPO in some areas: • Much less complicated legal paperwork • Can be started by any person / team • Much easier for the public participate & trade Initial Coin Offering (ICO) Successes: Ethereum, Filecoin, Bancor, Tezos, BAT

Slide 33

Slide 33 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Initial Coin Offering (ICO) • Issues, compared to IPO: • Many projects are scams / impossible to deliver • No regulations exist to sue / recoup damages • No supervision to project owners Failures: DAO, and many others

Slide 34

Slide 34 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Initial Coin Offering (ICO) • Usual Process: • Get a team • Write a white paper • Get people to talk about it • Set up a beautiful website • ICO!

Slide 35

Slide 35 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Initial Coin Offering (ICO) • Future talks: • What is expected in whitepapers? • Open source tools for designing / launching ICO • Case studies • For startups: Future of ICOs v.s. VC?

Slide 36

Slide 36 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Career Opportunities Friends’ companies with successful ICO hiring engineers, etc. • Orchid ($4.7M, a16z, etc.) • WeTrust ($>10M) • doc.ai • many more…

Slide 37

Slide 37 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Tech

Slide 38

Slide 38 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Blockchain Goal: Design a distributed ledger such that • All transactions are recorded and verifiable • Owners can remain anonymous • No central authority required (“trustless”) • Resistant to malicious attacker • Participants are incentivised and rewarded

Slide 39

Slide 39 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Blockchain Solution: Store transactions distributively as a chain of blocks (“blockchain”) Issues: How to (efficiently) define create verify store transactions? track

Slide 40

Slide 40 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Blockchain Issues: How do we make sure the transactions are respecting every participant’s privacy? resilient to attackers? robust against malicious users?

Slide 41

Slide 41 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain • Fully decentralised network • Each node is a user • Some nodes are miners • Miners: nodes that verify transactions between users • Miners are incentivised by two types of rewards • Transaction fees • Validating a new block (hard) image from: Google Image Search

Slide 42

Slide 42 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Address: an object for receiving Bitcoins Address = Hashes of public key See this article of details • Controlled by corresponding private key • Key pairs can be arbitrarily generated (address too) • Intended to be used only once define and create transactions

Slide 43

Slide 43 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Transaction: A sends some X coins to B Process: 1. A controls an address P with X coins
 2. A obtain an address Q controlled by B
 (B could generate Q with a new private key)
 3. A creates a transaction T
 transfer X Bitcoins from P to Q
 4. A signs T using private key of P Define and create transactions

Slide 44

Slide 44 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain verify transactions • What about all transactions before that? • How do we know A did not spend his Bitcoin twice? • How do we know A has X Bitcoins before sending them to B? Single transaction: verifiable using hashes / public key (To be discussed later in “blocks”)

Slide 45

Slide 45 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Transactions Example: 1 Bitcoin transferred through owner 0, 1, 2, 3, … 1 Bitcoin …. track transactions image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 46

Slide 46 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Transactions • Can have multiple in/out • Combine fractions / divide coins • Unspent coins are stored in new address 0.1 BTC 1.3 BTC …. 0.5 BTC … track transactions image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 47

Slide 47 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain 1. Store transactions in blocks 2. Simplify the blocks (just enough to verify things) 3. Store blocks to all nodes in network How to efficiently store and verify transactions?

Slide 48

Slide 48 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain blockchain = A chain of blocks Bitcoin Block = Block Header + (Hashes of) Transactions Header = Last Block’s Hash + Nounce + (Root Hash of Transactions) Nounce = a sequence of bytes to show proof-of-work track transactions image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 49

Slide 49 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Issue: Most nodes don’t want to store all transactions They only want to verify a transaction is in the blockchain

Slide 50

Slide 50 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Goal: minimise information needed to verify a transaction Solution: Merkle tree image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 51

Slide 51 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Bitcoin Merkle tree construction: 1. Compute hashes of transactions in a block 2. Compute hashes of each pair of hashes recursively 1. Load / verify root hash R 
 2. Load H, the hash of T
 P(H), the ancestors of H
 S(P(H)), the siblings of P(H)
 3. Reproduce and verify 
 R and P(H) using these To verify a transaction T is in the blockchain: image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 52

Slide 52 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain More on Merkle tree A Certified Digital Signature, R. Merkle (written in 1979) Proceeding CRYPTO '89 Proceedings on Advances in cryptology Protocols for public key cryptosystems, R. Merkle, 1980 IEEE Symposium on Security and Privacy Used in a wide range of applications • version controls (Git, …) • file systems (IPFS, ZFS, …) • databases (Cassandra, Dynamo, …) • P2P systems (BitTorrent, …) • and many more image from: Google Search

Slide 53

Slide 53 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Bitcoin block chain, with Merkle Tree Miners generate blocks, and validate transactions image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 54

Slide 54 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Proof-of-work: 1. a block is valid iff hash (SHA2) of block header has N leading zero bits
 (miners must find it by solving the value of nounce by brute-force) 2. longest block chain is the only valid block chain 3. once a valid block is found, it is propagated to all nodes controls generation speed of new blocks (~1 block / 10 minutes) A valid nounce is (artificially made) hard to compute image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 55

Slide 55 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain Blocks and transactions are immutable Transactions are secured by private/public keys resilient to attackers? resilient to forgery: resilient to DDOS: Miners can charge transaction fees

Slide 56

Slide 56 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain If someone wants to alter their own past transactions (using private keys), and create fake history, he must…. 1. Find the blocks which contain those transactions 2. Change the transactions and recompute Merkle trees 3. Re-compute all blocks on his own until his chain is longest In the meantime, other nodes continue to produce new blocks… Impossible to catch up unless he has >50% CPU of whole network! robust against malicious users?

Slide 57

Slide 57 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) respecting every participant’s privacy? Bitcoin Blockchain image from: [Nakamoto, 2008] (Bitcoin paper)

Slide 58

Slide 58 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Bitcoin Blockchain incentives? Miners are rewarded with… 1. X Bitcoins, for each valid new block found 
 (manifested by attaching a reward transaction in new block) 2. Transaction fees, for all transactions in the new block Bitcoin has controlled supply, so X is halved every 210000 blocks Year 2008: X = 50 210000 blocks ~= 4 years

Slide 59

Slide 59 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) General Blockchain : State of blockchain at timestamp t : The block, containing all (general) transactions : State transition function : Block finalisation function See details in Ethereum yellow paper image from: [Wood, EIP-150 2017] (Ethereum Yellowpaper)

Slide 60

Slide 60 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Ethereum Instead of wasting CPUs for computing hashes of proof-of-work, let nodes do some useful work! • Introduced new concepts: accounts, contracts, messages, … • Transactions: define function calls, execution model, data, … • Proof-of-work: still rely on nounce, but deprecating soon • (Theoretically) much broader applications • Not meant to be a currency, but people got crazy

Slide 61

Slide 61 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Ethereum Resources: Ethereum Wallet + Mist Browser & Serverless app tutorial White paper: https://github.com/ethereum/wiki/wiki/White-Paper Yellow paper: https://ethereum.github.io/yellowpaper/paper.pdf Programming: Build Helloworld DApp (decentralised app) DApps for Beginners: https://dappsforbeginners.wordpress.com/

Slide 62

Slide 62 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) Litecoin Based on Bitcoin. Designed to make GPU/FPGA/ASIC ineffective • 2.5 minutes per new block, instead of 10 minutes • Proof-of-work: use scrypt hashing algorithm, instead of SHA256 scrypt: • time-memory tradeoff: parallelisation becomes ineffective • fast with large memory, and slow with little memory • See paper for details


Slide 63

Slide 63 text

Copyright 2017 Aaron Li ([email protected]) Copyright 2017 Aaron Li ([email protected]) More • Mining: history, hardware, future alternatives • Ethereum: technical design, programming, applications
 • ICOs: applications and technical advancements • Blockchain: enterprise applications • and more… Topics for future talks