Proof of Luck: an Efficient Blockchain Consensus Protocol Mitar - - PowerPoint PPT Presentation

proof of luck
SMART_READER_LITE
LIVE PREVIEW

Proof of Luck: an Efficient Blockchain Consensus Protocol Mitar - - PowerPoint PPT Presentation

Proof of Luck: an Efficient Blockchain Consensus Protocol Mitar Milutinovic, Warren He, Howard Wu, Maxinder Kanwal Outline Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof


slide-1
SLIDE 1

Proof of Luck:

an Efficient Blockchain Consensus Protocol

Mitar Milutinovic, Warren He, Howard Wu, Maxinder Kanwal

slide-2
SLIDE 2

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-3
SLIDE 3

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-4
SLIDE 4

Background: blockchains

block = (data, H(previous block)) 1 hash protects integrity of entire chain Efficient to append Efficient to verify recent blocks Use case: append-only log

h data hash data hash H H H ...

slide-5
SLIDE 5

Background: blockchains

Use case: append-only transaction log Remember previous payments to know who has how much money Still something missing: What if you know multiple valid blockchains?

slide-6
SLIDE 6

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-7
SLIDE 7

Background: consensus

Two valid chains, same ancestry Whom has A paid? Has A even paid anyone?

A pays B A pays C ...

slide-8
SLIDE 8

Background: consensus

One approach: proof of work Each block must contain a proof of work Bitcoin uses a partial hash preimage problem Prefer the chain with the most work

+2 work +3 work

slide-9
SLIDE 9

Background: consensus

Issues with Bitcoin’s consensus mechanism:

  • To prevent ties, it’s slow—10 minutes per block on average
  • Time per block varies by chance
  • Takes a lot of energy to do the work

Motivation: could do better with trusted execution SGX is available in consumer CPUs

slide-10
SLIDE 10

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-11
SLIDE 11

Background: SGX

A trusted execution environment Remote attestation: one can verify* that a specific computation ran on suitable hardware and produced a specific result. *Provided they trust in the platform vendor, Intel in the case of SGX

slide-12
SLIDE 12

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-13
SLIDE 13

Existing consensus mechanisms

Proof of work - variations for useful work Proof of Stake / Proof of Burn - depends on specific incentives Byzantine fault tolerance - fast, participants known, adversary < ⅓ Intel Sawtooth Lake - developed concurrently, simulates Bitcoin mining, more mature analysis of compromised CPUs

slide-14
SLIDE 14

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-15
SLIDE 15

TEE Proof of Work

Nonce to prevent replay, as usual Null name base: anonymous proof (more later) Restricts ASIC use Can do work that doesn’t have efficient verification algorithm Guaranteed to get a proof after doing work Still uses lots of energy

Start PoW Do original proof of work (nonce, difficulty) Attestation (nonce, difficulty), name base=null End = inside TEE

slide-16
SLIDE 16

TEE Proof of Work Time

A busy-wait loop can be used in TEE-Proof-of-Work Even better: just check time from the TEE and yield Concurrent invocations?

Attestation (nonce, duration), name base=null Check time Check time Yield Start PoT End ...

= provided by TEE

slide-17
SLIDE 17

TEE Proof of Work Time

Concurrent invocations? Prototype in SGX: monotonic counters (MC) shared across instances of same enclave Implement a mutex. Assumption: TEE supports this use case

Increment MC Check MC Attestation (nonce, duration), name base=null Check time Check time Yield Start PoT End Init ...

slide-18
SLIDE 18

TEE Proof of Work Time

Related: Sawtooth Lake distributed ledger, Proof of Elapsed Time Wait for a randomized amount of time—simulates partial preimage search

efc9a5df... 33bf7353... 31a75a03... 598fc24b... c052d575... d824325d... fd3f6615... f2c4d943... d9799954... fb2eb5e0... 439696f5... c7882894... 00000000...

~ geometric distribution X

https://github.com/intelledger

slide-19
SLIDE 19

TEE Proof of Work Time Ownership

Everyone has same amount of time Boils down to owning capable CPUs Don’t bother waiting Name base: attestation pseudonym = F(name base, CPU’s key) CPUs vote with attestations Scalability issue: need to collect all votes

Start PoO Attestation (nonce, difficulty), name base=nonce End

slide-20
SLIDE 20

Basic consensus primitives

ASIC resistant Energy efficient Time efficient Scalable Bitcoin no no no yes TEE Proof of work yes no no yes TEE Proof of time yes yes no yes TEE Proof of ownership yes yes yes no

slide-21
SLIDE 21

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-22
SLIDE 22

Proof of Luck

Idea: generate random number for each block (assumption: that a TEE can) Extend block with highest number, prefer chain with highest total During network split, larger network will likely generate higher max block

0.9 0.8 0.6 0.5

+1.7 luck +1.1 luck

slide-23
SLIDE 23

Proof of Luck

Strawman design: generate random number, generate attestation

PoL End Random l Attestation (nonce, l)

slide-24
SLIDE 24

Proof of Luck

Problem 1: becomes proof of work Low number? Restart

PoL End Random l Attestation (nonce, l)

slide-25
SLIDE 25

Proof of Luck

Problem 1: becomes proof of work Solution: must wait for some time, a “round time”

PoL Wait ROUND_TIME End Random l Attestation (nonce, l)

slide-26
SLIDE 26

Proof of Luck

Problem 2: unsynchronized clocks waste luck

0.8 0.7

... waiting period for block creation time

slide-27
SLIDE 27

Proof of Luck

Problem 2: unsynchronized clocks waste luck

0.8 ? 0.7

... waiting period for block creation time

slide-28
SLIDE 28

Proof of Luck

Problem 2: unsynchronized clocks waste luck

0.8 0.7

...

0.9

waiting period for block creation

?

time

slide-29
SLIDE 29

Proof of Luck

Problem 2: unsynchronized clocks waste luck

0.8 0.5 0.7

...

0.9

waiting period for block creation time

slide-30
SLIDE 30

Proof of Luck

Problem 2: unsynchronized clocks waste luck

0.8 0.5 0.7

...

0.9

waiting period for block creation time

slide-31
SLIDE 31

Proof of Luck

PoL Wait ROUND_TIME End Random l Attestation (nonce, l)

Problem 2: unsynchronized clocks waste luck

slide-32
SLIDE 32

Proof of Luck

Problem 2: unsynchronized clocks waste luck Solution:

  • Continue to receive competing

blocks during ROUND_TIME

PoLRound Wait ROUND_TIME End Random l Attestation (nonce, l) Receive blocks

slide-33
SLIDE 33

Proof of Luck

Problem 2: unsynchronized clocks waste luck Solution:

  • Continue to receive competing

blocks during ROUND_TIME

  • After waiting, have a chance to

switch

PoLRound Wait ROUND_TIME PoLMine End Random l Attestation (nonce, l) Receive blocks

slide-34
SLIDE 34

Proof of Luck

Problem 2: unsynchronized clocks waste luck Solution:

  • Continue to receive competing

blocks during ROUND_TIME

  • After waiting, have a chance to

switch

  • Must have same parent as

block chosen at beginning

PoLRound Wait ROUND_TIME PoLMine End Random l Attestation (nonce, l) Save roundBlock = parent Check parent = roundBlock Receive blocks

slide-35
SLIDE 35

Proof of Luck

Optimization: slightly delay less-lucky blocks Don’t broadcast if you’ve already received a luckier block

PoLRound Wait ROUND_TIME PoLMine End Random l Sleep f(l) Attestation (nonce, l) Save roundBlock = parent Check parent = roundBlock Receive blocks

slide-36
SLIDE 36

Analysis

Luck values: l ~ Uniform(0, 1) Scenario: attacker (m) splits itself from rest of network (M) Threat model: attacker cannot compromise TEE, cannot split honest participants h blocks after the fork, we have two chains with luck values: lM(t) ~ max of M Uniform(0, 1) lm(t) ~ max of m Uniform(0, 1) All independent 1 ≤ t ≤ h

slide-37
SLIDE 37

Analysis

Scenario: attacker (m) splits itself from rest of network (M) h blocks after the fork

? Attacker’s chain preferred

slide-38
SLIDE 38

Analysis

Expectation of product of independent variables Identically distributed Chernoff bound

slide-39
SLIDE 39

Scenario: attacker (m) splits itself from rest of network (M) Threat model: attacker cannot compromise TEE, cannot split honest participants After the fork, exponentially small probability that minority wins

< 1 for optimal s if M > m

Analysis

slide-40
SLIDE 40

Compromised TEE

Scenario: attacker can compromise a few CPUs, not the whole platform Approach: save top m luckiest numbers in each block,

  • nly mth place (least lucky) one counts

Example (m = 5): If attacker compromises fewer than m CPUs, they can’t fully control block’s luck Needs further analysis

0.98 0.96 0.94 0.92 0.90 1.00 1.00 0.98 0.96 0.94 From compromised CPUs

slide-41
SLIDE 41

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-42
SLIDE 42

Conclusion

Properties of Proof of Luck:

  • ASIC resistant
  • Energy efficient
  • Time efficient
  • Permissionless and scalable

Summary of assumptions:

  • Participants have access to suitable TEE hardware
  • TEE programs can detect concurrent invocations
  • TEE programs can generate unbiased random numbers
slide-43
SLIDE 43

End of presentation.

slide-44
SLIDE 44

Proof of time - Implementation

Question: Which monotonic counter? Monotonic counters accessed by random ID Storage and communication must be done outside TEE

slide-45
SLIDE 45

Proof of time - Implementation

Question: Which monotonic counter? Answer: All of them.

https://software.intel.com/sites/default/files/managed/d5/e7/Intel-SGX-SDK-Users-Guide-for-Windows-OS.pdf

SGX_ERROR_MC_OVER_QUOTA The enclave has reached the quota(256)

  • f Monotonic Counters it can maintain
slide-46
SLIDE 46

Proof of time - Implementation

Question: Which monotonic counter? Answer: All of them.

  • create 256 monotonic counters
  • yield
  • make sure all 256 still have correct value
slide-47
SLIDE 47

Compromised TEE

Network may have slightly different blocks (e.g., due to latency) Merge proofs of luck as long as blocks are “similar” Similar blocks can be compressed

slide-48
SLIDE 48

Analysis

Proportional control of blocks

slide-49
SLIDE 49

Outline

Background: blockchains, consensus, and SGX Existing consensus mechanisms Our paper: 3 basic consensus primitives Proof of Luck Conclusion

slide-50
SLIDE 50