50
How Much Should we Trust and How Much Should we Distribute? Srdjan Čapkun

07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

  • Upload
    others

  • View
    2

  • Download
    0

Embed Size (px)

Citation preview

Page 1: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

How Much Should we Trust and How Much Should we Distribute? 

Srdjan Čapkun

Page 2: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Blockchains are distributed (by definition)

Page 3: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Blockchains are distributed (by definition)

‐ Don’t guarantee confidentiality‐ Don’t scale well for all applications‐ Services around blockchains are

not easily distributed

Page 4: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Data sources: data that is used in smart contracts needs to be correct 

Exchanges: store funds, perform transactions (custody) => trust

Light Clients: Clients don’t store full ledger or run consensus => trust in full clients / miners

Performance:The more you distribute, the slower you are

Page 5: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

• Threshold and ZK crypto schemes (to protect secrets)• Multi‐Party computation (to guarantee resilience to byzantine behavior)• Distributed Protocols e.g., Consensus [aka Ledgers, Blockchains]

All useful, but ‐ performance issues ‐ need to be tailored for individual application (e.g., ZK Snarks in Zcash, PoW, …)‐ cannot easily be combined to achieve all the goals of the application

5

Can Traditional Approaches Help?

Page 6: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Example 1: Data Sources (i.e., Oracles)

Page 7: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Bob

Insurance Company Buy insurance

CONTRACT

Page 8: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Bob

Insurance Company Buy insurance

CONTRACT

How does the Blockchain know that Bob’s plane was late?  

Page 9: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

•Use Trusted Authorities / Oracles (centralization)? •Use TEEs, e.g., TownCrier (SGX‐based)•Use publicly available information [trust the crowd / web]? 

Problem: TLS doesn’t support non‐repudiation (i.e. when your client talks to server, no signature of interaction)

Page 10: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

TLS‐N: A TLS Extension for Non‐Repudiation 

TLS‐N therefore acts as a practical decentralized blockchain oracle

Provides a proof of a total order of messages sent and received by a party ‐ Non‐repudiation of conversation (NRC).

Client Server

Evidence of interaction(signed transcript)

Page 11: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

But what about private data that the client doesn’t want to include in the proof? 

TLS‐N: A TLS Extension for Non‐Repudiation 

Page 12: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

TLS‐N: A TLS Extension for Non‐Repudiation 

Page 13: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Content Extraction Signature / Redactable SignatureRecord size: 16kb, chunk size: 8 ‐ 64B (high granularity) 

TLS‐N: A TLS Extension for Non‐Repudiation 

Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, Srdjan CapkunTLS‐N: Non‐repudiation over TLS Enabling Ubiquitous Content Signingin Proceedings of the Network and Distributed System Security Symposium (NDSS), 2018

Page 14: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

www.tls‐n.org

Fully DistributedBlockchainOracle 

Implementations for OpenSSL and Mozila NSS

Page 15: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Example 2: Custody and Delegationor better say, what do I do with my keys?

Page 16: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Store your keys with a trusted entity (but limit what they can do with it)

Sinisa Matetic, Moritz Schneider, Andrew Miller, Ari Juels, Srdjan CapkunDelegaTEE: Brokered Delegation using Trusted Execution Environmentsin Usenix Security Symposium, 2018 

K_PHILK_KEVIN

K_DAVE

Page 17: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Delegate with Restrictions

Sinisa Matetic, Moritz Schneider, Andrew Miller, Ari Juels, Srdjan CapkunDelegaTEE: Brokered Delegation using Trusted Execution Environmentsin Usenix Security Symposium, 2018 

Page 18: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

DelegaTEE ‐ properties

• The Owner’s credentials remain confidential. • The Owner can restrict access to his account, e.g., in terms of time, duration of access, no. of reads/writes etc.  ‐ with rich contextual policies

• The system logs the actions of Owners and Delegatees so that post‐hoc attribution of their behaviour is possible (as a means of resolving disputes)

• The system minimizes the ability of a service to distinguish between access by the Delegatee and that of the legitimate Owner

• Owner does not have to always be online

Page 19: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Delegatee

PayPal

6

32

Merchant

5

1

Centrally Brokered system

APIenclave

PayPalenclave

OwnerUsernamePasswordPrivate keys

Policy:- To whom- Restrictions

4

7

Confirmation

Page 20: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

• TEEs e.g., Intel  Software  Guard  Extensions  (SGX) 

• Remote attestation: Prove that correct “code.exe” is running inside enclave

• Integrity: cannot tamper with execution • Confidentiality• Small TCB inside enclave. 

Images taken from software.intel.com

Verifier

Page 21: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun
Page 22: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun
Page 23: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun
Page 24: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun
Page 25: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun
Page 26: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Owners A1…n Delegatee B1…nServices G1…n

owner registration1

login information acquired

user registration1

login information acquired

store credentials for Services G1…n

2

any informal communication channel

3agreement on credential delegation

establish secure communication

exchange unique identifiers for the system 4Owner Ai User Bj

Owner Ai: delegate ‐credenials Cx to Bj for service Gkwith access control policy Pijxk

5

ok6

X establish secure communicationavailable delegated credentials7

9 check access control policyif expired, terminate access

X

Centrally Brokered system

service access* 8

* enforced and constrained under specified access control policy in the central system

Page 27: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Example 3: Trustless Exchange

Page 28: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

What’s an Exchange?

10

1

0

0

Page 29: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

• Custodial risk:• More than 30 incidents since 2011• Over $2 billion in losses

• Manipulation risk:• Front‐running• Order book manipulation

29

Can we trust centralized exchanges?

Page 30: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

• Run as smart contract on blockchain• No custodial risk• But:

• Front‐running and order book manipulation possible• No support for blockchains without smart contracts (Bitcoin, Litecoin, etc…)• No support for trading across blockchains, e.g. Bitcoin/Ethereum • Slow• Expensive 

30

Decentralized exchanges?

Page 31: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

• Centralized exchanges require complete trust from user• Decentralized exchanges solve custody issue, but

• still require trust (manipulation)• are impractical

• Tesseract gives best of both worlds:• No custodial risk:

• Operator has no access to funds• Fail‐safe: Users get money back in case of unavailability

• No manipulation risk• Cross‐chain trading• Speed and cost comparable to centralized exchanges

31

Tesseract: a TEE supported exchange

Page 32: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

• Remote attestation: Prove that correct “Exchange.exe” is running inside enclave

• Integrity: Cannot tamper with execution of ”Exchange.exe”

• Order processing inside enclave⇒ No orderbook manipulation possible 

• Confidentiality: Secret Key controlling funds only known inside enclave

• Operator does not know key

• Small TCB inside enclave. Use array of modern techniques (testing, fuzzing, verification, …) to ensure correctness.

32

Ingredient 1: Trusted Execution Environment

SGX

Exchange.exe

Enclave

Secret Key

Page 33: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

• Blockchain is slow.• Must batch‐settle trades for good speed

• Settlements are timelocked: If exchange becomes unavailable for e.g. 24 hrs, users get their money back

• Settlements are atomicacross chains to prevent race conditions

33

Main Idea: Time‐locked Atomic Cross‐chain Settlement

Exchange.exeTrade

TradeUser BTC LTC

Alice 0.1 6

Bob 0.9 4

TimelockedSettlement

User BTC LTC

Alice 0.1 6

Bob 0.9 4

TimelockedSettlement

Page 34: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Continued development

Lorenz Breidenbachhttps://lorenzb.com/

Page 35: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Example 4: Privacy for Light Clientsi.e., do you trust ‘full nodes’ with your privacy?

Page 36: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun
Page 37: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Transactions

Full Node

This leaks information about Client’s funds and identity as well as allows full nodes to do rollback the ledger … 

Page 38: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Transactions

Full Node

This leaks information about Client’s funds and identity as well as allows full nodes to do rollback the ledger … 

SOLUTIONS: Karl Wüst, Sinisa Matetic, Moritz Schneider, Ian Miers, Kari Kostiainen, Srdjan CapkunZLiTE: Zcash Lightweight Clients using Trusted ExecutionFinancial Cryptography and Data Security (FC). 2019 (to appear)Sinisa Matetic, Karl Wüst, Moritz Schneider, Kari Kostiainen, Ghassan Karame, Srdjan Capkun,BITE: Bitcoin Lightweight Client Privacy using Trusted ExecutionUsenix Security 2019 (to appear)

Page 39: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Blockchains are distributed (by definition)

‐ Don’t guarantee confidentiality‐ Don’t scale well for all applications‐ Services around blockchains are

not easily distributed

Page 40: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

To increase performance, reduce # of nodes‐ Increase trust in each node‐ Increase trust in services that cannot be 

distributed

=> Trusted Execution Environments (i.e., TEEs)?

Page 41: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Trusted Execution Environments 

Page 42: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

But we don’t want to rely on a single TEE

Page 43: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

[stay tuned – more results coming in this space]

Page 44: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Positive: ‐ Fewer nodes, faster consensus‐ Faster execution of contracts ‐ Confidentiality!

Page 45: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Need to be careful: ‐ Enclave is trusted, not the platform‐ Rollback Attacks 

(OS can roll back local and global state)‐ Recent Microarchitectural Attacks 

Page 46: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Distribution increases Trust

But there are limits to what can be distributed

Page 47: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Prediction: a middle ground that balances trust in HW, distribution and Trusted Partieswill emerge as the “sweet spot” 

Page 48: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Prediction: a middle ground that balances trust in HW, distribution and Trusted Partieswill emerge as the “sweet spot” 

[stay tuned – more results coming in this space]

Page 49: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

Selected Publications:  Karl Wüst, Kari Kostiainen, Vedran Capkun, Srdjan Capkun

PRCash: Fast, Private and Regulated Transactions for Digital CurrenciesIn Proceedings of the International Conference on Financial Cryptography and Data Security (FC). 2019 (to appear)

Karl Wüst, Sinisa Matetic, Moritz Schneider, Ian Miers, Kari Kostiainen, Srdjan CapkunZLiTE: Zcash Lightweight Clients using Trusted ExecutionIn Proceedings of the International Conference on Financial Cryptography and Data Security (FC). 2019 (to appear)

Aritra Dhar, Ivan Puddu, Kari Kostiainen, Srdjan CapkunProximiTEE: Hardened SGX Attestation and Trusted Path through Proximity Verification

• Sinisa Matetic, Moritz Schneider, Andrew Miller, Ari Juels, Srdjan CapkunDelegaTEE: Brokered Delegation using Trusted Execution Environmentsin Usenix Security Symposium, 2018 

• Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, Srdjan CapkunTLS‐N: Non‐repudiation over TLS Enabling Ubiquitous Content Signingin Proceedings of the Network and Distributed System Security Symposium (NDSS), 2018

• I. Bentov, Y. Ji, F. Zhang, Y. Li, X. Zhao, L. Breidenbach, P. Daian, and A. Juels.Tesseract: Real‐Time Cryptocurrency Exchange using Trusted Hardware, 2017

• Sinisa Matetic, Mansoor Ahmed, Kari Kostiainen, Aritra Dhar, David Sommer, Arthur Gervais, Ari Juels, Srdjan CapkunROTE: Rollback Protection for Trusted ExecutionUSENIX Security Symposium, 2017

• Arthur Gervais, Ghassan Karame, Damian Gruber, Srdjan CapkunOn the Privacy Provisions of Bloom Filters in Lightweight Bitcoin ClientsIn Proceedings of ACSAC, 2014 http://www.syssec.ethz.ch/research/publications.html

Page 50: 07 ETH How Much Trust Distribute - Homepage | ETH Zürich · TLS‐N: A TLS Extension for Non‐Repudiation Hubert Ritzdorf, Karl Wüst, Arthur Gervais, Guillaume Felley, SrdjanCapkun

https://www.zisc.ethz.ch