1 of 40

Cryptocurrencies to Cryptokitties and�Beyond

MICHAEL BIRCH

CANCON 2019

2 of 40

Blockchain

Cryptocurrencies

Smart

Contracts

Future

3 of 40

Cryptocurrencies

Litecoin

Ether

Ripple

Bitcoin

4 of 40

So Many Cryptocurrencies…

5 of 40

Cryptocurrencies

6 of 40

Moving money between people

Alice

Bob

Carol

$

$

7 of 40

“Moving” money between people

Alice

Bob

Carol

  • Alice pays Bob $10
  • Bob pays Carol $5
  • Bob pays Alice $100
  • Alice pays Carol $30

8 of 40

“Moving” “money” between people

Alice

Bob

Carol

  • Alice pays Bob 10 BTC
  • Bob pays Carol 5 BTC
  • Bob pays Alice 100 BTC
  • Alice pays Carol 30 BTC

9 of 40

“Moving” “money” between people

Alice

Bob

Carol

  • Alice pays Bob 10 BTC
  • Bob pays Carol 5 BTC
  • Bob pays Alice 100 BTC
  • Alice pays Carol 30 BTC

  • Alice pays Bob 10 BTC
  • Bob pays Carol 5 BTC
  • Bob pays Alice 100 BTC
  • Alice pays Carol 30 BTC

  • Alice pays Bob 10 BTC
  • Bob pays Carol 5 BTC
  • Bob pays Alice 100 BTC
  • Alice pays Carol 30 BTC

10 of 40

Technical Requirements

  • Cannot erase lines in the ledger
  • Cannot forge lines in the ledger
  • Cannot copy lines in the ledger
  • Eventually everyone agrees on the same ledger

11 of 40

Technical Solutions

  • Cryptographic hash functions
  • Cryptographic signatures
  • Proof of work consensus

12 of 40

Cryptographic Hash Functions

Hash Function

Fixed-length output

13 of 40

Cryptographic Hash Functions

The quick brown fox jumps over the lazy dog

0x01718CEC35CD3D796DD00020E0BFECB473AD23457D063B75EFF29C0FFA2E58A9

Blake2b256

Hash

14 of 40

Cryptographic Hash Functions

The quick brown fox jumps over the lazy doge

0x0A545439DFC88BB3F3A6F45D2ABC13405680466E71BB3FBEDE041211ACEDA5BD

Blake2b256

Hash

WOW

Such jump

15 of 40

Cryptographic Hash Functions

  • Similar input, completely different output

  • Hashes are like a “fingerprint” of the input data

0x01718CEC35CD3D796DD00020E0BFECB473AD23457D063B75EFF29C0FFA2E58A9

0x0A545439DFC88BB3F3A6F45D2ABC13405680466E71BB3FBEDE041211ACEDA5BD

16 of 40

Building our Cryptocurrency:�The Blockchain

  • Each block identified by the hash of the data it contains
  • Blocks referrer to previous block by their hash

0AFE12…

3BEF5D…

0AFE12

FFC289…

3BEF5D

67343A…

FFC289

17 of 40

Building our Cryptocurrency:�The Blockchain

  • Immutable data structure
    • Change any data, changes hash, breaks chain

77FFDB…

---

3BEF5D…

0AFE12

FFC289…

3BEF5D

67343A…

FFC289

18 of 40

Technical Requirements

  • Cannot erase lines in the ledger
  • Cannot forge lines in the ledger
  • Cannot copy lines in the ledger
  • Eventually everyone agrees on the same ledger

19 of 40

20 of 40

Cryptographic Signatures

Private Key

Signing Algorithm

Signature

21 of 40

Cryptographic Signatures

Signature

Public Key

Signature Verification Algorithm

True or False

22 of 40

Cryptographic Signatures

  • Data + signature = verified data
    • Cannot be produced by anyone except those with private key
    • Can be check by anyone (public key is public)
  • Better than traditional signatures
    • Each signature is different for different data
  • Signing the hash of data is as good as signing data itself
    • (But more efficient)

23 of 40

Building our cryptocurrency:�Signing transactions

  • Identities are public keys
  • Spending tokens requires valid signature
  • Each transaction is unique and not repeatable
    • “Unspent transaction output” (UTXO)

24 of 40

Technical Requirements

  • Cannot erase lines in the ledger
  • Cannot forge lines in the ledger
  • Cannot copy lines in the ledger
  • Eventually everyone agrees on the same ledger

25 of 40

Proof of Work Consensus

  • Alter hash by including random number in the block
    • Goal to have many zeros at the start
    • Obtain goal with guess and check
  • Choose parent block with most “work” behind it (longest / heaviest chain)
  • Number of required zeros determined by “difficulty”
    • Difficulty scaled to produce blocks at a consistent time, based on “hashing power”

26 of 40

Proof of Work Consensus

(The quick brown fox jumps over the lazy dog, 122829)

0x000018DCE19B2318E7C5BAC4D4925399865242ACA82CC0A7734D3E1EAAF77A94

Blake2b256

Hash

27 of 40

Proof of Work Consensus

(The quick brown fox jumps over the lazy dog, 3500073)

0x0000007EDE604250E4700B2C9439CCBF5DB91DDD7830F0DA464B3C7C5F31CF3B

Blake2b256

Hash

28 of 40

Proof of Work Consensus

0AFE12…

3BEF5D…

0AFE12

FFC289…

3BEF5D

67343A…

FFC289

BBAC55…

3BEF5D

CBD647…

BBAC55

425DCA …

67343A

29 of 40

Technical Requirements

  • Cannot erase lines in the ledger
  • Cannot forge lines in the ledger
  • Cannot copy lines in the ledger
  • Eventually everyone agrees on the same ledger

30 of 40

Applications of Cryptocurrencies

  • Criminal activity
  • Volatile stock market replacement
  • “Digital gold”
    • “Hodl”

  • Anti-application: currency replacement
    • Venezuela Petro (failure)

31 of 40

What now?

  • Blocks could contain any data, not just money…

32 of 40

CryptoKitties

33 of 40

Ethereum

  • Blockchain platform replicating virtual machine, not just ledger
  • Underlying technology the same
    • Hash-linked list of blocks
    • Signed transactions
    • Proof-of-work consensus
  • Programs called “smart contracts”

34 of 40

Smart Contract Applications�(Speculative)

  • Verified computation between mutually distrustful parties

  • Supply chain
  • Escrow
  • Gambling
  • Insurance / Compliance
    • Internet of Things
  • Patents

35 of 40

Beyond:�Problems with blockchain today

  • Scale
    • “The ‘Ethereum computer’ has about the same power as one of the rare 90’s smartphones; so it can’t really do much more than some very trivial things.”

36 of 40

Beyond:�Problems with blockchain today

  • Cost
    • Price volatility

37 of 40

Beyond:�Problems with blockchain today

  • Energy usage and electronic waste
    • “bitcoin currently consumes [an amount of energy] comparable to the total energy consumption of the Czech Republic, a country of 10.6 million people.”
    • “The [application-specific integrated circuits (ASICs)] quickly go obsolete, often in just under two years, and they can’t really be repurposed for anything other than mining.”

38 of 40

Beyond:�New innovations

  • Scale
    • Sharding
    • Blockdag (directed acyclic graph)
    • WebAssembly (wasm)
  • Energy usage and waste
    • Proof-of-stake, other consensus algorithms

39 of 40

Beyond:�Blockchain Governance

  • Challenges with immutability
    • Ethereum vs Ethereum Classic
      • “Code is law”
    • Child abuse on Bitcoin Satoshi Vision (BSV)

  • How do “smart contracts” relate to legal contracts?
  • What jurisdiction does a “world computer” belong to?

40 of 40

Summary

  • Blockchain uses cryptography and consensus protocols to securely replicate a changing data structure over a decentralized collection of computers
  • Main use cases:
    • Transparent, secure, verifiable computation
    • E.g. financial transaction
  • Still many technical and governance challenges before mass adoption