ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND...

37
ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute of Technology Lausanne Scaling Bitcoin 2016 "Retarget" • October 9 th Milan, Italy Lefteris Kokoris-Kogias , Philipp Jovanovic, Nicolas Gailly, Ismail Khoffi, Linus Gasser and Bryan Ford EPFL @LefKok

Transcript of ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND...

Page 1: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING

Swiss Federal Institute of Technology Lausanne

Scaling Bitcoin 2016 "Retarget" • October 9th Milan, Italy

Lefteris Kokoris-Kogias, Philipp Jovanovic, Nicolas Gailly, Ismail Khoffi, Linus Gasser and Bryan FordEPFL

@LefKok

Page 2: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Bitcoin Blockchaino What we have now:

o Real-time verification is not safe (1 hour of delay)o Throughput is low (4 tx/sec)

2

Page 3: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Byzcoin Blockchaino What can Byzcoin do:

o Irrevocable transaction commitment in 20-90 seco Throughput up to 974 TPSo Robust against double-spending, eclipsing, selfish

miningo Light-weight client verification (suitable for mobile

phones)

3

Page 4: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

How?o Use Practical Byzantine Fault Tolerance protocol to

provide non-probabilsitic strong consistencyo Use Collective Signing to scale PBFT and decrease

latencyo Use PoW to create hybrid permissionless BFTo Use Bitcoin-NG to increase throughput

4

Page 5: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Talk Outlineo Bitcoin and its limitationso Strawman design: PBFTCoino Opening the consensus group o From MACs to Collective Signingo Decoupling transaction verification from leader election o Performance Evaluationo Future work and conclusions

5

Page 6: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

The Blockchain6

Page 7: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Problem Statement

1. In Bitcoin there is no verifiable commitment of the system that a block will persist

o Clients rely on probabilities to gain confidence.o Probability of successful fork-attack decreases exponentially

7

Page 8: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Talk Outlineo Bitcoin and its limitationso Strawman design: PBFTCoino Opening the consensus group o From MACs to Collective Signingo Decoupling transaction verification from leader election o Performance Evaluationo Future work and conclusions

8

Page 9: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Strawman Design: PBFTCoino 3f+1 fixed “trustees” running PBFT* to withstand f

failureso Non-probabilistic strong consistency

o Low latency

o No forks/inconsistencieso No double-spending

6

L

blockchain

L

block

trustees

leader

*Practical Byzantine Fault Tolerance [Castro/Liskov]

Page 10: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Strawman Design: PBFTCoino Problem: Needs a static consensus groupo Problem: Scalability

o Dense communication pattern (limits consensus group size)

o High client-side verification cost (excludes mobile phones/IoT clients)

o Absence of third-party verifiable proofs (limits number of clients)

7

ClientPrimary

Replica 2Replica 3Replica 4

Request Pre-Prepare Prepare Commit Reply

Page 11: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Talk Outlineo Bitcoin and its limitationso Strawman design: PBFTCoino Opening the consensus group o From MACs to Collective Signingo Decoupling transaction verification from leader election o Performance Evaluationo Future work and conclusions

11

Page 12: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Opening the Consensus Group 12

L

blockchain

share window of size w

L

block

share

miner

leader

o PoW against Sybil attackso One share per block

o % of shares ∝ hash-power

o Window mechanismo Protect from inactive miners

Page 13: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Talk Outlineo Bitcoin and its limitationso Strawman design: PBFTCoino Opening the consensus group o From MACs to Collective Signingo Decoupling transaction verification from leader election o Performance Evaluationo Future work and conclusions

13

Page 14: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

From MACs to Signing14

o Substitute MAC-based authentication (symmetric crypto) with public-key cryptographyo ECDSA provides more efficiencyo Third-party verifiableo PoW Blockchain as PKIo Enables sparser communication patterns (ring or star

topologies)

Page 15: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

From MACs to Collective Signing15

o Can we get better communication patterns?o Multicast protocols transmit information in sub-linear stepso Use trees!!

o Can we allow for lightweight verification?o Schnorr multisignatures could be verified in constant timeo Use signature aggregation!!

o Schnorr multisignatures + communication trees = Collective Signing [Syta et all, IEEE S&P ’16]

Page 16: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

16

CoSio Efficient collective signature, verifiable as a

simple signatureo For the Ed25519 curve

o 82 bytes instead of 9KB for 144* co-signerso 190 bytes instead of 63KB for 1008* co-signers

16

* Number of ~10-minute blocks in 1-day/week time window

Page 17: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Discussiono CoSi is not a BFT protocol

o PBFT can be implemented over two subsequent CoSi roundso Prepare roundo Commit round

17

L

blockchain

share window of size w

L

block

share

miner

leader

Page 18: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Problem Statement1. In Bitcoin ByzCoin there is no a verifiable commitment

of the system that a block will persist2. Throughput is limited by forkso Increasing block size increases fork probabilityo Liveness exacerbation

18

Page 19: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Talk Outlineo Bitcoin and its limitationso Strawman design: PBFTCoino Opening the consensus group

o From MACs to Collective Signingo Decoupling transaction verification from leader election

o Performance Evaluation

o Future work and conclusions

19

Page 20: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Bitcoin-NG [Eyal et all, NSDI ’16]o Makes the observation that block mining implement two

distinct functionalitieso Transaction verificationo Leader election

o We enhance Bitcoin-NG with Byzantine consensuso No double-spendingo Non-propabilstic securityo Leader cannot misbehave

20

Page 21: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Decoupling Transaction Verification from Leader Election

o Key blocks: o PoW & share valueo Leader election

o Microblocks: o Validating client transactionso Issued by the leader

21

1 2

1 2 3 4 5

Keyblock

Microblock

Collective Signature

Page 22: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Talk Outlineo Bitcoin and its limitationso Strawman design: PBFTCoino Opening the consensus group o From MACs to Collective Signingo Decoupling transaction verification from leader election o Performance Evaluationo Future work and conclusions

22

Page 23: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Performance Evaluation23

o Experiments run on DeterLab network testbedo Up to 1,008* miners multiplexed atop 36 machineso Impose 200 ms latencies between all serverso Impose 35 Mbps bandwidth per miner

* 1008 = # of ~10-minute key-blocks in 1-week time window

Page 24: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Performance Evaluation24

o Key questions to evaluate:o What size consensus groups can ByzCoin scale to?o What transaction throughput can it handle?

Page 25: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Consensus Latency 25

Page 26: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Throughput26

Page 27: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Talk Outlineo Bitcoin and its limitationso Strawman design: PBFTCoino Opening the consensus group o From MACs to Collective Signingo Decoupling transaction verification from leader election o Performance Evaluationo Future work and conclusions

27

Page 28: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Challenges for Ongoing Work

o Attacker with >= 1/3 of the shareso Switch to probabilistic consistency?

o Can currently only scale-up not scale-outo Split the state between different groups?

o Leader can exclude miners from the consensuso Instead of burning the bitcoins, donate them?

28

Page 29: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

FAQ

o What happens when an attacker gets more than 1/3?

o Does selfish mining occur in the key-block chain?o How is the consensus group size selected?o How do the miners make money?

29

Page 30: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Surviving 34% attackso Key-blocks keep being collectively signed with a

needed margin of 51%o Strong consistency is not immediate

o Blocks will commit after 6 confirmationso Window starts from the last committed block

o Micro-blocks forfeit liveness, if 66% is not achieved

30

Page 31: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Defend Against Selfish MiningThe PoW chain is (almost) fair even under 34% attacks.

31

?

Page 32: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Choosing Window Size32

o Random sampling experiment

o Probability that the system picks less than c = ⌊ w/3 ⌋

o P>0.99

Page 33: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

How do the miners make money?And why participate?o Coinbase profit is distributed among the active signerso Same for microblock feeso Miner profits more when available the full windowo Miner keeps mining to get more shares that correspond

to more revenue.

33

Page 34: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Future Work

o Alternatives to PoWo Sharding to enable scaling-outo Incremental deployment to existing cryptocurrencies

o Model the system on Bitcoin’s adversary*?o How do miners discover each other?o Robustness against 34% attacks?

34

*Analysis of the Blockchain Protocol in Asynchronous Networks [Pass, Seeman, Shelat]

Page 35: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Conclusiono Use Collective Signing to scale BFT protocols o Use PoW to create hybrid permissionless BFTo Combine the above with Bitcoin-NGo Demonstrate experimentally its practicality

o 1MB blocks commit in ~24sec achieve ~150TPSo 32MB blocks commit in ~90sec achieve ~1000TPS

o ByzCoin increases the robustness of Bitcoin.

35

Page 36: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Thank you

[email protected]

people.epfl.ch/eleftherios.kokoriskogias

@LefKok

36

Page 37: ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH … Bitcoin... · ENHANCING BITCOIN SECURITY AND PERFORMANCE WITH STRONG CONSISTENCY VIA COLLECTIVE SIGNING Swiss Federal Institute

Byzcoin: Bringing it all Together 37