summaryrefslogtreecommitdiff
path: root/a5/cb98916e40c7c1cf42daf353cfc719ae1a98a9
blob: 7fc4331b83253092c5ffe20537d78ab393232b6e (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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
Return-Path: <lautarodragan@gmail.com>
Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org
	[172.17.192.35])
	by mail.linuxfoundation.org (Postfix) with ESMTPS id D345FC58
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sat,  9 Mar 2019 19:52:40 +0000 (UTC)
X-Greylist: whitelisted by SQLgrey-1.7.6
Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com
	[209.85.221.42])
	by smtp1.linuxfoundation.org (Postfix) with ESMTPS id AD7A2318
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sat,  9 Mar 2019 19:52:39 +0000 (UTC)
Received: by mail-wr1-f42.google.com with SMTP id l12so946029wrp.6
	for <bitcoin-dev@lists.linuxfoundation.org>;
	Sat, 09 Mar 2019 11:52:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
	h=mime-version:references:in-reply-to:reply-to:from:date:message-id
	:subject:to; bh=dNRZCqMJLXAJRrhR9dZQ6PeRjqi0NlDn6gx/Jq6rYS8=;
	b=ZpOetsxLE3KiQJ86oZhuTYUz+q62wdutMqXLbTHkntRuTYHFrduWeycb3d8uC9Q47e
	biYVsC/tz9lplKn9oC19cIrrHysUGxOf9khbMJiK0JlsE9NZ43jP0lvUzmk29GuEMAWi
	b53gk+0afFjFRV9YrNGKUqZ9E7SBXwTsqsbi8Weu7bZi2wryDArSosJzdXekhtS188/z
	ZAib1XCulrnq3rys5kkxnQa7yjNN7JNleyfE1a6j9T9P4dT1byxmstCv0F0zRNhDHlEF
	3PYMhOMZGBWbCYpd3YMQN68krIjCgVYUI8YseJup26eCLvzbE0r76FfxBYdVsci5waRM
	QEvw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
	d=1e100.net; s=20161025;
	h=x-gm-message-state:mime-version:references:in-reply-to:reply-to
	:from:date:message-id:subject:to;
	bh=dNRZCqMJLXAJRrhR9dZQ6PeRjqi0NlDn6gx/Jq6rYS8=;
	b=Wm6MiD/R7E9u0W8EHXKIg+i8PAo8uFZZvnmEXnz7LWeEzzrWNOGn14eKgkLKW1aMWz
	8rkg81J17cZo9DY5fUExF3vFjIQHBU/OyixMGPv/XRmuC//wwfIrsONFxzYHkXhKcP5g
	6VgX+3Rw1Tp215PKZamd3cvvqlWoBSoCtwAOgBzHYjzVjgFqzXx8/FnfIeYaDr7/7E2M
	9cxM1O/lqQVxkKl/7rWx5bXGtx9SJHAt9vRSPSoO341eoSEIr3/4g9RoXBRaN/OgvEfJ
	FXrY97xwgz64UH9kjjmzkN6farhv/ddqgGYjOxto/PVjh1v5J3GBRyCZN4TMKAtiqHeJ
	9+jg==
X-Gm-Message-State: APjAAAW8l+kl3rt0l5HG15LKFj3a1OERltzMzvCI6malf34c/icdjYCr
	3jHRyDtGVe9DecDQbG/TDYEQL+lQGOGp34AXfFxP2u4B
X-Google-Smtp-Source: APXvYqy6/9n66RUhxs25S71N/zJqq3gq/k7x/ylu4y0P/d1fQl/8lsU3yH5Zmm+mjn/UtiaLHfsosqpN6denEA85dq0=
X-Received: by 2002:adf:ba84:: with SMTP id p4mr15384550wrg.156.1552161158059; 
	Sat, 09 Mar 2019 11:52:38 -0800 (PST)
MIME-Version: 1.0
References: <CALJw2w5OiKHk1oj1p=rmQ-jvYOdieOD=xHcPt9D0A_-nLKvv7Q@mail.gmail.com>
In-Reply-To: <CALJw2w5OiKHk1oj1p=rmQ-jvYOdieOD=xHcPt9D0A_-nLKvv7Q@mail.gmail.com>
Reply-To: lautaro.dragan@gmail.com
From: Lautaro Dragan <lautarodragan@gmail.com>
Date: Sat, 9 Mar 2019 16:52:26 -0300
Message-ID: <CAK6DEsozy9kuqAMFvqu5qeFMq9S+hE7zpZAb1FhJ+8OvdDARWQ@mail.gmail.com>
To: Karl-Johan Alm <karljohan-alm@garage.co.jp>, 
	Bitcoin Protocol Discussion <bitcoin-dev@lists.linuxfoundation.org>
Content-Type: multipart/alternative; boundary="00000000000075dc6b0583aeae25"
X-Spam-Status: No, score=-1.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,
	DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,FREEMAIL_REPLYTO,HTML_MESSAGE,
	RCVD_IN_DNSWL_NONE autolearn=no version=3.3.1
X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on
	smtp1.linux-foundation.org
X-Mailman-Approved-At: Sat, 09 Mar 2019 22:19:05 +0000
Subject: Re: [bitcoin-dev] Signet
X-BeenThere: bitcoin-dev@lists.linuxfoundation.org
X-Mailman-Version: 2.1.12
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, 09 Mar 2019 19:52:40 -0000

--00000000000075dc6b0583aeae25
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Karl-Johan, my two cents:

At Po.et we use regtest to simulate reorgs in integration tests in Travis /
CircleCI. It has proved quite useful.

In general regtest for automated testing has given us all we needed so far,
but I admit we have a rather simple use of Bitcoin right now (colored
coins).

For local development, we sometimes use a script that "mines" blocks in
regtest periodically. It was my goal to also use this method in QA,
although we wound up using testnet and didn't encounter any problems so far=
.

Out of curiosity: what limitations did you find in using, for example, a
private network of bitcoin core nodes running regtest? (this gives you the
same power as centralization without any changes or extra functionality
required)

El vie., 8 de mar. de 2019 a la(s) 16:02, Karl-Johan Alm via bitcoin-dev <
bitcoin-dev@lists.linuxfoundation.org> escribi=C3=B3:

> Hello,
>
> As some of you already know, I've been working on a network called
> "signet", which is bascially a complement to the already existing testnet=
,
> except it is completely centralized, and blocks are signed by a specific
> key rather than using proof of work.
>
> Benefits of this:
>
> 1. It is more predictable than testnet. Miners appear and disappear
> regularly, causing irregular block generation.
>
> 2. Since it is centrally controlled, it is easy to perform global testing=
,
> such as reorgs (e.g. the network performs a 4 block reorg by request, or =
as
> scheduled).
>
> 3. It is more stable than testnet, which occasionally sees several
> thousand block reorgs.
>
> 4. It is trivial to spin up (and shut down) new signets to make public
> tests where anyone can participate.
>
> Anyone can create a signet at any time, simply by creating a key pair and
> creating a challenge (scriptPubKey). The network can then be used globall=
y
> by anyone, assuming the creator sends some coins to the other participant=
s.
>
> Having a persistent signet would be beneficial in particular to services
> which need a stable place to test features over an extended period of tim=
e.
> My own company implements protocols on top of Bitcoin with sidechains. We
> need multi-node test frameworks to behave in a predictable manner (unlike
> testnet) and with the same standardness relay policy as mainnet.
>
> Signets consist of 2 parameters: the challenge script (scriptPubKey) and
> the solution length. (The latter is needed to retain fixed length block
> headers, despite having an additional payload.)
>
> I propose that a default persistent "signet1" is created, which can be
> replaced in future versions e.g. if the coins are unwisely used as real
> money, similarly to what happened to previous testnets. This signet is
> picked by default if a user includes -signet without providing any of the
> parameters mentioned above. The key holder would be someone sufficiently
> trusted in the community, who would be willing to run the system (block
> generation code, faucet, etc). It could be made a little more sturdy by
> using 1-of-N multisig as the challenge, in case 1 <=3D x < N of the signe=
rs
> disappear. If people oppose this, it can be skipped, but will mean people
> can't just jump onto signet without first tracking down parameters from
> somewhere.
>
> Implementation-wise, the code adds an std::map with block hash to block
> signature. This is serialized/deserialized as appropriate (Segwit witness
> style), which means block headers in p2p messages are (80 +
> solution_length) bytes. Block header non-contextual check goes from
> checking if block header hash < target to checking if the payload is a
> valid signature for the block header hash instead.
>
> Single commit with code (will split into commits and make PR later, but
> just to give an idea what it looks like):
> https://github.com/kallewoof/bitcoin/pull/4
>
> I don't think this PR is overly intrusive, and I'm hoping to be able to
> get signet code into Bitcoin Core eventually, and am equally hopeful that
> devs of other (wallet etc) implementations will consider supporting it.
>
> Feedback requested on this.
>
> Attribution: parts of the signet code (in particular signblock and
> getnewblockhex) were adapted from the ElementsProject/elements repository=
.
> When PR is split into atomic commits, I will put appropriate attribution
> there.
>
> _______________________________________________
> bitcoin-dev mailing list
> bitcoin-dev@lists.linuxfoundation.org
> https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev
>

--00000000000075dc6b0583aeae25
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Hi Karl-Johan, my two cents:<div><br></div><div>At Po.et w=
e use regtest to simulate reorgs in integration tests in Travis / CircleCI.=
 It has proved quite useful.=C2=A0</div><div><br></div><div>In general regt=
est for automated testing has given us all we needed so far, but I admit we=
 have a rather simple use of Bitcoin right now (colored coins).</div><div><=
br></div><div>For local development, we sometimes use a script that &quot;m=
ines&quot; blocks in regtest periodically. It was my goal to also use this =
method in QA, although we wound up using testnet and didn&#39;t encounter a=
ny problems so far.</div><div><br></div><div>Out of curiosity: what limitat=
ions did you find in using, for example, a private network of bitcoin core =
nodes running regtest? (this gives you the same power as centralization wit=
hout any changes or extra functionality required)</div></div><br><div class=
=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">El vie., 8 de mar. d=
e 2019 a la(s) 16:02, Karl-Johan Alm via bitcoin-dev &lt;<a href=3D"mailto:=
bitcoin-dev@lists.linuxfoundation.org">bitcoin-dev@lists.linuxfoundation.or=
g</a>&gt; escribi=C3=B3:<br></div><blockquote class=3D"gmail_quote" style=
=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir=
=3D"ltr"><div dir=3D"ltr"><div dir=3D"ltr">Hello,<div><br></div><div>As som=
e of you already know, I&#39;ve been working on a network called &quot;sign=
et&quot;, which is bascially a complement to the already existing testnet, =
except it is completely centralized, and blocks are signed by a specific ke=
y rather than using proof of work.</div><div><br></div><div>Benefits of thi=
s:</div><div><br></div><div>1. It is more predictable than testnet. Miners =
appear and disappear regularly, causing irregular block generation.</div><d=
iv><br></div><div>2. Since it is centrally controlled, it is easy to perfor=
m global testing, such as reorgs (e.g. the network performs a 4 block reorg=
 by request, or as scheduled).</div><div><br></div><div>3. It is more stabl=
e than testnet, which occasionally sees several thousand block reorgs.</div=
><div><br></div><div>4. It is trivial to spin up (and shut down) new signet=
s to make public tests where anyone can participate.</div><div><br></div><d=
iv>Anyone can create a signet at any time, simply by creating a key pair an=
d creating a challenge (scriptPubKey). The network can then be used globall=
y by anyone, assuming the creator sends some coins to the other participant=
s.</div><div><br></div><div>Having a persistent signet would be beneficial =
in particular to services which need a stable place to test features over a=
n extended=C2=A0period of time. My own company implements protocols on top =
of Bitcoin with sidechains. We need multi-node test frameworks to behave in=
 a predictable manner (unlike testnet) and with the same standardness relay=
 policy as mainnet.<br></div><div><br></div><div>Signets consist of 2 param=
eters: the challenge script (scriptPubKey) and the solution length. (The la=
tter is needed to retain fixed length block headers, despite having an addi=
tional payload.)</div><div><br></div><div>I propose that a default persiste=
nt &quot;signet1&quot; is created, which can be replaced in future versions=
 e.g. if the coins are unwisely used as real money, similarly to what happe=
ned to previous testnets. This signet is picked by default if a user includ=
es -signet without providing any of the parameters mentioned above. The key=
 holder would be someone sufficiently trusted in the community, who would b=
e willing to run the system (block generation code, faucet, etc). It could =
be made a little more sturdy by using 1-of-N multisig as the challenge, in =
case 1 &lt;=3D x &lt; N of the signers disappear. If people oppose this, it=
 can be skipped, but will mean people can&#39;t just jump onto signet witho=
ut first tracking down parameters from somewhere.</div><div><br></div><div>=
Implementation-wise, the code adds an std::map with block hash to block sig=
nature. This is serialized/deserialized as appropriate (Segwit witness styl=
e), which means block headers in p2p messages are (80=C2=A0+ solution_lengt=
h) bytes. Block header non-contextual check goes from checking if block hea=
der hash &lt; target to checking if the payload is a valid signature for th=
e block header hash instead.</div><div><br></div><div>Single commit with co=
de (will split into commits and make PR later, but just to give an idea wha=
t it looks like):=C2=A0<a href=3D"https://github.com/kallewoof/bitcoin/pull=
/4" target=3D"_blank">https://github.com/kallewoof/bitcoin/pull/4</a></div>=
<div><br></div><div>I don&#39;t think this PR is overly intrusive, and I&#3=
9;m hoping to be able to get signet code into Bitcoin Core eventually, and =
am equally hopeful that devs of other (wallet etc) implementations will con=
sider supporting it.</div><div><br></div><div>Feedback requested on this.</=
div><div><br></div><div>Attribution: parts of the signet code (in particula=
r signblock and getnewblockhex) were adapted from the ElementsProject/eleme=
nts repository. When PR is split into atomic commits, I will put appropriat=
e attribution there.</div><div><br></div></div></div></div>
_______________________________________________<br>
bitcoin-dev mailing list<br>
<a href=3D"mailto:bitcoin-dev@lists.linuxfoundation.org" target=3D"_blank">=
bitcoin-dev@lists.linuxfoundation.org</a><br>
<a href=3D"https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev" =
rel=3D"noreferrer" target=3D"_blank">https://lists.linuxfoundation.org/mail=
man/listinfo/bitcoin-dev</a><br>
</blockquote></div>

--00000000000075dc6b0583aeae25--