paddyncl

Atomically Trading with
Roger: Gambling on the
success of a hardfork*
Patrick McCorry, Ethan Heilman, Andrew Miller*Acknowledgement: We thank Roger Ver for letting us use his name in the paper’s title.

paddyncl

What is interesting in the paper?
●●This Talk: Hard Fork Atomic Trade Protocols for Bitcoin○○

How to set up trade prior to hardfork and perform it once hardfork occurs.

○○○

Brief history of soft and hard forks in Bitcoin/Ethereum.
An overview of replay protection proposals (including a new one we call migration inputs)
Hard Fork Atomic Trade Protocol for Ethereum■ How to use a Hardfork Oracle to set up and perform the atomic trade.

With and Without a transaction malleability fix!
Not in this talk but in our paper:

I hope to leave everyone with one message:
Transaction malleability *was* a pain in the ass anddesigning bitcoin contracts that accounts for malleability is non-trivial.

Loaded Challenges Roger (and he accepts)

paddyncl

Loaded didn’t want to use an escrow.

paddyncl

Eventually.. I seen Ethan tweeting about the bet…

paddyncl

Atomically Trade across two forks
Alice

Bob

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

1.

Bob

Deposit coins into a single transaction.
Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

Bob

HARDFORK
BLOCK

1.
2.

Deposit coins into a single transaction.
HARDFORK ACTIVATES

Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

Bob

FORK-1
HARDFORK
BLOCK

FORK-2
1.
2.
3.

Deposit coins into a single transaction.
HARDFORK ACTIVATES
Alice withdraws both coins in FORK-2

Alices Deposit
Bobs Deposit

paddyncl

Atomically Trade across two forks
Alice

Bob

FORK-1
HARDFORK
BLOCK

FORK-21.
2.
3.
4.

Deposit coins into a single transaction.
HARDFORK ACTIVATES
Alice withdraws both coins in FORK-2
Bob withdraws both coins in FORK-1

Alices Deposit
Bobs DepositAtomically Trade across two forks
Alice

Bob

FORK-1
HARDFORK
BLOCK

FORK-21.
2.
3.
4.

Deposit coins into a single transaction.
HARDFORK ACTIVATES
Alice withdraws both coins in FORK-2
Bob withdraws both coins in FORK-1

Alices Deposit
Bobs DepositAtomically Trade across two forks
Alice

Bob

FORK-1
HARDFORK
BLOCK

FORK-21.
2.
3.
4.

Deposit coins into a single transaction.
HARDFORK ACTIVATES
Alice withdraws both coins in FORK-2
Bob withdraws both coins in FORK-1

Alices Deposit
Bobs DepositAtomically Trade across two forks
Alice

Bob

FORK-1
HARDFORK
BLOCK

FORK-21.
2.
3.
4.

Deposit coins into a single transaction.
HARDFORK ACTIVATES
Alice withdraws both coins in FORK-2
Bob withdraws both coins in FORK-1

Alices Deposit
Bobs DepositWith and Without a Transaction Malleability fix●

Transaction malleability○○●

Without Transaction Malleability fix○●

The identification hash of a transaction (i.e. transaction id) can is malleable (i.e. changable)
any time before it is accepted into the blockchain.
It is not safe to sign a chain of unconfirmed transactions.
Deposit must be stored in the blockchain - before both parties can sign atomic trade

With Transaction Malleability Fix○

All atomic trade transactions can be signed before the deposit is stored in the blockchain… Small difference? Huge implications for bitcoin contract design.

Atomically Trade across two forks
without a fix for transaction malleability?
●

Funding Stage○●

Setup Cancellation:○●

Alice sets up a forfeit - if she does not reveal R before then ΔB Bob can claim all the coins.

Commit to Trade○●

Both Alice and Bob exchange Transfer transactions.
Alice must reveal a secret R of H(R) after Δfork to trigger the trade

Setup Alice’s Forfeit:○●

Bob will be able to cancel the atomic trade before Δcancel

Setup Atomic Trade:○○●

Both parties deposit coins into the blockchain

Alice broadcasts a transaction after Δcancel that commits both parties to the atomic trade.

Atomic Trade○○

Alice reveals R after Δfork and claims her coins in FORK-2
Bob finds R and claims his coins in FORK-1

Funding Stage
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Funding Transaction: Stores deposit of bothparties.

Funding Stage
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Funding Transaction: Stores deposit of bothparties.

Funding Stage
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Funding Transaction: Stores deposit of bothparties.

Funding Stage
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Funding Transaction: Stores deposit of bothparties.

Funding Stage
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Funding Transaction: Stores deposit of bothparties.

Setup Cancellation
1.
Funding Transaction

Cancellation Transaction

Alice’s Deposit

RefundAlice

Bob’s Deposit

RefundBob

Cancel Timer

Block #1

2.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3

Setup Cancellation
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Cancellation Transaction

A

RefundAlice

A

RefundBob

2.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3○ Signed by Alice and sent to BobA

Why do we NEED a cancellation transaction?!
Later on, Alice will commit to reveal R of H(R).
If R is not revealed - she’ll forfeit all coins to Bob.

Block #1

If Alice refuses to make this commitment…
This transaction lets Bob cancel the atomic tradealtogether.

Setup Cancellation
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Cancellation Transaction

A

RefundAlice

A

RefundBob

A

2.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3○ Signed by Alice and sent to Bob

Setup Cancellation
1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Cancellation
Transaction

2.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3○ Signed by Alice and sent to Bob

Setup Cancellation
Cancellation
Funding Transaction
Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

1.
2.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3○ Signed by Alice and sent to Bob

Setup Cancellation
Cancellation
Transaction

1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3○ Signed by Alice and sent to Bob

Cancellation
Transaction

Setup Cancellation
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3○ Signed by Alice and sent to Bob

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

3.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

Alice -> Bob Transfer

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

A

To Bob

3.
A

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

Alice -> Bob Transfer

2.
Alice’s Deposit
Bob’s Deposit
Cancel TimerA

To Bob

3.
A

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Condition in Alice -> Bob Transfer:
Alice: “You can claim these coins Bob,
if I reveal the secret R of H(R)”.
Block #1

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

Alice -> Bob Transfer

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

A

To Bob

3.
A

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Block #1

Alice -> Bob
Transfer

3.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

Block #1

Alice -> Bob
Transfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer
Alice -> Bob
Transfer

Block #1

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Block #1

3.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Block #1

3.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

Bob -> Alice Transfer

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Block #1

B

To Alice

3.
B

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

Bob -> Alice Transfer

2.
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Alice -> Bob
TransferB

To Alice

3.
B

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.

Condition in Bob -> Alice Transfer:
Bob: “You can claim these coins Alice,
if you reveal the secret R of H(R)”.

Block #1**REPLAY PROTECTION REQUIRED**Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit

Bob -> AliceTransfer

Cancel Timer

Alice -> Bob
Transfer

Block #1

3.

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit3.
Bob -> AliceTransfer

Cancel Timer

Alice -> Bob
Transfer

Block #1

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.

Cancellation
Transaction

Setup Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.

Cancellation
Transaction

Setup Alice’s Forfeit
1.

Funding Transaction

Alice -> Bob Forfeit FORK-1

2.
Alice’s Deposit
Bob’s DepositA

To Bob

3.
A

Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Cancellation
Transaction

Setup Alice’s Forfeit
1.

Funding Transaction

2.
Alice’s Deposit

Alice -> Bob
Forfeit FORK-1

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Cancellation
Transaction

Setup Alice’s Forfeit

Funding Transaction

Alice -> Bob
Forfeit FORK-1

1.
2.

Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Cancellation
Transaction

Setup Alice’s Forfeit
Alice -> Bob
Forfeit FORK-1

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Setup Alice’s Forfeit
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Setup Alice’s Forfeit
1.

Funding Transaction

Alice -> Bob Forfeit FORK-2

2.
Alice’s Deposit
Bob’s DepositA

To Bob

3.
A

Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Setup Alice’s Forfeit
1.

Funding Transaction

2.
Alice’s Deposit

Alice -> Bob
Forfeit FORK-2

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Funding Transaction

Setup Alice’s Forfeit

Alice -> Bob
Forfeit FORK-2

1.
2.

Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Setup Alice’s Forfeit

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Setup Alice’s Forfeit

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Block #1

Block #2

Bob -> AliceTransfer

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Alice -> Bob
Forfeit FORK-2

Both Parties
Commit To Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Bob -> AliceTransfer

5.

Block #1

Block #2

Block #3

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.
Commit Transaction: Invalidates the cancellationtransaction - and commits both parties to the trade!
Only valid after Δcancel = Block 3

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Alice -> Bob
Forfeit FORK-2

Both Parties
Commit To Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Bob’s Deposit

Commit Transaction

Cancel TimerA

3.

Anywhere

4.
Alice -> Bob
Transfer

Bob -> AliceTransfer

5.

Block #1

Block #2

Block #3

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.
Commit Transaction: Invalidates the cancellationtransaction - and commits both parties to the trade!
Only valid after Δcancel = Block 3

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Alice -> Bob
Forfeit FORK-2

Both Parties
Commit To Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit
Commitment
Transaction

Bob’s Deposit

3.

Cancel Timer

4.
Alice -> Bob
Transfer

Bob -> AliceTransfer

5.

Block #1

Block #2

Block #3

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.
Commit Transaction: Invalidates the cancellationtransaction - and commits both parties to the trade!
Only valid after Δcancel = Block 3

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Alice -> Bob
Forfeit FORK-2

Both Parties
Commit To Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Commitment
Transaction

Cancel Timer

4.
Alice -> Bob
Transfer

Bob -> AliceTransfer

5.

Block #1

Block #2

Block #3

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.
Commit Transaction: Invalidates the cancellationtransaction - and commits both parties to the trade!
Only valid after Δcancel = Block 3

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Alice -> Bob
Forfeit FORK-2

Both Parties
Commit To Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Commitment
Bob ->Transaction
AliceTransfer

4.

5.

Block #1

Block #2

Block #3

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.
Commit Transaction: Invalidates the cancellationtransaction - and commits both parties to the trade!
Only valid after Δcancel = Block 3

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Alice -> Bob
Forfeit FORK-2

Both Parties
Commit To Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Bob -> AliceTransfer

5.
Commitment
Transaction

Block #1

Block #2

Block #3

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.
Commit Transaction: Invalidates the cancellationtransaction - and commits both parties to the trade!
Only valid after Δcancel = Block 3

Alice -> Bob
Forfeit FORK-1

Cancellation
Transaction

Alice -> Bob
Forfeit FORK-2

Both Parties
Commit To Atomic Trade
1.

Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit
Cancel Timer

4.
Alice -> Bob
Transfer

Bob -> AliceTransfer

5.
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

Funding Transaction: Stores deposit of bothparties.
Cancellation Transaction: Refunds all parties
before Δcancel = Block 3
a. Signed by Alice and sent to Bob
Transfer Transactions: Sends each party coins in
the respective fork if R of H(R) is revealed.
a. Alice signs A->B and sends to Bob.
b. Bob signs B->A and sends to Alice.
Forfeit Transactions: Alice promises to reveal
pre-image r of H(R) before ΔB = Block 7 otherwise
Bob gets all coins.
Commit Transaction: Invalidates the cancellationtransaction - and commits both parties to the trade!
Only valid after Δcancel = Block 3

Briefly what has happened so far…?
●

Funding Stage○●

Setup Cancellation:○●

Alice sets up a forfeit - if she does not reveal R before then ΔB Bob can claim all the coins.

Commit to Trade○●

Both Alice and Bob exchange Transfer transactions.
Alice must reveal a secret R of H(R) after Δfork to trigger the trade

Setup Alice’s Forfeit:○●

Bob will be able to cancel the atomic trade before Δcancel

Setup Atomic Trade:○○●

Both parties deposit coins into the blockchain

Alice broadcasts a transaction after Δcancel that commits both parties to the atomic trade.

Atomic Trade○○

Alice reveals R after Δfork and claims her coins in FORK-2
Bob finds R and claims his coins in FORK-1

Alice -> Bob
Forfeit FORK-1

Wait for hardfork…

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Bob -> AliceTransfer

Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

Wait: Both parties must wait until the hardfork
activates.

Alice -> Bob
Forfeit FORK-1

Wait for hardfork…

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction
Alice’s Deposit
Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Block #1

Block #2

Bob -> AliceTransfer

Block #3

Commitment
Transaction

HARDFORK
BLOCK

Block #4

Block #5

Wait: Both parties must wait until the hardfork
activates.

Alice -> Bob
Forfeit FORK-1

Alice triggers Trade

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade. She broadcasts Bob -> AliceTransfer Transaction which also reveals the
pre-image R of H(R).

Bob’s Deposit
Cancel Timer

Alice->->Alice
Bob
Bob
Transfer

Bob -> AliceTransfer

FORK-1

Block #1

Block #2

Block #3

Commitment
Transaction

HARDFORK
BLOCK

Block #4

Block #5

FORK-2

Alice -> Bob
Forfeit FORK-1

Alice triggers Trade

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade. She broadcasts Alice -> Bob
transfer transaction and reveals pre-image R of
H(R).

Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

Block #1

Block #2

Block #3

Bob -> AliceTransfer

FORK-1

Commitment
Transaction

HARDFORK
BLOCK

Block #4

Block #5

FORK-2

Alice -> Bob
Forfeit FORK-1

Alice triggers Trade

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade. She broadcasts Alice -> Bob
transfer transaction and reveals pre-image R of
H(R).

Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

FORK-1
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

HARDFORK

Bob-> Alice
BLOCK
Transfer
Block #5

FORK-2

Alice -> Bob
Forfeit FORK-1

Alice triggers Trade

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade. She broadcasts Alice -> Bob
transfer transaction and reveals pre-image R of
H(R).

Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

FORK-1
Commitment
Transaction

HARDFORK
BLOCK

Bob -> AliceTransfer
Block #1

Block #2

Block #3

Block #4

Block #5

FORK-2

Alice -> Bob
Forfeit FORK-1

Alice triggers Trade

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade: She broadcasts Alice ->Bob Transfer Transaction and reveals pre-image R
of H(R).

Bob’s Deposit
Cancel Timer

Alice -> Bob
Transfer

FORK-1
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

HARDFORK
BLOCK

Block #5

Bob ->
Alice
Transfer

FORK-2

Alice -> Bob
Forfeit FORK-1

Bob claims his coins!

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade: She broadcasts Alice ->Bob Transfer Transaction and reveals pre-image R
of H(R).
Bob Claims Coins: He finds R, and thenbroadcasts Bob -> Alice Transfer Transaction.

Cancel Timer

Alice -> Bob
Transfer

FORK-1
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

HARDFORK
BLOCK

Block #5

Bob ->
Alice
Transfer

FORK-2

Alice -> Bob
Forfeit FORK-1

Bob claims his coins!

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade: She broadcasts Alice ->Bob Transfer Transaction and reveals pre-image R
of H(R).
Bob Claims Coins: He finds R, and thenbroadcasts Bob -> Alice Transfer Transaction.

Cancel Timer

Alice -> Bob
Transfer
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

FORK-1
HARDFORK
BLOCK

Block #5

Bob ->
Alice
Transfer

FORK-2

Alice -> Bob
Forfeit FORK-1

Bob claims his coins!

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade: She broadcasts Alice ->Bob Transfer Transaction and reveals pre-image R
of H(R).
Bob Claims Coins: He finds R, and thenbroadcasts Bob -> Alice Transfer Transaction.

Cancel Timer

Alice -> Bob
Transfer
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

FORK-1

HARDFORK
BLOCK

Block #5

Bob ->
Alice
Transfer

FORK-2

Alice -> Bob
Forfeit FORK-1

Bob claims his coins!

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade: She broadcasts Alice ->Bob Transfer Transaction and reveals pre-image R
of H(R).
Bob Claims Coins: He finds R, and thenbroadcasts Bob -> Alice Transfer Transaction.

Cancel Timer

Alice -> Bob
Transfer
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

FORK-1

HARDFORK
BLOCK

Block #5

Bob ->
Alice
Transfer

FORK-2

Alice -> Bob
Forfeit FORK-1

Bob claims his coins!

Alice -> Bob
Forfeit FORK-2

1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade: She broadcasts Alice ->Bob Transfer Transaction and reveals pre-image R
of H(R).
Bob Claims Coins: He finds R, and thenbroadcasts Bob -> Alice Transfer Transaction.

Cancel Timer

Alice ->
Bob
Transfer
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

FORK-1

HARDFORK
BLOCK

Block #5

Bob ->
Alice
Transfer

FORK-2

All done!
1.
Funding Transaction

2.
Alice’s Deposit

3.

Bob’s Deposit

4.

Cancel Timer

Wait: Both parties must wait until the hardfork
activates.
Alice Triggers Trade: She broadcasts Alice ->Bob Transfer Transaction and reveals pre-image R
of H(R).
Bob Claims Coins: He finds R, and thenbroadcasts Bob -> Alice Transfer Transaction.
All done!

Alice ->
Bob
Transfer
Commitment
Transaction

Block #1

Block #2

Block #3

Block #4

FORK-1

HARDFORK
BLOCK

Block #5

Bob ->
Alice
Transfer

FORK-2

paddyncl
Everything works

Alice doesn’t
sign Cancel

Funds refunded

Alice doesn’t
commit toexchange

Funds refunded

Alice doesn’t
trigger exchange

Bob gets allcoins in bothchainsWhat are the problems?
●Elaborate○●

Potential to lock coins for long time○●

Four off-chain transaction required to set it up (and the bitcoin script is somewhat complex too)
If Alice doesn’t sign cancellation transaction, then coins are locked up and eventually refunded
after the hardfork.

Hardfork Time must be FIXED.
○○

If the hardfork is delayed after setup - Bob can get all of Alice’s coins!
Alice is betting that FORK-2 is more valuable AND that FORK-2 actually happens…… What if Transaction Malleability is fixed?

paddyncl

Create 3 Transactions
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

To BobBob claims coins in fork-1
To Alice

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.

Sign Transfer Transactions
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

To BobBob claims coins in fork-1

A B

To Alice2.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.

Both Parties Sign and Publish Funding Tx
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

Bob claims coins in fork-1

A B

Block #1

To BobTo Alice2.
3.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.

Both Parties Sign and Publish Funding Tx
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

Bob claims coins in fork-1

A B

Block #1

To BobTo Alice2.
3.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.

Both Parties Sign and Publish Funding Tx
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

Bob claims coins in fork-1

A B

Block #1

To BobTo Alice2.
3.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.

Both Parties Sign and Publish Funding Tx
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

Bob claims coins in fork-1

A B

Block #1

To BobTo Alice2.
3.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.

Both Parties Sign and Publish Funding Tx
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

Bob claims coins in fork-1

A B

Block #1

To BobTo Alice2.
3.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.

Wait for hardfork
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

To BobBob claims coins in fork-1

A B

To Alice2.
3.
4.

Block #1

Block #2

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate

Wait for hardfork
Alice claims coins in fork-2

1.
Funding Transaction
Both Deposits

A B

To BobBob claims coins in fork-1

A B

To Alice2.
3.
4.

Block #1

Block #2

Block #3

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate

Wait for hardfork
Alice -> Bob Transfer

1.
Funding Transaction
Both Deposits

A B

To BobBob -> Alice Transfer

2.

To Alice

3.

A B

4.

HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate

Both parties can claim after hardfork!
Funding Transaction
Both Deposits

Aliceclaimscoins infork-2

1.

Bobclaimscoins infork-1

3.

2.

4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1
HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction
Both Deposits

AliceclaimsBob coins inclaimsfork-2
coins infork-1

2.
3.
4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1
HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both DepositsBobclaimscoins infork-13.
Aliceclaimscoins infork-24.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1
HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both DepositsBobclaimscoins infork-1

3.
4.
5.
Alice
claimscoins infork-2Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1

HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both DepositsBobclaimscoins infork-13.
4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1
HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

Aliceclaimscoins infork-2

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both DepositsBobclaimscoins infork-13.
4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1
HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

Aliceclaimscoins infork-2

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both Deposits

3.
Bobclaimscoins infork-1

4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1
HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

Aliceclaimscoins infork-2

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both Deposits

3.

Bobclaimscoins infork-1

4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.

FORK-1
HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

Aliceclaimscoins infork-2

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both Deposits

3.
4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.
Bobclaimscoins infork-1

FORK-1

HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

Aliceclaimscoins infork-2

FORK-2

Both parties can claim after hardfork!
1.
Funding Transaction

2.

Both Deposits

3.
4.
5.

Create Transactions: One party (i.e. Alice) creates
Funding Transaction, and both Transfer
Transactions.
Sign Transfers: Both parties sign the transfer
transactions off-chain.
Sign/Publish Deposit: Both parties sign Funding
Transaction and publish to the blockchain.
Wait: Must wait for hardfork to activate
Claim: Both parties claim coins in respective
blockchain.
Bobclaimscoins infork-1

HARDFORK
BLOCK

Block #1

Block #2

Block #3

Block #4

Block #5

Aliceclaimscoins infork-2

FORK-1

FORK-2

How easy was that?
●●●●

Similar to establishing a basic payment channel
No need for either party to trigger the exchange
Hardfork time must still be FIXED… but no need for elaborate setup.
Coins not locked for long time… (1 block after hardfork time).

… but when will this *actually* be useful?

...Segwit2x if mandatory replay protection is incorporated...
paddyncl http://homepages.cs.ncl.ac.uk/patrick.mc-corry/atomically-trading-roger.pdf

paddyncl

Conclusion:●●

We have a protocol to gamble on a trade across a fork prior to thehardfork○ With and Without a transaction malleability fix (such as segwit)!
See our paper for:○○○Brief history and survey on soft and hard forks in Bitcoin/Ethereum.
An overview of replay protection proposals (including a new one we call migration inputs)
Hard Fork Atomic Trade Protocol for Ethereum

Big takeaway:
Transaction malleability *was* a pain anddesigning bitcoin contracts that accounts for malleability is non-trivial.

paddyncl

Questions?