anonymous multi-hop locks for blockchain …...lightning network (bitcoin) raiden network (ethereum)...

73
FAKULTÄT FÜR !NFORMATIK Faculty of Informatics S&P SECURITY & PRIVACY GROUP Anonymous Multi-Hop Locks for Blockchain Scalability and Interoperability *FAU Erlangen-Nürnberg TU Wien Purdue University Giulio Malavolta * , Pedro Moreno-Sanchez , Clara Schneidewind , Aniket Kate , Matteo Maffei @pedrorechez @aniketpkate @matteo_maffei (https://eprint.iacr.org/2018/472.pdf)

Upload: others

Post on 09-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

FAKULTÄT FÜR !NFORMATIK

Faculty of Informatics S&P SECURITY & PRIVACY GROUP

Anonymous Multi-Hop Locks for Blockchain Scalability and

Interoperability

*FAU Erlangen-Nürnberg †TU Wien ❡Purdue University

Giulio Malavolta*, Pedro Moreno-Sanchez†,

Clara Schneidewind†, Aniket Kate❡,

Matteo Maffei†

@pedrorechez

@aniketpkate

@matteo_maffei

(https://eprint.iacr.org/2018/472.pdf)

Page 2: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

2

Motivation: Scalability Issues

‣ Bitcoin has a low transaction rate (~10 tx/sec)

• Visa, in contrast, supports >10K tx/sec

‣ Scalability approaches:

• On-chain (consensus layer or layer 1): e.g., Sharding

• Off-chain (application layer or layer 2): e.g., Payment Channel Networks

Page 3: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

Lightning Network (Bitcoin)

Raiden Network (Ethereum)

Many other research projects (Bolt, Z-Channels, Perun, etc.)

2

Motivation: Scalability Issues

‣ Bitcoin has a low transaction rate (~10 tx/sec)

• Visa, in contrast, supports >10K tx/sec

‣ Scalability approaches:

• On-chain (consensus layer or layer 1): e.g., Sharding

• Off-chain (application layer or layer 2): e.g., Payment Channel Networks

Page 4: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3

Contributions

The Wormhole Attack: A novel attack on Payment Channel Network Security

Concrete constructions of AMHLs that

… got implemented in Bitcoin’s Lightning Network

… enable inter-blockchain Payment Channels

… are efficient

AMHLs: A new primitive for secure + anonymous Payment

Channel Networks

Page 5: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

4

Background on Payment Channel Networks

Page 6: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

Payment Channels: Open

Alice Bob

Blockchain

5 (Alice)

5 (Alice,Bob)

Multisig Contract

Can be spent only with the signatures of both Alice and Bob

5 (Alice)

>Alice

5 1

Page 7: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

6

Payment Channels: Transactions

Blockchain

5 (Alice, Bob)4 (Alice)

1 (Bob)

Alice ?? Bob

Guarantee for Bob to receive 1 BTC (when published before )

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>

4 1

Alice Bob

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>Alice

Page 8: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

7

Payment Channels: Transactions

Blockchain

5 (Alice, Bob)

3 (Alice)

2 (Bob)

Alice ?? Bob

Guarantee for Bob to receive 2 BTC (when polished before )

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>

3 2

Alice Bob

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>Alice

5 (Alice, Bob)3 (Alice)

2 (Bob)

Alice ?? Bob

Page 9: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5 (Alice, Bob)3 (Alice)

2 (Bob)

Alice ?? Bob

Payment Channels: Close

Blockchain

Alice Bob

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>Alice

Page 10: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

9

Payment Channel Networks

4 1 2 3

Alice Bob CarolSend

1 BTC to Carol

Page 11: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

9

Payment Channel Networks

4 1 2 3

Alice Bob Carol

Bob

2 33 2

CarolAlice

1. Send 1 BTC

Send 1 BTC to Carol

Page 12: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

9

Payment Channel Networks

4 1 2 3

Alice Bob Carol

Bob

2 33 2

CarolAlice

1. Send 1 BTC

Send 1 BTC to Carol

3 2 1 4

Alice Bob Carol2. Forward 1 BTC

to Carol

Page 13: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

Should happen atomically

9

Payment Channel Networks

4 1 2 3

Alice Bob Carol

Bob

2 33 2

CarolAlice

1. Send 1 BTC

Send 1 BTC to Carol

3 2 1 4

Alice Bob Carol2. Forward 1 BTC

to Carol

Page 14: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

Should happen atomically

9

Payment Channel Networks

4 1 2 3

Alice Bob Carol

Bob

2 33 2

CarolAlice

1. Send 1 BTC

Send 1 BTC to Carol

Fee acts as an incentive for Bob to participate in

the payment

3 2 1 4

Alice Bob Carol2. Forward 1 BTC

to Carol

3-fee 2fee

3-fee 2fee

1. Send 1 BTC + fee to Bob

Page 15: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

10

The Lightning Network (LN)

Page 16: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

11

Payment Channels in the LN

5 (Alice, Bob)

4 (Alice)

1 (Bob)

Alice ?? Bob

4 1

Alice Boby

5 (Alice, Bob)4 (Alice)

1 (Bob)

Alice ?? Bob

Page 17: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

11

Payment Channels in the LN

5 (Alice, Bob)

4 (Alice)

1 (Bob)

Alice ?? Bob

4 14 1

Alice Boby

x

5 (Alice, Bob)4 (Alice)

1 (Bob)

Alice ?? Bob

y

With knowledge of x, Bob can “open” + publish the

transaction on the blockchain for enforcing

the payment

Page 18: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

11

Payment Channels in the LN

5 (Alice, Bob)

4 (Alice)

1 (Bob)

Alice ?? Bob

4 14 1

Alice Boby

x After time the transaction cannot be

published anymore on the blockchain

5 (Alice, Bob)4 (Alice)

1 (Bob)

Alice ?? Bob

y

With knowledge of x, Bob can “open” + publish the

transaction on the blockchain for enforcing

the payment

Page 19: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

11

Payment Channels in the LN

5 (Alice, Bob)

4 (Alice)

1 (Bob)

Alice ?? Bob

4 14 1

Alice Boby

x

HTLC (Alice, Bob, 1, y, ): Alice pays Bob 1 BTC iff Bob shows some

x such that H(x) = y before

After time the transaction cannot be

published anymore on the blockchain

“Multi-hop-Lock”

5 (Alice, Bob)4 (Alice)

1 (Bob)

Alice ?? Bob

y

With knowledge of x, Bob can “open” + publish the

transaction on the blockchain for enforcing

the payment

Page 20: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3 2

12

HTLC for Multi-hop Payments

Alice Bob Carol

y:= H(x)

x

2 3

Page 21: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3 2

12

HTLC for Multi-hop Payments

Alice Bob Carol

y:= H(x)

x

y

2 3

Page 22: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3 2

12

HTLC for Multi-hop Payments

Alice Bob Carol

HTLC(Alice, Bob, 1.1, y, t)

y:= H(x)

x

y

2 31.10.9 3

1

Page 23: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3 2

12

HTLC for Multi-hop Payments

Alice Bob Carol

HTLC(Alice, Bob, 1.1, y, t) HTLC(Bob, Carol, 1, y, t’)

2 21

y:= H(x)

x

y

2 31.10.9 3

1

Page 24: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3 2

12

HTLC for Multi-hop Payments

Alice Bob Carol

HTLC(Alice, Bob, 1.1, y, t) HTLC(Bob, Carol, 1, y, t’)

2 21

y:= H(x)

x

y

x

2 32 31.10.9 3

1

Page 25: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3 2

12

HTLC for Multi-hop Payments

Alice Bob Carol

HTLC(Alice, Bob, 1.1, y, t) HTLC(Bob, Carol, 1, y, t’)

2 21

y:= H(x)

x

y

x x

2 32 31.10.9 3

1

0.9 4.1

Page 26: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

3 2

12

HTLC for Multi-hop Payments

Alice Bob Carol

HTLC(Alice, Bob, 1.1, y, t) HTLC(Bob, Carol, 1, y, t’)

2 21

y:= H(x)

x

yRequirement: t > t’

(after Carol revealed x to Bob, there must still be time for Bob to

reveal x to Alice)

x x

2 32 31.10.9 3

1

0.9 4.1

Page 27: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

13

Security and Privacy Issues in Existing PCNs

Page 28: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

14

Security + Privacy in PCNs

Are off-chain payments in PCNs privacy-preserving by default?

(individual payments are not recorded on the blockchain!)

Are off-chain payments in PCNs secure? (No honest participant looses money!)

Page 29: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

14

Security + Privacy in PCNs

Are off-chain payments in PCNs privacy-preserving by default?

(individual payments are not recorded on the blockchain!)

Are off-chain payments in PCNs secure? (No honest participant looses money!)

NO!

NO!

Page 30: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

15

Security Issue: The Wormhole Attack

A CE1 E2

HTLC(A, E1,1.3,y, t1) HTLC(E1, B,1.2,y, t2) HTLC(B, E2,1.1,y, t3) HTLC(E2, C,1,y, t4)

y:= H(x)x

B

Page 31: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

15

Security Issue: The Wormhole Attack

A CE1 E2

HTLC(A, E1,1.3,y, t1) HTLC(E1, B,1.2,y, t2) HTLC(B, E2,1.1,y, t3) HTLC(E2, C,1,y, t4)

y:= H(x)x

xB

Page 32: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

15

Security Issue: The Wormhole Attack

A CE1 E2

HTLC(A, E1,1.3,y, t1) HTLC(E1, B,1.2,y, t2) HTLC(B, E2,1.1,y, t3) HTLC(E2, C,1,y, t4)

y:= H(x)x

x

x

B

Page 33: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

15

Security Issue: The Wormhole Attack

A CE1 E2

HTLC(A, E1,1.3,y, t1) HTLC(E1, B,1.2,y, t2) HTLC(B, E2,1.1,y, t3) HTLC(E2, C,1,y, t4)

y:= H(x)x

x

x

x B

Page 34: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

15

Security Issue: The Wormhole Attack

A CE1 E2

HTLC(A, E1,1.3,y, t1) HTLC(E1, B,1.2,y, t2) HTLC(B, E2,1.1,y, t3) HTLC(E2, C,1,y, t4)

y:= H(x)x

x

x

x

B considers the payment to be failed and unlocks his funds after the timeout

B

Page 35: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

15

Security Issue: The Wormhole Attack

A CE1 E2

HTLC(A, E1,1.3,y, t1) HTLC(E1, B,1.2,y, t2) HTLC(B, E2,1.1,y, t3) HTLC(E2, C,1,y, t4)

y:= H(x)x

x

x

x

B considers the payment to be failed and unlocks his funds after the timeout

B

gets 1.3 (no payment to B)

pays 1 (no payment from B)

Attacker earns 0.3 BTC (own fees + B’s fees)

Page 36: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

16

Privacy Issues in HTLC-based Payments

A C

E1 E2

HTLC(A,E1,v1,y,t1)

HTLC(E1,B,v2,y,t2) HTLC(B,E2,v3,y,t3)

HTLC(E2,C,v4,y,t4)

B

A’C’

Relationship Anonymity: On-path adversaries do not learn who pays to whom

HTLC(A,E1,v1,y’,t1)

HTLC(E1,B,v2,y’,t2) HTLC(B,E2,v3,y’,t3) HTLC(E2,C,v4,y’,t4)

Page 37: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

16

Privacy Issues in HTLC-based Payments

A C

E1 E2

HTLC(A,E1,v1,y,t1)

HTLC(E1,B,v2,y,t2) HTLC(B,E2,v3,y,t3)

HTLC(E2,C,v4,y,t4)

B

A’C’

pays to

pays to≈ pays to

pays to

Relationship Anonymity: On-path adversaries do not learn who pays to whom

HTLC(A,E1,v1,y’,t1)

HTLC(E1,B,v2,y’,t2) HTLC(B,E2,v3,y’,t3) HTLC(E2,C,v4,y’,t4)

Page 38: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

16

Privacy Issues in HTLC-based Payments

A C

E1 E2

HTLC(A,E1,v1,y,t1)

HTLC(E1,B,v2,y,t2) HTLC(B,E2,v3,y,t3)

HTLC(E2,C,v4,y,t4)

B

A’C’

pays to

pays to≈ pays to

pays to

Relationship Anonymity: On-path adversaries do not learn who pays to whom

HTLC(A,E1,v1,y’,t1)

HTLC(E1,B,v2,y’,t2) HTLC(B,E2,v3,y’,t3) HTLC(E2,C,v4,y’,t4)

Page 39: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

16

Privacy Issues in HTLC-based Payments

A C

E1 E2

HTLC(A,E1,v1,y,t1)

HTLC(E1,B,v2,y,t2) HTLC(B,E2,v3,y,t3)

HTLC(E2,C,v4,y,t4)

B

A’C’

pays to

pays to≈ pays to

pays to

Relationship Anonymity: On-path adversaries do not learn who pays to whom

HTLC(A,E1,v1,y’,t1)

HTLC(E1,B,v2,y’,t2) HTLC(B,E2,v3,y’,t3) HTLC(E2,C,v4,y’,t4)

Page 40: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

17

Solving Security and Privacy Issues in Payment Channel Networks

Page 41: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

18

Solving Security + Privacy Issues

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

Randomised conditions at each hop that can only be released by (exactly) the

right neighbour’s key

Page 42: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

18

Solving Security + Privacy Issues

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

k3k1 k2 k4

Setup phase for the distribution of individual “randomisation factors”

for users at each hop

Randomised conditions at each hop that can only be released by (exactly) the

right neighbour’s key

Page 43: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

18

Solving Security + Privacy Issues

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

k3k1 k2 k4

Setup phase for the distribution of individual “randomisation factors”

for users at each hop

Desired Properties

No coin loss

1.Atomicity: If a user’s right lock gets opened, he can open his left lock

2.Consistency: A user can open his left lock only if his right lock was released

3.Relationship Anonymity:A user learns about no other participant of the payment path than his direct neighbours

No Wormhole Attacks Privacy

Randomised conditions at each hop that can only be released by (exactly) the

right neighbour’s key

Page 44: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

ECDSA-based construction

19

Anonymous Multi-hop-Locks (AMHL)

Ideal functionality (capturing atomicity,

consistency + relationship anonymity)

Construction from homographic one-

way functions

Schnorr-based construction

provably realise in the UC framework

Page 45: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

ECDSA-based construction

19

Anonymous Multi-hop-Locks (AMHL)

Ideal functionality (capturing atomicity,

consistency + relationship anonymity)

Construction from homographic one-

way functions

Schnorr-based construction

ECDSA-based construction

provably realise in the UC framework

compatible with Bitcoin, Ethereum,

etc.

Page 46: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

20

ECDSA-based Secure PCNs

Page 47: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

21

Scriptless Scripts

yy

Page 48: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

21

Scriptless Scripts

Alice (skA)

Bob(skB)yy

AB

hypothetical “shared identity”

skAB = skA * skBBlockchain

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>5 (Alice)

5 (AB)

5 (Alice)

>Alice

Page 49: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

21

Scriptless Scripts

4 1

Alice (skA)

Bob(skB)yy

AB

hypothetical “shared identity”

skAB = skA * skBBlockchain

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>5 (Alice)

5 (AB)

5 (Alice)

>Alice

5 (AB)4 (Alice)

1 (Bob)

y AB ??k

Page 50: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

5

21

Scriptless Scripts

4 1

Alice (skA)

Bob(skB)yy

Alice gets sufficient information for producing a “half signature” that can be completed knowing secret k

Bob gets sufficient information for checking that the “half

signature” can be completed to a valid signature given k

AB

hypothetical “shared identity”

skAB = skA * skBBlockchain

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>5 (Alice)

5 (AB)

5 (Alice)

>Alice

5 (AB)4 (Alice)

1 (Bob)

y AB ??k

Page 51: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

22

Extension to Multi-hop Locks

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

(k4, C4)(k2, C2) (k3, C3) (k1 + k2 + k3 + k4)

k1*G (k1 + k2)*G (k1 + k2 + k3)*G

A CE1 E2B

(k1 + k2 + k3 + k4)*G

Page 52: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

22

Extension to Multi-hop Locks

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

(k4, C4)(k2, C2) (k3, C3) (k1 + k2 + k3 + k4)

k1*G (k1 + k2)*G (k1 + k2 + k3)*G

A CE1 E2

(k1 + k2 + k3 + k4)B

(k1 + k2 + k3 + k4)*G

Page 53: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

22

Extension to Multi-hop Locks

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

(k4, C4)(k2, C2) (k3, C3) (k1 + k2 + k3 + k4)

k1*G (k1 + k2)*G (k1 + k2 + k3)*G

A CE1 E2

(k1 + k2 + k3 + k4)B

(k1 + k2 + k3 + k4)*G

(k1 + k2 + k3)

- k4

Page 54: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

22

Extension to Multi-hop Locks

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

(k4, C4)(k2, C2) (k3, C3) (k1 + k2 + k3 + k4)

k1*G (k1 + k2)*G (k1 + k2 + k3)*G

A CE1 E2

(k1 + k2 + k3 + k4)B

(k1 + k2 + k3 + k4)*G

(k1 + k2 + k3)(k1 + k2)

- k3 - k4

Page 55: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

22

Extension to Multi-hop Locks

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

(k4, C4)(k2, C2) (k3, C3) (k1 + k2 + k3 + k4)

k1*G (k1 + k2)*G (k1 + k2 + k3)*G

A CE1 E2

(k1 + k2 + k3 + k4)B

(k1 + k2 + k3 + k4)*G

(k1 + k2 + k3)(k1 + k2)k1

- k2 - k3 - k4

Page 56: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

22

Extension to Multi-hop Locks

Lock(A, E1,1.3,C1,t1) Lock(E1,B,1.2,C2,t2) Lock(B,E2,1.1,C3,t3) Lock(E2,C,1,C4, t4)

(k4, C4)(k2, C2) (k3, C3) (k1 + k2 + k3 + k4)

k1*G (k1 + k2)*G (k1 + k2 + k3)*G

A CE1 E2

(k1 + k2 + k3 + k4)B

(k1 + k2 + k3 + k4)*G

(k1 + k2 + k3)(k1 + k2)k1

A valid key can only be extracted from a valid key for the right lock

- k2 - k3 - k4

Conditions look random (as they differ by a secret

random factor)

Page 57: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

23

ECDSA-based Scriptless Lockx

R = r * G

σR = sign(r, sk, transaction)

secret key messagesecret randomness

Signature w.r.t. a (public)

random elliptic curve point R

Page 58: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

23

ECDSA-based Scriptless Lockx

R = r * G

σR = sign(r, sk, transaction)

secret key messagesecret randomness

shared signature using a shared key and randomness

rA*rBrA*rB*G skA*skBAB

Signature w.r.t. a (public)

random elliptic curve point R

Page 59: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

23

ECDSA-based Scriptless Lockx

R = r * G

σR = sign(r, sk, transaction)

secret key messagesecret randomness

shared signature using a shared key and randomness

rA*rBrA*rB*G skA*skBAB

embedding of random share (condition) k

rA*rB*k*G rA*rB*k skA*skBAB

Signature w.r.t. a (public)

random elliptic curve point R

Page 60: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

23

ECDSA-based Scriptless Lockx

R = r * G

σR = sign(r, sk, transaction)

secret key messagesecret randomness

shared signature using a shared key and randomness

rA*rBrA*rB*G skA*skBAB

embedding of random share (condition) k

rA*rB*k*G rA*rB*k skA*skBAB

Signature w.r.t. a (public)

random elliptic curve point R

rA*rBrA*rB*k*G skA*skBAB“half signature” without k

but still with respect to rA*rB*k*G

Page 61: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

23

ECDSA-based Scriptless Lockx

R = r * G

σR = sign(r, sk, transaction)

secret key messagesecret randomness

shared signature using a shared key and randomness

rA*rBrA*rB*G skA*skBAB

embedding of random share (condition) k

rA*rB*k*G rA*rB*k skA*skBAB

Signature w.r.t. a (public)

random elliptic curve point R

rA*rBrA*rB*k*G skA*skBAB“half signature” without k

but still with respect to rA*rB*k*G

Lock

Pro

toco

l

AB AB

(skA, rA) (skB, rB)C=k*G, transaction

“1/3” signature σR,B

“1/3” signature σR,A

Page 62: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

23

ECDSA-based Scriptless Lockx

R = r * G

σR = sign(r, sk, transaction)

secret key messagesecret randomness

shared signature using a shared key and randomness

rA*rBrA*rB*G skA*skBAB

embedding of random share (condition) k

rA*rB*k*G rA*rB*k skA*skBAB

Signature w.r.t. a (public)

random elliptic curve point R

rA*rBrA*rB*k*G skA*skBAB“half signature” without k

but still with respect to rA*rB*k*G

Lock

Pro

toco

l

AB AB

(skA, rA) (skB, rB)C=k*G, transaction

“1/3” signature σR,B

“1/3” signature σR,A

Hard for ECDSA as σR

has a non-linear structure

Page 63: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

24

Properties/Evaluation

‣ Security and Privacy proven in the UC Framework

‣ Compatible with Bitcoin and current PCNs

✓Implemented in the Lightning Network (https://github.com/cfromknecht/tpec)

‣ Reduces transaction size for conditional payments

✓Encoding of condition within signature

‣ Makes settlement transactions indistinguishable from regular ones (Fungibility)

‣ Little overhead:

✓< 500 bytes communication

✓ few ms computation

Alice ?? Bob AB⤳

AB ?k⤳

Page 64: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

‣ AMHLs are suitable for cross-currency usage - even with different primitive instantiations

✓ Inter-currency payment channels

✓ Atomic swaps

25

Interoperability

ECDSA

DLOG

Page 65: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

26

Summary

The Wormhole Attack: A novel attack on Payment Channel Network Security

Concrete constructions of AMHLs that

… got implemented in Bitcoin’s Lightning Network

… enable inter-blockchain Payment Channels

… are efficient

AMHLs: A new primitive for secure + anonymous Payment

Channel Networks

Page 66: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

27

Additional Material

Page 67: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

HTLC in practice

Blockchain

5 (Alice, Bob)

4 (Alice)

1 (Bob)

Alice ?? Bob

5 (Alice)

5 (Alice,Bob)

5 (Alice)

>Alice

Alice Bob

x

≤≤

Transaction can only be added 1) Before the expiration of the payment channel 2) Before the expiration of the HTLC 3) when providing the pre-image x

HTLC (Alice, Bob, 1, y, ): Alice pays Bob 1 BTC iff Bob shows some

x such that H(x) = y before

Page 68: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

29

Implications of the Wormhole Attack

‣ Collateral cost: Honest intermediaries’ coins are locked (cannot be used in a successful payment)

‣ Attacked intermediaries cannot distinguish between an attack and a failed payment

➡ Destroys the incentive for intermediaries to participate in multi-hop payments at all

B

B

??⛔

Page 69: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

30

Properties of Multi-hop-lock-based PCN

Atomicity Relationship AnonymityConsistency

Balance SecurityPrevents Wormhole

Attacks (limited) Privacy

Minimal requirementswhich (cryptographic)

constructs are needed for implementing the Locks

Communication Which amount of communication is

required for building payment paths from locks

Blockchain Effects How do the locks

influence the transactions visible on

the Blockchain

Compatibility + Interoperability Performance

Fungibility + Blockchain growth

Page 70: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

Current PCN

OWH-based PCN

Schnorr-based PCN

ECDSA-based PCN

Atomicity ✔ ✔ ✔ ✔

Consistency ❌ ✔ ✔ ✔

Privacy ❌ ✔ ✔ ✔

Compatibility/ Interoperability ❌ partly partly ✔

Fungibility + reduced

transaction size❌ ❌ ✔ ✔

31

Properties of the Different Constructions

Page 71: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

32

Scriptless Locks

Schnorr Signature ECDSA Signature

r + sk ⇤m

(rA + rB) + (skA + skB) ⇤mRx ⇤ skA ⇤ skB +m

rA ⇤ rB

m

Signature of shared key and randomness

Embedding of arbitrary random shares (conditions)

signature with respect to message m and (random) point (Rx,Ry) on a elliptic

curve

simple linear combination of additive key and random shares

complex combination (x-coordinate,

multiplicative shares, inverse)

(Rx, Ry) = r ⇤G

= (rA + rB) ⇤G = (rA ⇤ rB) ⇤G

= (rA + rB + k) ⇤G = (rA ⇤ rB ⇤ k) ⇤G

(rA + rB + k) + (skA + skB) ⇤mRx ⇤ skA ⇤ skB +m

rA ⇤ rB ⇤ k

Rx ⇤ sk+m

r

�(rA⇤rB⇤k)⇤GskA⇤skB

(m, rA ⇤ rB ⇤ k)

Page 72: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

ECDSA-based Lock

Alice Bob

pkAB pkAB

joint randomness generationrA, RB = rB*G rB, RA = rA*G

R = (Rx,Ry) = rA*rB*C R= (Rx,Ry) = rA*rB*C

m m

AB

(skAB, pkAB) = (skA * skB, skA * skB *G)

skA skBskA

Alice

σpk_AB/{k,r0}

Alice

σpk_AB/{k,r0}

Alice Alice

:=

requires skA and hence can only be performed under homomorphic encryption for Alice

�/{k,rA}�/{k,rA}

�/{k} :=

= rA*rB*k*G

For condition C = k*G compute signature s. t. a�/{k} �/{k}

k= �rA⇤rB⇤C

skAB(m, rA ⇤ rB ⇤ k)

�RskAB

(m, rB)

�/{k,rA}

rA�/{k}

= �RskAB

(m, rA ⇤ rB)

Page 73: Anonymous Multi-Hop Locks for Blockchain …...Lightning Network (Bitcoin) Raiden Network (Ethereum) Many other research projects (Bolt, Z-Channels, Perun, etc.) 2 Motivation: Scalability

ECDSA-based Lock

Alice Bob

pkAB pkAB

joint randomness generationrA, RB = rB*G rB, RA = rA*G

R = (Rx,Ry) = rA*rB*C R= (Rx,Ry) = rA*rB*C

m m

AB

(skAB, pkAB) = (skA * skB, skA * skB *G)

skA skBskA

Alice

σpk_AB/{k,r0}

Alice

σpk_AB/{k,r0}

Alice Alice

:=

requires skA and hence can only be performed under homomorphic encryption for Alice

�/{k,rA}�/{k,rA}

�/{k} :=

Alice’s key share is homomorphically encrypted

for Alice

= rA*rB*k*G

For condition C = k*G compute signature s. t. a�/{k} �/{k}

k= �rA⇤rB⇤C

skAB(m, rA ⇤ rB ⇤ k)

�RskAB

(m, rB)

�/{k,rA}

rA�/{k}

= �RskAB

(m, rA ⇤ rB)