summaryrefslogtreecommitdiff
path: root/29/4522cd01684814ea3b9d8a2759c04d34c5f89b
blob: 8353c3fd55b59ab1873308814d902034675d04e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
Return-Path: <ZmnSCPxj@protonmail.com>
Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133])
 by lists.linuxfoundation.org (Postfix) with ESMTP id 97F51C016E
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  6 Jun 2020 03:59:38 +0000 (UTC)
Received: from localhost (localhost [127.0.0.1])
 by hemlock.osuosl.org (Postfix) with ESMTP id 7DE1189275
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  6 Jun 2020 03:59:38 +0000 (UTC)
X-Virus-Scanned: amavisd-new at osuosl.org
Received: from hemlock.osuosl.org ([127.0.0.1])
 by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024)
 with ESMTP id 5O84ipbvypfv
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  6 Jun 2020 03:59:37 +0000 (UTC)
X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6
Received: from mail-40138.protonmail.ch (mail-40138.protonmail.ch
 [185.70.40.138])
 by hemlock.osuosl.org (Postfix) with ESMTPS id F097689272
 for <bitcoin-dev@lists.linuxfoundation.org>;
 Sat,  6 Jun 2020 03:59:36 +0000 (UTC)
Date: Sat, 06 Jun 2020 03:59:30 +0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com;
 s=protonmail; t=1591415973;
 bh=WOv4rA7+ipRx298absH2x2+q/UTqWqse42Qri+j+yPA=;
 h=Date:To:From:Cc:Reply-To:Subject:In-Reply-To:References:From;
 b=LepfbpoiZnKBZlwredi98KJhVSGMPEVWXcRikKy7DKpMoYx2omGiizYidxf4eevMq
 OmFaporUZavMRzrTLOtQeWnTOsfZirHKTejOSo03in+d9/5fI4iLHyJFqvRaXlyLkd
 rTh5XulveJOLfprkCQiI82HxYHb9rckNC8RUzZbE=
To: ZmnSCPxj <ZmnSCPxj@protonmail.com>,
 Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
From: ZmnSCPxj <ZmnSCPxj@protonmail.com>
Reply-To: ZmnSCPxj <ZmnSCPxj@protonmail.com>
Message-ID: <xNdzEDklg3DOAHpaOhPlacvkhr6Nfk6-oR6YAbqsMJiYc2QM837LAgwXpuIqyy6M6mZyk2zcZQqUWTlYky6MoAG_0ecupIygmSGDHuppa_4=@protonmail.com>
In-Reply-To: <Sy14DpcFGdAYL95d7e6tfkOe87oY53tJReo9CYvPT5J3Gb85AqedMheq1NbfVKUXZtZrwZqwVV4wSztikgWBAgNfTh8J5h5gXC6HDMxvsNg=@protonmail.com>
References: <82d90d57-ad07-fc7d-4aca-2b227ac2068d@riseup.net>
 <CAPv7TjY9h8n-nK_CPiYCWYDcbXpT1gfRMQDgf9VUkcR532rxOw@mail.gmail.com>
 <VxL93WE7bDrK1riquTWTTEgJj9mDQ4W5CuhOgdnnDPeidw2ho6evVh4cLZLz0jEYMqejaD1tiLULVTXkNRbI5A7wSwV49qSwnXcTWCDJ96E=@protonmail.com>
 <cbf78f63-cf8c-c5d8-06ea-afc79aabc23c@riseup.net>
 <5LiZqpFxklAAbGFiiAE3ijRbIteODXKcHrXvGJ-qabgQj5hG8beFtHNbVZ-XUxETVwduJYz94UYuJGAPxBrbGeZpSClUtXYsPJBABfr03KM=@protonmail.com>
 <e724b4c5-9efd-66c4-163b-492f17cafd7d@riseup.net>
 <Sy14DpcFGdAYL95d7e6tfkOe87oY53tJReo9CYvPT5J3Gb85AqedMheq1NbfVKUXZtZrwZqwVV4wSztikgWBAgNfTh8J5h5gXC6HDMxvsNg=@protonmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Subject: Re: [bitcoin-dev] Design for a CoinSwap implementation for
	massively improving Bitcoin privacy and fungibility
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: Bitcoin Protocol Discussion <bitcoin-dev.lists.linuxfoundation.org>
List-Unsubscribe: <https://lists.linuxfoundation.org/mailman/options/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=unsubscribe>
List-Archive: <http://lists.linuxfoundation.org/pipermail/bitcoin-dev/>
List-Post: <mailto:bitcoin-dev@lists.linuxfoundation.org>
List-Help: <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=help>
List-Subscribe: <https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev>, 
 <mailto:bitcoin-dev-request@lists.linuxfoundation.org?subject=subscribe>
X-List-Received-Date: Sat, 06 Jun 2020 03:59:38 -0000

Good morning again Chris,

I am uncertain if you are aware, but some years ago somebody claimed that 2=
p-ECDSA could use Scriptless Script as well over on lightning-dev.

* https://lists.linuxfoundation.org/pipermail/lightning-dev/attachments/201=
80426/fe978423/attachment-0001.pdf
* https://lists.linuxfoundation.org/pipermail/lightning-dev/2018-April/0012=
21.html

I cannot claim to follow the math enough to say it is actually secure, but =
the idea does exist.

If this is sufficiently secure, we can fold the Spilman backout into the sc=
riptless script swap as well.

* Alice creates secret keypairs A[0] =3D a[0] * G, A[1] =3D a[1] * G
* Bob creates secret keypairs B[0] =3D b[0] * G, B[1] =3D b[1] * G
* Alice creates (but does not sign) funding from Alice -> A[0] && B[0]
* Bob provides partial signature for A[0] && B[0] -(nLockTime=3Dlocktime1)-=
> Alice to Alice and Alice completes this signature and stashes it.
* Bob creates (but does not sign) funding from Bob -> A[1] && B[1]
* Alice provides partial signature for A[1] && B[1] -(nLockTime=3DlockTime2=
)-> Bob to Bob and Bob completes this signature and stashes it.
* Alice and Bob sign and broadcast their funding transactions.
  * This can safely be done in any order; Bob will refuse to continue with =
the protocol until it sees Alice funding is confirmed, and will abort if lo=
cktime2 is too near.
* Alice waits for Bob funding tx to confirm.
* Alice provides a 2p-ECDSA adaptor signature for A[1] && B[1] --> Alice; t=
he adaptor signature, when completed, reveals the secret a[0] to Bob.
* Bob waits for Alice funding tx to confirm.
* Bob provides the partial signature for the given adaptor signature for A[=
1] && B[1] --> Alice and  Alice completes this signature and stashes it.
* Alice gives a[0] outright to Bob.
* Bob gives b[1] outright to Alice.
* Alice spends the A[1] && B[1] output before locktime2.
* Bob spends the A[0] && B[0] output before locktime1.

I also pointed out the griefing problem in Lightning also applies to SwapMa=
rket.
Bob can limit the griefing problem by requiring that locktime2 <=3D now + 1=
2, and requiring that locktime1 >=3D now + 60.
This means that Alice has to lock its funds for 10 hours if it forces Bob t=
o lock its funds for 2 hours, making it undesirable as an attack on competi=
ng makers.
This does prevent chaining (no maker is going to accept the outgoing), but =
if Alice wants chaining it can always use the private key handed over to im=
mediately start a funding tx with another Bob.

(This is not a good solution for griefing in the Lightning Network since ch=
annels are intended to be reused there, whereas the Spilman channels in Coi=
nSwap exist only to allow funding transactions to confirm in any order onch=
ain, and are used only for the specific swap; in Lightning the forwarding n=
ode has an incentive to release the incoming HTLC immediately instead of im=
posing the incoming wait time since the funding can be reused for a differe=
nt payment, but in CoinSwap it cannot be reused anyway, so it could just le=
t the incoming timelock lapse instead of releasing that encumbrance as woul=
d be done in Lightning.)

Regards,
ZmnSCPxj