From 934668d3f36c9a30241e782217780bcd411ad04d Mon Sep 17 00:00:00 2001 From: Ignotus Peverell Date: Sat, 16 Jun 2018 16:46:28 +0100 Subject: [PATCH] Fixes to the atomic swap section Can only swap with Ethereum right now, not Bitcoin. Pubkey derivation is a hash function. --- doc/contracts.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/doc/contracts.md b/doc/contracts.md index a72e1e76c..de26434cf 100644 --- a/doc/contracts.md +++ b/doc/contracts.md @@ -158,10 +158,11 @@ This contract can be trivially used for unidirectional payment channels. TODO still WIP, mostly ability for Alice to check `x*G` is what is locked on the other chain. Check this would work on Ethereum (pubkey derivation). -Alice has grins and Bob has bitcoins. They would like to swap. We assume that -Bob built an output on the Bitcoin blockchain that can be spent either by Alice -if she learns about a hash pre-image `x`, or by Bob after time `Tb`. Alice is -ready to send her grins to Bob if he reveals `x`. +Alice has grins and Bob has ether. They would like to swap. We assume Bob has +a contract on the Ethereum blockchain that allows withdrawal either by Alice +if she learns a hash pre-image `x`, or by Bob after time `Tb`. Alice is ready +to send her grins to Bob if he reveals `x`. In this setup, we consider public +key derivation `x*G` to be our hash function. First, Alice sends her grins to a multiparty timelock contract with a refund time `Ta < Tb`. To send the 2-of-2 output to Bob and execute the swap, Alice @@ -181,6 +182,8 @@ signature is `(sr + ss, kr*G + ks*G)`. 6. As soon as Bob broadcasts the final transaction to get his new grins, Alice can compute `sr' - sr` to get `x`. +TODO review this, see if it could work on other chains. + ## Hashed Timelocks (Lightning Network) TODO relative lock times