Alex Melville Securing and Running A Multisig...

27
Ethereum at BitGo Securing and Running A Multisig Ethereum Wallet Alex Melville

Transcript of Alex Melville Securing and Running A Multisig...

Page 1: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

Ethereum at BitGoSecuring and Running A Multisig Ethereum Wallet

Alex Melville

Page 2: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

Alex Melville (Technical Lead on the Coins Team)

2

github.com/Melvillian

Page 3: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

Today’s Plan

3

Questions!

Page 4: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

BitGo: 2-of-3 Multi-Signature Wallets

No single point of failure!

BITGO KEYCUSTOMER KEY EMERGENCY (BACKUP) KEY

4

Page 5: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

Supported Coins and Tokens

ETH

ETHEREUM

BTC

BITCOIN

LTC

LITECOIN

BCH

BITCOIN CASH

BTG

BITCOIN GOLD ZCASH

ZEC XRP

XRP

XLM

STELLARDASH

DASH

Augur (REP)

Basic Attention Token (BAT)

Bread (BRD)

Civic (CVC)

Golem (GNT)

Kyber Network (KNC)

Numeraire (NMR)

OmiseGo (OMG)

0x (ZRX)

Maker (MKR)

Worldwide Asset eXchange (WAX)

Zilliqa (ZIL)

iShook (SHK)

Rialto (XRL)

Kin (KIN)

Salt (SALT)Change (CAG)

Power Ledger (POWR)

AppCoins (APPC)

Serenity (SRNT)PlusCoin (PLC)

Linker Coin (LNC)

Snovio (SNOV)

Status Network Token (SNT)

Decision Token (HST) Propy (PRO)

AirSwap (AST)

WaltonChain (WTC)

Storj (STORJ)

SwissBorg (CHSB)

Aragon (ANT)

Aelf (ELF)

Populous (PPT)

OPTin Token (OPT)AION (AION)

Celsius (CEL)

Sentinel Protocol (UPP)

ANA (ANA)

WeTrust (TRST)

Indorse (IND)

Dent (DENT)

Polymath (POLY)

TrueUSD (TUSD)

Bancor (BNT)

Colu Local Network (CLN)

DAOstack (GEN)

Storm (STORM)

Gnosis (GNO)

Pundi X (NPXS)

Gemini Dollar (GUSD)

Paxos (PAX)

Rebglo (REB)

CoinLion (LION)

Hold (HOLD)

Cryptopay (CPAY)

...with more being added all the time.

Page 6: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

Ethereum Basics (Addresses vs. Contracts)

6

Addresses:

● Basically like Bitcoin Addresses● Single Signature● Initiate Contract Creation/Execution● Pay for Fees! (EIP 101)

Contracts

● Turing-Complete Execution● Extremely Tricky to Reason About

TXCreation

External (Fee) Address

10

Page 7: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

Ethereum Basics (Two Full Node Implementations)

7

Parity Geth

Rust Golang

Page 8: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

8

The Code:

● Multisignature Wallet● 12 functions

○ Sending○ Safe Mode○ Helper Functions

● Events○ Transacted○ Deposited

● web3.js (we don’t use it!)

Writing and Deploying A Multisig Wallet Smart Contract

Page 9: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

Writing and Deploying A Multisig Wallet Smart Contract

9

Page 10: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

10

The Deploy:

● Similar Care as Hardware● Audits

○ OpenZeppelin○ Coinspect○ ABDK Consulting

● Fee Address○ It Costs to Deploy Wallet and Receive Addresses

Writing and Deploying A Multisig Wallet Smart Contract

25

Page 11: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

11

The Ethereum Multisig Problem: Fungibility and Usability

TX

HitBTC does not see the

transaction!

Page 12: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

12

The Ethereum Multisig Problem

Multiparty ECDSA Signatures to the Rescue!

45

Page 13: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

13

Transaction Nonce Holes: Full Node

1 2 3 4

TX #11 ETH

TX #23 ETH

TX #35 ETH

TX #47 ETH

= Confirmed

Page 14: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

14

Transaction Nonce Holes: Full Node

1 2 3 4

= DB Query

5

TX #11 ETH

TX #23 ETH

TX #35 ETH

TX #47 ETH

TX #59 ETH

= Unconfirmed

= Confirmed

Page 15: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

15

Transaction Nonce Holes: Full Node

1 2 3 4

5

TX #11 ETH

TX #23 ETH

TX #35 ETH

TX #47 ETH

TX #59 ETH

TX #611 ETH

= DB Query

= Unconfirmed

= Confirmed

Page 16: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

16

Transaction Nonce Holes: Full Node

1 2 3 4

5

TX #11 ETH

TX #23 ETH

TX #35 ETH

TX #47 ETH

TX #59 ETH

TX #611 ETH

= DB Query

= Unconfirmed

= Confirmed

Page 17: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

17

Transaction Nonce Holes: Database

1 2 3 4 5

DB

5

= DB Query

= Unconfirmed

= Confirmed

Page 18: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

18

Transaction Nonce Holes: Database

1 2 3 4 5

DB

5

= DB Query

= Unconfirmed

= Confirmed

Page 19: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

19

Transaction Nonce Holes: Database

1 2 3 4 5 6

DB

6

= DB Query

= Unconfirmed

= Confirmed

Page 20: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

20

Transaction Nonce Holes: Database

1 2 3 4 5 6

DB

6

= DB Query

= Unconfirmed

= Confirmed

Page 21: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

21

Transaction Nonce Holes: Database

1 2 3 4 5 6

DB

8

7 8

= DB Query

= Unconfirmed

= Confirmed

Page 22: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

22

Transaction Nonce Holes: Database

1 2 3 4 5

= DB Query

DB

8

7 8

= Nonce Confirmed

Page 23: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

23

Transaction Nonce Holes: Database

1 2 3 4 5

DB

8

7 8

TX #91 ETH

= DB Query

= Unconfirmed

= Confirmed

Page 24: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

24

Transaction Nonce Holes: Database

1 2 3 4 5 6

DB

8

7 8

= DB Query

= Unconfirmed

= Confirmed

Page 25: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

25

Learning to Love/Hate Parity

60

Page 26: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

26

Right At Your Fingertips

Page 27: Alex Melville Securing and Running A Multisig …cs251crypto.stanford.edu/18au-cs251/lectures/lecture12.pdfEthereum Basics (Addresses vs. Contracts) 6 Addresses: Basically like Bitcoin

27

Thank You!