From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Thu, 30 May 2024 15:00:23 -0700 Received: from mail-yb1-f191.google.com ([209.85.219.191]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sCnos-0000pV-Ul for bitcoindev@gnusha.org; Thu, 30 May 2024 15:00:23 -0700 Received: by mail-yb1-f191.google.com with SMTP id 3f1490d57ef6-df78b56f6casf2107355276.2 for ; Thu, 30 May 2024 15:00:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717106417; cv=pass; d=google.com; s=arc-20160816; b=oaBVw7NsGMq6HzU0Z8o01TBMMBtPHz8hhLyCaT96Y6sv4j+QqbhqfWr2kfSYLUXaG/ 4EbnMtcIcj9nd4zKzfceiRUP9jEkvfjxnYXI6O+YMj90OV6Zz2rbC+a+4iFRU9DiAKDk 33adIh2sn0sAdcDC/Og93LzeY3txgT22epTdchte6tUaiB9qKPZ6aoY5DGiwPJ6xbEW0 6N1NlOq6YsowcLW1/EMB4k1vZSeAGsglnsd6LEn6OmY00MO6JUKN56Ltq4mWKjKOk/T/ 7yovIdlOA2Bt5LO0A+L8+6mTqFZ6CYv13HuGMdW26xTPJvdFzW4QCadX8SU+D24vxWbF QxMw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:content-transfer-encoding :in-reply-to:from:content-language:references:to:subject :mime-version:date:message-id:sender:dkim-signature; bh=Yhn62L4NcNcIIH4VzPZuWd9i0ijNQM5rDT7EC8kiLJQ=; fh=SKv7EoTpoM/ArGsU3GocRXvTEFrqgg6KTDI4lTu5bB0=; b=NGTxJwQZuQBSg+QqkoybAJ3t8c4sYeo+n7y8CzDWw5gUTgKFNcW4T1HcT6Bp7W8WA/ PLDe38EpEiGCn32FkPX+kiz4j2XTSSJ+Jp9Ek34W/xMIY12Qx8r5XjqkySZwnwMBH6wF wK1MLQsCYjiIhkbR7+SXCeG1ylluUbLyIA9MSu7botYZEn20SF+JYORPg6CQonIT3SBL VdKMmUA9PkxJJLe2/kPsH9FWnDxsAqiRIJ/gN94JVnp6eQh54eVTebpTVIRWnbyd7eYR EqvOjc91w5SJlif30rUtqxEqkA5o3DaB+/l1ldQAVwNsJmRE/ymjFfHAPCBYlQl5ZbjG NtqA==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; dkim=pass header.i=@mattcorallo.com header.s=1717089661 header.b="C/V+tIdy"; dkim=pass header.i=@clients.mail.as397444.net header.s=1717089664 header.b=OhQHTo3A; spf=pass (google.com: domain of lf-lists@mattcorallo.com designates 2620:6e:a000:1::99 as permitted sender) smtp.mailfrom=lf-lists@mattcorallo.com; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=mattcorallo.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1717106417; x=1717711217; 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:content-transfer-encoding:in-reply-to:from :content-language:references:to:subject:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=Yhn62L4NcNcIIH4VzPZuWd9i0ijNQM5rDT7EC8kiLJQ=; b=pGzA6mI2tZ/5vpvs0ljf8lg2W1NgAW/wk4jI+Mk6RtLpofBdDRfMEQSJjQO31DcOd/ S9B1lNYS9BmGhpYS/NAAmYuxEpDbn9GprubQGs/T2hW/FFc2ocQDvgbva1kvjlsekSMK e0e9c/0okZGxV5QXJJHDOEJR//oy6yYsi5ySmlvb6qw6nABm8RPOR3iODqWZL2H7EL0d JOjhEAw9M8PeBkw0pwlz+MKLsXkhTOKSCA09EhSns5ATvgi9/lfeknDVsf2bM05NgXbe 6ilvcYVlzj7mHT9y/FYhJSJi9xCzfMxjB6+k/hUhurjZD8PnqRUuGj0P+N5Hw3j6ZrM4 O6/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1717106417; x=1717711217; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:content-transfer-encoding:in-reply-to:from :content-language:references:to:subject:mime-version:date:message-id :x-beenthere:x-gm-message-state:sender:from:to:cc:subject:date :message-id:reply-to; bh=Yhn62L4NcNcIIH4VzPZuWd9i0ijNQM5rDT7EC8kiLJQ=; b=Ehadcx70j9zazPdTmNGGaShQBa5qNxAKvUbHGnRezW/JTCYclXF7nuDVGXMxQ2WWQ+ aA2W2LkKpWyhko2gDktji5LhmXdteABli9Mqb0h6eB7U0W0rWSsydaENjL++VS7qaZP9 cfulwax53pO2svbvWc5mZB5nhErOxOdH7uSrHU8sZwq9FUWPpFkrqVU1IQqM2jRd/mX6 9Y12cOOEZ6A1OZbEmAMOoc1Yrpy22i9jeefaKuDeVZ+oKy1JmkozjKpaxu839qvQ+2/J GKze2aLVg06BmJlQ4E/u1dajINCu+wC1fowXNnXaROqlkuc7bMvSmc/qLFwratb9ljYk P00g== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCVA1mN1w+XSJikVa0fKiUWNbclVewoWFcSwsaVx0ycLhF8spBgFiM6hOWushfEBpWQugtEqnNuxB/pSN1OWD0kCG09zG2M= X-Gm-Message-State: AOJu0YxKMH59zJwZu2zjY2SD6DZIZF0RsohrNEBZR8hB8g45ZwYjb4+A M/IZclelGQCmScwI3C7JyJrkEi2/wCE0mHZdECnZTD7T0OGbhj7N X-Google-Smtp-Source: AGHT+IFoTpfhqhV8BwrGhbj9XEtPjZJo37j9P0+/prIOpxBGAJINHHW5jsxXmGJgFNjS0kDMfU+5NQ== X-Received: by 2002:a25:b210:0:b0:dfa:527c:d553 with SMTP id 3f1490d57ef6-dfa73d9d17cmr107032276.44.1717106416581; Thu, 30 May 2024 15:00:16 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com Received: by 2002:a25:a405:0:b0:df4:dbdd:41f5 with SMTP id 3f1490d57ef6-dfa595a5b54ls663277276.0.-pod-prod-05-us; Thu, 30 May 2024 15:00:14 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXcILcd66uUXb84x9slXdVyMsxQeCTiRhpqOZbdyolQAAz1n3CyH+67m5G3KQj23YJHTHBLyrnTlKcW443IjY05coztuHusrJSX2jQ= X-Received: by 2002:a05:690c:ed4:b0:62c:67f4:4f5 with SMTP id 00721157ae682-62c6bcd7a4amr10340367b3.9.1717106414746; Thu, 30 May 2024 15:00:14 -0700 (PDT) Received: by 2002:a81:400e:0:b0:61b:e8f5:76d6 with SMTP id 00721157ae682-62c6bc7b14dms7b3; Thu, 30 May 2024 10:46:42 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCX/WN68lzLN2BbukHXWov3AzPEpSLrIb7H0nQrtiT7ORt8WwrveSYFWW8nz9EPyMa1jN3JpoLgk3i34dxNF+y3XEJayUUSYzrNbgJQ= X-Received: by 2002:a25:187:0:b0:dfa:4746:dc19 with SMTP id 3f1490d57ef6-dfa5a7d57c2mr3067144276.51.1717091201769; Thu, 30 May 2024 10:46:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1717091201; cv=none; d=google.com; s=arc-20160816; b=huYitYJhv548F6f7EdvAJ8kQtmtlxf3znIs+Ia9/k1x6+pcFQjp3sMkq9FmVliNFnR jeSborkdVGhEs/ywTM6KVgJw3Vo+TJiCrp0VpLvjQxvqvH8qFxEsV/XZG/tiCSgiwwYf DqlRNdn763ylDVlO6H3nKsIgy/7pYDUmzyeuAMBOP5oc+yyHs8PaMZFJY7UIv0ks+BxM yD5rh1bsmwh/FWdCvLUyZnlcql+8U8C5xFNGXd4dpj3et2DgFIQl/1jgrFevLvMDi4La rPw6nuvF2e82OJR8GiA5Dy8s4yMnliuCtN+E3pzNggZPIpaSUsD8phryn1Koge3RBrLQ iQdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:to:subject:mime-version:date:message-id:dkim-signature :dkim-signature; bh=GwbHeH7sQKEPMEb/ecXwL+TOxTBijR0+ee1oafcUvvQ=; fh=sPVovLp9/+l1aPWlwCqIr1qyIGaXkkrQWUoWBvIRp44=; b=iefLY3Bdmc3YCRHZ1yBlQIfeyYR37EOLyBmAe7TEWsbIZBKBdtztd4J0cVUvYPh6cZ S/XZmw+lkuR520LXx9luYj8K4Wa4vWlI3SO1xQkFPc3UhtBvs+OU+OYTqi2BwL15D+us GXpGjWXAQ8fH+R6sHGqR/Tnb8LGcqkQYSdhuUULju04aHw/49YiairGkazRT7NSRdWmy a2YiQtCxw3MJAejl3AEXd9mw6vApfKS/KuVCMeuJ80USE+xHDuPRpQL9UdzW/UledGiU eU6OWGh0nBTquCkTuQyqIQCzCC211AIeIp/ktAXAKnrJN/CGk6nUAeS+XqinTJnqke6m en8g==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@mattcorallo.com header.s=1717089661 header.b="C/V+tIdy"; dkim=pass header.i=@clients.mail.as397444.net header.s=1717089664 header.b=OhQHTo3A; spf=pass (google.com: domain of lf-lists@mattcorallo.com designates 2620:6e:a000:1::99 as permitted sender) smtp.mailfrom=lf-lists@mattcorallo.com; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=mattcorallo.com Received: from mail.as397444.net (mail.as397444.net. [2620:6e:a000:1::99]) by gmr-mx.google.com with ESMTPS id 3f1490d57ef6-dfa6eebd7e5si17057276.0.2024.05.30.10.46.41 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 May 2024 10:46:41 -0700 (PDT) Received-SPF: pass (google.com: domain of lf-lists@mattcorallo.com designates 2620:6e:a000:1::99 as permitted sender) client-ip=2620:6e:a000:1::99; X-DKIM-Note: Keys used to sign are likely public at X-DKIM-Note: https://as397444.net/dkim/mattcorallo.com and X-DKIM-Note: https://as397444.net/dkim/clients.mail.as397444.net X-DKIM-Note: For more info, see https://as397444.net/dkim/ Received: by mail.as397444.net with esmtpsa (TLS1.3) (Exim) (envelope-from ) id 1sCjrL-0098YM-0n; Thu, 30 May 2024 17:46:39 +0000 Message-ID: Date: Thu, 30 May 2024 13:46:38 -0400 MIME-Version: 1.0 Subject: Re: [bitcoindev] BIP for Testnet 4 To: Fabian , Bitcoin Development Mailing List References: Content-Language: en-US From: Matt Corallo In-Reply-To: Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: quoted-printable X-Original-Sender: lf-lists@mattcorallo.com X-Original-Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@mattcorallo.com header.s=1717089661 header.b="C/V+tIdy"; dkim=pass header.i=@clients.mail.as397444.net header.s=1717089664 header.b=OhQHTo3A; spf=pass (google.com: domain of lf-lists@mattcorallo.com designates 2620:6e:a000:1::99 as permitted sender) smtp.mailfrom=lf-lists@mattcorallo.com; dmarc=pass (p=NONE sp=REJECT dis=NONE) header.from=mattcorallo.com Precedence: list Mailing-list: list bitcoindev@googlegroups.com; contact bitcoindev+owners@googlegroups.com List-ID: X-Google-Group-Id: 786775582512 List-Post: , List-Help: , List-Archive: , List-Unsubscribe: , X-Spam-Score: -0.8 (/) I believe I raised this on the Bitcoin Core PR, but I strongly think any ne= w testnet should, like=20 was done with testnet3, get a premine with "interesting" scripts and transa= ctions in it (presumably=20 the output of the fuzzer from Bitcoin Core and maybe some valid transaction= s hitting various known=20 edge cases that require valid signatures). This would (potentially) implica= te the BIP as it would=20 imply shipping with an initial checkpoint of the first NN blocks. Matt On 5/28/24 6:01 PM, 'Fabian' via Bitcoin Development Mailing List wrote: > Hello list, >=20 > a potential reset or replacement of Testnet 3 has been discussed on this = list previously here:=20 > https://groups.google.com/g/bitcoindev/c/9bL00vRj7OU/m/9yCPo3uUBwAJ=20 > >=20 > The discussion continued in the accompanying bitcoin core pull request=20 > (https://github.com/bitcoin/bitcoin/pull/29775 )=20 > which has been tested in the past couple of weeks and adopted by several = projects on an experimental=20 > basis, such as https://mempool.space/testnet4 =C2=A0for example. >=20 > I have now formalized the current rules and genesis block implemented in = the PR as BIP draft:=20 > https://github.com/bitcoin/bips/pull/1601 >=20 > ----------- > =3D=3D Abstract =3D=3D >=20 > A new test network with the goal to replace Testnet 3. This network comes= with small but important=20 > improvements of the consensus rules, that should make it impractical to a= ttack the network using=20 > only CPU mining. >=20 > =3D=3D Motivation =3D=3D >=20 > Quoting the original mailing list post from Jameson Lopp: >=20 > "Testnet3 has been running for 13 years. It's on block 2.5 million someth= ing and the block reward is=20 > down to ~0.014 TBTC, so mining is not doing a great job at distributing t= estnet coins anymore. >=20 > The reason the block height is insanely high is due to a rather amusing e= dge case bug that causes=20 > the difficulty to regularly get reset to 1, which causes a bit of havoc. = If you want a deep dive=20 > into the quirk: https://blog.lopp.net/the-block-storms-of-bitcoins-testne= t/=20 > >=20 > Testnet3 is being actively used for scammy airdrops; those of us who tend= to be generous with our=20 > testnet coins are getting hounded by non-developers chasing cheap gains. >=20 > As a result, TBTC is being actively bought and sold; one could argue that= the fundamental principle=20 > of testnet coins having no value has been broken." >=20 > Since then the issue with block storms has been further demonstrated on T= estnet 3 when three years'=20 > worth of blocks were mined in a few weeks while rendering the network pra= ctically unusable at the=20 > same time. >=20 > =3D=3D Specification =3D=3D >=20 > Consensus of Testnet 4 follows the same rules as Testnet 3 with the excep= tion of the two new rules=20 > detailed below. >=20 > This means that the existing 20 min difficulty exception in Testnet 3 is = explicitly kept in place,=20 > meaning that a block with a timestamp 20 minutes further into the future = from the current time is=20 > allowed to have a minimum difficulty of 1 instead of whatever the actual = level currently is. >=20 > =3D=3D=3D Block Storm Fix =3D=3D=3D >=20 > When the next work required is calculated for the first block in a new di= fficulty period, the=20 > difficulty of the last block of the previous difficulty period is only us= ed as the base for this=20 > calculation if its difficulty is not 1. If its difficulty is 1, all block= s in the previous=20 > difficulty period are checked in reverse order if any of them have a diff= erent difficulty than 1.=20 > When a different difficulty is encountered, it is assumed to be the actua= l difficulty of the network=20 > and used as the base for the calculation of the new difficulty level. Onl= y if all blocks from the=20 > previous difficulty period have had a difficulty of 1 (possibly by the us= e of the 20-min rule), this=20 > is also used as the base for the calculation of the next difficulty perio= d. >=20 > For the avoidance of doubt, no matter which block in the previous difficu= lty period provides the=20 > actual difficulty used as the basis for the calculation, the timestamp of= the last block is always=20 > the one that is used as the end time of the difficulty period. >=20 > =3D=3D=3D Time Warp Fix =3D=3D=3D >=20 > To protect against the time warp attack, the following rule proposed as p= art of The Great Consensus=20 > Cleanup is enforced: "The nTime field of each block whose height, mod 201= 6, is 0 must be greater=20 > than or equal to the nTime field of the immediately prior block minus 600= . For the avoidance of=20 > doubt, such blocks must still comply with existing Median-Time-Past nTime= restrictions." >=20 > =3D=3D Rationale =3D=3D >=20 > The applied changes were the result of discussions on the mailing list an= d the PR. The selected=20 > changes try to strike a balance between minimal changes to the network (k= eeping it as close to=20 > mainnet as possible) while making it more robust against attackers that t= ry to disrupt the network.=20 > Several alternative designs were considered: >=20 > * For the block storm fix an alternative fix could have been to prevent t= he last block in a=20 > difficulty period from applying the existing difficulty exception. Both s= olutions were deemed=20 > acceptable and there was no clear preference among reviewers. > * Removal of the 20-min difficulty exception was discussed but dismissed = since several reviewers=20 > insisted that it was a useful feature allowing non-standard transactions = to be mined with just a CPU. > * Increase of minimum difficulty was discussed but dismissed as it would = categorically prevent=20 > participation in the network using a CPU miner. > * Increase of the delay in the 20 min difficulty exception was suggested = but did not receive=20 > significant support. > * Re-enabling acceptnonstdtxn in bitcoin core by default was= dismissed as it had led to=20 > confusion among layer-2s that had used testnet for transaction propagatio= n tests and expected it to=20 > behave similar to mainnet. > * Motivating miners to re-org min difficulty blocks was suggested but thi= s may still be done after=20 > Testnet 4 is deployed, so it can be considered out of scope for this BIP. > * Persisting the real difficulty in the version field was suggested to pr= event exploits of the=20 > 20-min rule in an even more robust way, but did not receive a critical le= vel of support since it=20 > would be a more invasive change. >=20 > =3D=3D Network Parameters =3D=3D >=20 > =3D=3D=3D Consensus Rules =3D=3D=3D >=20 > All consensus rules active on mainnet at the time of this proposal are en= forced from block 1, the=20 > newest of these rules being the Taproot softfork. >=20 > =3D=3D=3D Genesis Block =3D=3D=3D >=20 > * Message: 03/May/2024 000000000000000000001ebd58c244970b3aa9d783bb= 001011fbe8ea8e98e00e > * Pubkey: 000000000000000000000000000000000000000000000000000000000= 000000000 > * Time stamp: 1714777860 > * Nonce: 393743547 > * Difficulty: 0x1d00ffff > * Version: 1 >=20 > The resulting genesis block hash is=20 > 00000000da84f2bafbbc53dee25a72ae507ff4914b867c565be350b0da8bf043, and the block hex is=20 > 0100000001000000000000000000000000000000000000000000000000000000000= 0000000ffffffff5504ffff001d01044c4c30332f4d61792f32303234203030303030303030= 303030303030303030303030316562643538633234343937306233616139643738336262303= 0313031316662653865613865393865303065ffffffff0100f2052a01000000232100000000= 0000000000000000000000000000000000000000000000000000000000ac00000000= . >=20 > =3D=3D=3D Message Start =3D=3D=3D >=20 > The message start is defined as 0x1c163f28. These four bytes= were randomly generated=20 > and have no special meaning. >=20 > =3D=3D Compatibility =3D=3D >=20 > This specification is backward compatible in the sense that existing soft= ware can use Testnet 4 out=20 > of the box, assuming support for Testnet 3 already exists. >=20 > Simply by adding the network parameters for Testnet 4 (magic number, etc.= ), a client can connect to=20 > and use Testnet 4 without further modifications. The block headers have v= alid proof of work, so=20 > clients can trivially check that blocks are "probably" valid. >=20 > However, without the implementation of the changes detailed in Specificat= ions, a client could follow=20 > a chain that does not follow the rules. Any fully validating node should = check these rules and=20 > reject blocks that fail to follow them. Clients should either validate th= ese rules or connect to=20 > trusted peers that do full validation. >=20 > =3D=3D Reference implementation =3D=3D >=20 > Pull request at https://github.com/bitcoin/bitcoin/pull/29775=20 > >=20 > =3D=3D References =3D=3D >=20 > # Original mailing list thread: https://groups.google.com/g/bitcoindev/c/= 9bL00vRj7OU/m/kFPaQCzmBwAJ=20 > > # Blog post on block storm bug: https://blog.lopp.net/the-block-storms-of= -bitcoins-testnet/=20 > > # Consensus Cleanup BIP draft:=20 > https://github.com/TheBlueMatt/bips/blob/cleanup-softfork/bip-XXXX.mediaw= iki=20 > > # Consensus Cleanup PR draft: https://github.com/bitcoin/bitcoin/pull/154= 82=20 > >=20 > =3D=3D Copyright =3D=3D >=20 > This document is licensed under the Creative Commons CC0 1.0 Universal li= cense. >=20 > --=20 > You received this message because you are subscribed to the Google Groups= "Bitcoin Development=20 > Mailing List" group. > To unsubscribe from this group and stop receiving emails from it, send an= email to=20 > bitcoindev+unsubscribe@googlegroups.com . > To view this discussion on the web visit=20 > https://groups.google.com/d/msgid/bitcoindev/a6e3VPsXJf9p3gt_FmNF_Up-wrFu= NMKTN30-xCSDHBKXzXnSpVflIZIj2NQ8Wos4PhQCzI2mWEMvIms_FAEs7rQdL15MpC_Phmu_fnR= 9iTg%3D%40protonmail.com . --=20 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 e= mail to bitcoindev+unsubscribe@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/= bitcoindev/d40a0279-6a5f-4748-ae80-6b9f05e40881%40mattcorallo.com.