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
265
266
267
268
269
270
271
272
273
|
Delivery-date: Mon, 12 May 2025 04:03:27 -0700
Received: from mail-qv1-f58.google.com ([209.85.219.58])
by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256
(Exim 4.94.2)
(envelope-from <bitcoindev+bncBDBNTKFG4EDRB4NKQ7AQMGQE2MT37XA@googlegroups.com>)
id 1uEQwQ-0001jH-Bz
for bitcoindev@gnusha.org; Mon, 12 May 2025 04:03:27 -0700
Received: by mail-qv1-f58.google.com with SMTP id 6a1803df08f44-6f5462cdfb2sf85035066d6.1
for <bitcoindev@gnusha.org>; Mon, 12 May 2025 04:03:25 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1747047798; cv=pass;
d=google.com; s=arc-20240605;
b=SFfIAI1nCW7Ou8zu9V4j90y898AoHXnzulr4qGeUM4xqzWe6vOnOq0fxL+pMu7HPt1
+1zQeOLDpDkWwu6f4N1MqZ1iB6k8GociWZp7SLJxDYIDpqpe9Eks24cQpGnWmEFeIkLd
3K0gfmTNIGiIPJ83g5WdJF/eRr3TSm+hePsv31FLkkyV9wXvTssaDRdsZNiS3C31yhYM
P0DcMQNysqG/nbQzn4Co5AEofaIm2nHq1W1bWokiZ0RtVLGGTovydiS1zLbtiTnQYhIL
mHfJa/7GA/fZpEcI6XqfJD0OomJxuV8UZNkW1mS48KhH6ucTgMAtrZ8/9DfQalcQkfi7
wcUw==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:in-reply-to:content-disposition
:mime-version:references:message-id:subject:cc:to:from:date:sender
:dkim-signature;
bh=blfs7d6/RuJ2PUm/fPdo8WcrWep7RXW104HRLl93oRQ=;
fh=5dMSulSXsZES/AeBjtNafZ6LxCZ+qp2A1gFk8TPbxnM=;
b=dw52r8+7yCnG0K/4VBK8qs8PQbj1DJ88iGKWYOJAlLQDe1mbjdTkOZ1giZ7l/bDADT
HAz4W737uxi51to2p2bFLL3YBRu8TNsP0IeLcHEBwOvU8Muv3eo4gB0T9LGLoSUd0UDd
7ztKxml/9AyiW0aN6G5Xjm6aZMkIzSqNXUSNSXVKQG17i+Ok4B4BLattIEwn9l9Q3WHF
NEr/Od9wtazJ/vWsfmqQUawQZhwLI/vpmlrX3SOrdOKngsmlcbehiM3LIIAx0zg9yJb6
gPnPxEE4+V1SwVI+iVqtFi3k7BH8WwoTaKTEAowYqtQTboq8aXG08pSQWgs/IWjlwcmL
bCIg==;
darn=gnusha.org
ARC-Authentication-Results: i=2; gmr-mx.google.com;
spf=pass (google.com: domain of aj@erisian.com.au designates 172.104.61.193 as permitted sender) smtp.mailfrom=aj@erisian.com.au
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=googlegroups.com; s=20230601; t=1747047798; x=1747652598; darn=gnusha.org;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:in-reply-to:content-disposition:mime-version
:references:message-id:subject:cc:to:from:date:sender:from:to:cc
:subject:date:message-id:reply-to;
bh=blfs7d6/RuJ2PUm/fPdo8WcrWep7RXW104HRLl93oRQ=;
b=iECc7jruqjUhGkSM6w3WOwnkb3yJsAomMPViLJ3t5vMrA/+WHb1P6abjixwHO8OO5H
zOmEvagLOAPYr18828JaorVkRg7TwuP6L7qMrPBN+VnJbTa43NQXx1bAMKF8UO33/KW5
PRnSOE/208Sox+gfKGboEG/WIgpxf+gNpKVS2kMkqBLjvhKY0rcUfD1uaPLH8j0/XlXQ
TmCA+c/35Z2h0L1Gmc0EIOmDEwY5G7EVDv1jiVxlucenpNQzl6o/ypJ73KnLvROSp9W1
SkLFrn1p58Bu+Cm+j6f3M0TB3zEuD91uxl/uzxAK2c2DFfwel1t/0vOve6Rqz5gpNWbP
BjSg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1747047798; x=1747652598;
h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
:list-id:mailing-list:precedence:x-original-authentication-results
:x-original-sender:in-reply-to:content-disposition:mime-version
:references:message-id:subject:cc:to:from:date:x-beenthere
:x-gm-message-state:sender:from:to:cc:subject:date:message-id
:reply-to;
bh=blfs7d6/RuJ2PUm/fPdo8WcrWep7RXW104HRLl93oRQ=;
b=xARNPHo6VZEWODcHP9tHwhFIlZswCV/zo2mbz7/YQhn+iXUaBesla8jrBfcshrMpnV
wGzRNntQ6bs6yD2Qf88pcahLamTSu8VrRFxg37FOGymX9HRnpyWoA70OgO8dcr3j401W
oyt+eX5n/UP+TdOV0FNV3xUPLtzvUJZOaLGINFlgtY17V78/BysZsS+X+MreFLDcwqSt
jJvolao7BS4LMMrRfQPXH7pYlRAbNA8klymRcrvupcEcg6snMpUNHmgiSumGaInmsmh8
Up+ku+rnZwia6ULUCUDmbnwzN10GLwK/Wjfq4MI+znUtgr7Upse8F5K2ZNxxFkXkbOJy
WoAw==
Sender: bitcoindev@googlegroups.com
X-Forwarded-Encrypted: i=2; AJvYcCWAJ9TasufZT7TgSBAhudBzYccFsaDERahhWbuhtN9ysfEq4xKWWyBDUYaO82TE5jmGTetZyMPZjeF6@gnusha.org
X-Gm-Message-State: AOJu0YyEub3XCeIZgdEc51d2j0klpJQi3stq1XuOSYkgkNq5O5iTgEk6
F5gJOFh2A4P5GDKoCKzO0RwjggDNA0f8hprvhk2qTtcAN8g/1Jci
X-Google-Smtp-Source: AGHT+IHgLaZDfdxl7nFjysLkub5NRWzdUxjrLlt1OoxfHUozraKhxmwphlSjpcyHQWuhMLyKRm7QXg==
X-Received: by 2002:ad4:5aa5:0:b0:6f5:436:9e46 with SMTP id 6a1803df08f44-6f6e47c77eemr199128226d6.15.1747047797858;
Mon, 12 May 2025 04:03:17 -0700 (PDT)
X-BeenThere: bitcoindev@googlegroups.com; h=AVT/gBEnwgq+YcIi1+x9bWMbWJfJXvJSzF4B/Jja1v/AaIP0BA==
Received: by 2002:a05:6214:7eb:b0:6e8:fa98:8af6 with SMTP id
6a1803df08f44-6f54b61d61fls52171806d6.1.-pod-prod-03-us; Mon, 12 May 2025
04:03:13 -0700 (PDT)
X-Forwarded-Encrypted: i=2; AJvYcCUY2OGLLeLpFeany+Npiem62n/yE0MTR05fxl2BM1U84LstyohRSB8tfAZdQXovO/QC7LiJa64GZbcV@googlegroups.com
X-Received: by 2002:a05:6214:1bc8:b0:6f4:c423:67ba with SMTP id 6a1803df08f44-6f6e47bc77bmr170659406d6.4.1747047793574;
Mon, 12 May 2025 04:03:13 -0700 (PDT)
Received: by 2002:a05:620a:8216:b0:7c5:50d5:7703 with SMTP id af79cd13be357-7ccfa178a37ms85a;
Sun, 11 May 2025 22:21:42 -0700 (PDT)
X-Forwarded-Encrypted: i=2; AJvYcCWfdF6nPLh/TsAZ0MDjkosvoUqlmH9FTtjcYP/npmFuYX7grG6xfEsl0s7M0YIlgJxYP6DxCJJPcrwR@googlegroups.com
X-Received: by 2002:a05:6102:2d0a:b0:4dd:b9ec:b12d with SMTP id ada2fe7eead31-4deed30531emr8861423137.4.1747027301804;
Sun, 11 May 2025 22:21:41 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1747027301; cv=none;
d=google.com; s=arc-20240605;
b=EYjTRwWdMBLHb7nrKNukiXzF6Ec31ACxhYq+ZcEsi3FsY+mWBSgtL7+TtNJFN8CsLb
n0IznG6Ct7pbwPe+zC0cwi0QAR/f8umitzytmBopBmIWJz4TI6/iYrHMtKbzP8fETUAz
AZ+yF5P6O6809R7YqEump0QBthFmp0ttB1OIbQj/26304P5prvK05lnccePzqrwm37Ri
keMag3vQV2mN470FGSPxmY+V7kd9B3ROVQOA0pkucq4B4kqdtlnwri7SLIxaaJpbqNJS
j8PJXUBwF+IkLtF4ofWM2j98NvScEMTSCbTeUy9guINS9EHAGEkoSzLtzulpoLv7gnPa
iU+Q==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605;
h=in-reply-to:content-disposition:mime-version:references:message-id
:subject:cc:to:from:date;
bh=0cELN2n1OPl07ZNNlFdDyW81kLH6hZ+3mIqiKsEAZHk=;
fh=ZyQsRb+WqngleU9mBR1uQ1Bot1L4oh7o9L+UL/D3q6E=;
b=F8M7u7AqQw8FM2QfLV9i+OeWvL4tkV12366QgEPG1aW2AI/we+MUNEkRe38pcXFQ8B
CW+PtUCi5/bLjoKy4fohkMdIU9OP1DTpAbtVNDTbkuWOL/eIAluFztbYq31ME8UZkWpV
7XC4vry3wvcxI+C9pTXZ0oHxLjMPjCipqLAHdgBtAabXtQol27cMqK1If4BgQ2yt6KAM
B8CyfF2yVdB4aGwAThAWAaH+HL4tXe2gvuY4y0QhoVuU8Yk2Scq1h7Jfu/m7iG142CGg
9m3lUxHAiemMm4fhfBmrdxvBIsbv5fl7U8/S/nvEddz2icAnLCLgtCgZ0zGVkptDexr5
aa4g==;
dara=google.com
ARC-Authentication-Results: i=1; gmr-mx.google.com;
spf=pass (google.com: domain of aj@erisian.com.au designates 172.104.61.193 as permitted sender) smtp.mailfrom=aj@erisian.com.au
Received: from cerulean.erisian.com.au (azure.erisian.com.au. [172.104.61.193])
by gmr-mx.google.com with ESMTPS id ada2fe7eead31-4dea85a79d0si298708137.1.2025.05.11.22.21.41
for <bitcoindev@googlegroups.com>
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
Sun, 11 May 2025 22:21:41 -0700 (PDT)
Received-SPF: pass (google.com: domain of aj@erisian.com.au designates 172.104.61.193 as permitted sender) client-ip=172.104.61.193;
Received: from aj@azure.erisian.com.au
by cerulean.erisian.com.au with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384
(Exim 4.96)
(envelope-from <aj@erisian.com.au>)
id 1uELbc-0000ou-2Z;
Mon, 12 May 2025 15:21:38 +1000
Received: by email (sSMTP sendmail emulation); Mon, 12 May 2025 15:21:32 +1000
Date: Mon, 12 May 2025 15:21:32 +1000
From: Anthony Towns <aj@erisian.com.au>
To: Garlo Nicon <garlonicon@gmail.com>
Cc: Saint Wenhao <saintwenhao@gmail.com>, Greg Maxwell <gmaxwell@gmail.com>,
Bitcoin Development Mailing List <bitcoindev@googlegroups.com>
Subject: Re: [bitcoindev] Re: Unbreaking testnet4
Message-ID: <aCGFXI4PRq_eyrEf@erisian.com.au>
References: <hU75DurC5XToqizyA-vOKmVtmzd3uZGDKOyXuE_ogE6eQ8tPCrvX__S08fG_nrW5CjH6IUx7EPrq8KwM5KFy9ltbFBJZQCHR2ThoimRbMqU=@protonmail.com>
<afb749b2-bdb8-4b2a-84ec-b703a64ad765n@googlegroups.com>
<CACgYNO+fsUtx=F=ZLZVq=FJfrgHv8NnKsjmoVS8LLVU78zjKDw@mail.gmail.com>
<CAN7kyNiWimDXDV5xT8MCZTvKzrunjfMDDOtTYcmKdQNN1z7Lsg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Disposition: inline
In-Reply-To: <CAN7kyNiWimDXDV5xT8MCZTvKzrunjfMDDOtTYcmKdQNN1z7Lsg@mail.gmail.com>
X-Spam_score: 1.0
X-Spam_bar: +
X-Original-Sender: aj@erisian.com.au
X-Original-Authentication-Results: gmr-mx.google.com; spf=pass
(google.com: domain of aj@erisian.com.au designates 172.104.61.193 as
permitted sender) smtp.mailfrom=aj@erisian.com.au
Precedence: list
Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com
List-ID: <bitcoindev.googlegroups.com>
X-Google-Group-Id: 786775582512
List-Post: <https://groups.google.com/group/bitcoindev/post>, <mailto:bitcoindev@googlegroups.com>
List-Help: <https://groups.google.com/support/>, <mailto:bitcoindev+help@googlegroups.com>
List-Archive: <https://groups.google.com/group/bitcoindev
List-Subscribe: <https://groups.google.com/group/bitcoindev/subscribe>, <mailto:bitcoindev+subscribe@googlegroups.com>
List-Unsubscribe: <mailto:googlegroups-manage+786775582512+unsubscribe@googlegroups.com>,
<https://groups.google.com/group/bitcoindev/subscribe>
X-Spam-Score: -0.7 (/)
> > Hard fork in an ultramassive premine, as large as possible but what stays
> > with existing value overflow logic. (so maybe an additional 21 million
> > testnet btc?).
The existing logic gives errors if:
* a single input of a tx (ie a coin in the utxo set), or the sum of inputs to
a txn, is outside the range 0-21M (bad-txns-inputvalues-outofrange)
* a single output of a tx is outside the range 0-21M
(bad-txns-vout-negative or bad-txns-vout-toolarge)
* the sum of the outputs of a single tx is outside the range 0-21M
(bad-txns-txouttotal-toolarge)
* the fee paid by a single tx is outside the range 0-21M
(bad-txns-fee-outofrange)
* a block's fees go outside the range 0-21M
(bad-txns-accumulated-fee-outofrange)
Keeping the total supply under 21M seems nicer than having txs that
spend real utxos be able to hit these errors (eg, by combining
the premine utxo at 21M with a coinbase reward of 50 and hitting
bad-txns-inputvalues-outofrange).
That's pretty easy to achieve: just have the initial premine be half the
supply (eg), and also cut the halvening time in half (so 10.5M premine,
105,000 blocks in a halving). Or you could have halvenings every 6 months
(26250 blocks), and have an 18.375M premine, or whatever.
You could also consider premining (almost) the entire supply, and have
the block reward be entirely fees (almost) immediately after that, but I
think there's value in making it possible to obtain coins for testing in
a permissionless, anonymous and relatively low-latency manner, for which
PoW is great. Might also be annoying for empty blocks to pay a reward of
exactly 0, so if miners included their address in the coinbase tx like
normal, they'd be creating a 0 valued utxo, and probably never spend it.
I had a quick poke at what code to allow for chains with premines might
look like here:
https://github.com/ajtowns/bitcoin/commits/202505-premine/
About 11 lines of code to implement the logic.
If this approach made the testnet difficulty reset logic obsolete
(ie, a testnet with just PoW and a premine turns out to work fine),
that would drop 14 lines of code for the fPowAllowMinDifficultyBlocks
and enforce_BIP94 logic. Presumably a PoW-only testnet could also have
its min-difficulty bumped from 1 to 65536 or more, since it seems like
a single Bitaxe can still maintain the chain at that difficulty.
The idea of this approach is that when establishing a premined testnet,
you would:
a) first define the chain, with a new genesis, etc; then set
nSubsidyHalvingInterval=105000 and premine=10'500'000*COIN or similar,
but leave premine_block_hash=0
b) build the node software, and mine block 1 to the premine address.
c) set premine_block_hash to block 1's hash. publish the code with the
genesis block and block 1 hash, so that the public can mine as of
block 2.
d) once 100 blocks have been mined, split the premine up amongst
devs, faucets, wallet maintainers, user groups, a managed endowment
for future testers, whatever.
On Fri, May 09, 2025 at 03:07:48PM +0200, Garlo Nicon wrote:
> Why hard-forking anything? The starting difficulty is set to 1, and it
> raises to 4 almost instantly, when testnet creators are mining the first
> coins. Which means, that difficulty 1 is ridiculously easy to work with,
> when you have any ASICs. If you combine it with the idea of fake
> timestamps,
It's not the number of blocks, but the cumulative work that matters, so to
have a soft reset of testnet3 or testnet4 you'd need to apply more hashing
for the new chain than the existing chains have already received. That's
a fair amount of "wasted" hash: I think mining a more-work chain than
testnet4 would require about the same amount of hash that it would take
to mine ~13 mainnet blocks at the current difficulty, so you'd be giving
up about $4M USD in mainnet block rewards to do it.
In any event, a hard fork is "necessary", as otherwise whenever it
takes 20 minutes or more to find a block, old clients will expect a
lower difficulty than new clients do, so the two wouldn't be compatible
with each other. You could do various things to work around that, but
that's a lot of coding time that could be better spent on improving
things relevant to mainnet, and if you're resetting the chain anyway,
there's not much advantage to it.
> then you can produce a really long initial chain, which will
> start in 2009, and up to 2025, it will produce almost the same amount of
> blocks as mainnet.
A soft fork of testnet3 would start 3rd Feb 2011 (leading to about 750k
blocks vs mainnet's ~900k), and a soft fork of testnet4 would start at
4th May 2024 (leading to about 54k blocks). (These are the timestamps
of the respective genesis blocks)
A disadvantage of doing a premine that way is that users of the chain
need to download and validate thousands of blocks and deal with an equal
number of utxos just to establish the premine; doing that in a single
block with a single utxo (or one utxo for each recipient of the premine)
is quite a bit more efficient.
> Which means, that instead of "premine", you can use "ninja-mine", and
> achieve pretty much the same end result.
I think in general usage "premine" covers both those approaches -- any
time the creator(s) of a chain gets the opportunity to claim/distribute
coins prior to the general public being able to mint new coins by mining
blocks, that's a premine.
Cheers,
aj
--
You received this message because you are subscribed to the Google Groups "Bitcoin Development Mailing List" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bitcoindev+unsubscribe@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/bitcoindev/aCGFXI4PRq_eyrEf%40erisian.com.au.
|