From mboxrd@z Thu Jan 1 00:00:00 1970 Delivery-date: Mon, 12 May 2025 06:50:25 -0700 Received: from mail-oi1-f192.google.com ([209.85.167.192]) by mail.fairlystable.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1uETY0-0004WD-Ht for bitcoindev@gnusha.org; Mon, 12 May 2025 06:50:25 -0700 Received: by mail-oi1-f192.google.com with SMTP id 5614622812f47-40343c606dcsf5561018b6e.1 for ; Mon, 12 May 2025 06:50:24 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1747057818; cv=pass; d=google.com; s=arc-20240605; b=Xv+hEZ40+wLwng08wy/Km+mesXGweJFhpgbwfkH4Dh2Ycv46s0kaa7FtrdhBgWvySS DPLnVJyOikLO2X7IvgmbL/t/knb2XU38WIFflV9qYzbnB/GjuBEqM2lET5Zl7yLslF/N nrvmQ7g0g/NPPaXkp9Or1mKLDc66TLHeVKfc+k17MIN/Ef4HdNp2Q2LD7ppy2+Hq3KdB sqFMdNJs5wItqYo8ldRN0OEwEvAL1A53L5VynDgtdvKicTgyN6q9gahOLV+ZQHga6m/3 OGqCTZWbB8e4dsskPYZCNrSK0yOF+ggxA+NAgEWxTxuB3rDrmudie4OXsesZT0OR9EPZ ArxQ== 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:date:message-id:mime-version :references:in-reply-to:subject:to:from:sender:dkim-signature; bh=NYZeITYjoUlhR8hPwkYjRhB2GyyiRVVe4CqfyqOAdPc=; fh=3Djo/Doe06PuqHS6aW1DwaH8gWH49+ERGQ5yKJkSp/Q=; b=Y/7fwFjqluB99SzqEAwiOH6g8xnSwVplqAlcRvx9l/+VttLVF2D07tWyvnjLV3DIN1 hBdqgtJrOCcADMZJVen+JEkTOw+XIZsPePl5CbMOlKu8lVpkeeFcm1luWe22RDWCjS3N wiQlNWLOYzxUuaF01aoGDe0we94QRhTB2z+QSPJycf6KjWn0ovYrcbpeyyIXTptmr2ay M8ckBVLv+HZkmGJZfcgJh/XfUjOoy+R7kjd5gVW6yV8BIwRRSC7sXyZWbcFAcq92OZIm X9PhjkEPNmzkNEU4gMcLl1zU8g4NdKkMhwZ5Qc3vGGVu8Kv1kD4Up7nk4fsTaB5KtnwS 9/Kg==; darn=gnusha.org ARC-Authentication-Results: i=2; gmr-mx.google.com; spf=pass (google.com: domain of pithosian@i2pmail.org designates 91.143.83.7 as permitted sender) smtp.mailfrom=pithosian@i2pmail.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlegroups.com; s=20230601; t=1747057818; x=1747662618; 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:date:message-id:mime-version:references :in-reply-to:subject:to:from:sender:from:to:cc:subject:date :message-id:reply-to; bh=NYZeITYjoUlhR8hPwkYjRhB2GyyiRVVe4CqfyqOAdPc=; b=hQn/9Pcb8DcTWbWQS5vb7dSN10qopClcTgjldexKAYh7dAbSO7birqqz3+f0nV7Siw WYfk3Uxdb9n7kaQ/3v9HeglXhH1K4+FbBhtm6LgnQIP+QLmuqje2aAdfG1FC13D2rrdH LTz7IHMQHOKFz0ST49gD9mL5L09B9ojr+708dbfXc4Zr398q/KWNrwsJFjfc/2AXHLmV 0SHi0TJe1qRATfIlUWGKA9Zm5Wt2QXT9/uhZL707YIMpagrL8ONmT21eCvID0ss8Iy6w zJAbJ1Pzs5lqmMEIEm26yhEZNO5A5hVhRZ/WZ75Gr9pKQKNK+HIvxpSjk7gcLCpttKE1 vREg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1747057818; x=1747662618; h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post :list-id:mailing-list:precedence:x-original-authentication-results :x-original-sender:date:message-id:mime-version:references :in-reply-to:subject:to:from:x-beenthere:x-gm-message-state:sender :from:to:cc:subject:date:message-id:reply-to; bh=NYZeITYjoUlhR8hPwkYjRhB2GyyiRVVe4CqfyqOAdPc=; b=sq5BiunKMz2Zw9R9tPiD7lLc79sSn3RxwuuHShq8HCYs0AYlNjqbSVVpPb+72jPYtt pFT0twLxQgJbL/NhXK5bUy+cKU/kv+LKRQtq1+LpUYf/RRNwb67xrlmDa+HiCnDBZZrc qHMEz+92fErkSUR4c9iungKVbhrg66sjQAASfgvWV8scFiUW4gm6kft1qnpGo0b/acrk cMBn9mucdQBSc3h+VfyAwRH09WoUQ7Awps2ASidqMKv97z+FoKUZfOVaRxQIYArQvSj/ Y/mor2isbIg1A/vhkABWIfG5giXFiUNs7aZVz/BZIz1gfOWvbI3Wrw/s8AG28qbk5Pjg qI2g== Sender: bitcoindev@googlegroups.com X-Forwarded-Encrypted: i=2; AJvYcCWGUJQxG3rwtAofreV3pesuQpFRdDzxRNkxXeuOFN+KpXupGPAkx3NfqIadx2BtYBFcd5R1IZxx8Pq+@gnusha.org X-Gm-Message-State: AOJu0YydTPDoe4gh+M6JsOvbcxXya7DTgbbam4NolpWKp+yj/5AiXEkO JqlLsynZg6oTl403YpAPO9sl0+6qlpYvfbj8SwdYqInnPuLjeIUK X-Google-Smtp-Source: AGHT+IEWcJIUYd4o2t0rPD7PHm3GcUh+5w0NFL0l1YUaB2jJO9Z6O1/vWu9T+BKz62MtDWq5rf0mFg== X-Received: by 2002:a05:6808:1924:b0:3fa:82f6:f74d with SMTP id 5614622812f47-4037fe2e932mr7802959b6e.23.1747057817843; Mon, 12 May 2025 06:50:17 -0700 (PDT) X-BeenThere: bitcoindev@googlegroups.com; h=AVT/gBH7JHHH/pEYh1fuSBmXiEX7aS6iFMfYclYLMfI+ZEOkfA== Received: by 2002:a4a:d442:0:b0:601:afcc:166b with SMTP id 006d021491bc7-60832ee1b83ls129303eaf.1.-pod-prod-09-us; Mon, 12 May 2025 06:50:14 -0700 (PDT) X-Received: by 2002:a05:6808:2f1a:b0:403:5150:c348 with SMTP id 5614622812f47-4037fde74c1mr9052928b6e.4.1747057814329; Mon, 12 May 2025 06:50:14 -0700 (PDT) Received: by 2002:a05:600c:1d96:b0:442:dc76:9493 with SMTP id 5b1f17b1804b1-442dc769537ms5e9; Mon, 12 May 2025 06:33:22 -0700 (PDT) X-Received: by 2002:a05:600c:a42:b0:43d:24d:bbe2 with SMTP id 5b1f17b1804b1-442d6ddcff4mr82528475e9.28.1747056800641; Mon, 12 May 2025 06:33:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1747056800; cv=none; d=google.com; s=arc-20240605; b=apdJ6qPWcyXvCa1GU1F40SNFeAow1f+88QNG5w3QsuFmYFErKz5ko14io9Vs4sqtMc zp42MK5td3R/yrEeKNHRNTt3CX+HQdptryyNJ8MC+slGO0sH4J9TC9CeoZbey7dEBXl2 hVB3g2oNo46gFpRd9NVH8iTpH1bQq6KuuXiqdbx0CvkHBTzYSotXOrcQ/EQ/23HC+N1L ahSBFyprbtEE89j1E2YlCVr73TcOVPbDr852aSeZ0znwjv+FoqEBIkNiCpLpofUyBHrM C1ORPi47Sg8ZpJKWe5KRCQ5WQFxLAnOKPGrnGu4h+irrL1I5WfJMzLTveSiXz5zLIMvE LcCg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=date:message-id:content-transfer-encoding:mime-version:references :in-reply-to:subject:to:from; bh=EMxK0P2vWzSzuZN/TGrQThWrYmdQPEngL69FNymfA7A=; fh=VcGcg+Zjs9gw1uDcHbxsAILhBAcecnbJzZRdxgKVDIc=; b=NKfWESz0N8Uz91ffdoRaLNYA48G+CmirTSDR9zsQxCk6UUQvyvuE4L7SGLzwHFVgji 1qrRgRyjkKcrN7kfkzg0FOrKVV5RJVrStb3IVmqWYVD6k9APsNQRCNN3XPLEPLLi4SMa oDt0r3eaF7qZdhfmIOZ3I0Jlr59Xbjh9RIwGh6a4OHyMQI+g4IJGzHeM028fIu0K44Nf hSG2MWMFPj/SnD/PP7cWvPQLrBrSiREt7P3VT56LJpD8zETx5c6HnRVaiBOsH3VPeoFG 64zBtcpX+45BJNjxiDd0WxVQa1Q+tOSYFNwL3tSwiHDeWt12/DGt1In4czmDFFgnkrXq proA==; dara=google.com ARC-Authentication-Results: i=1; gmr-mx.google.com; spf=pass (google.com: domain of pithosian@i2pmail.org designates 91.143.83.7 as permitted sender) smtp.mailfrom=pithosian@i2pmail.org Received: from mail.i2pproject.net (mail.i2pproject.net. [91.143.83.7]) by gmr-mx.google.com with ESMTPS id 5b1f17b1804b1-442d76b8294si13945e9.0.2025.05.12.06.33.20 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 May 2025 06:33:20 -0700 (PDT) Received-SPF: pass (google.com: domain of pithosian@i2pmail.org designates 91.143.83.7 as permitted sender) client-ip=91.143.83.7; Received: from i2prouter.i2p.net ([81.7.8.99] helo=smtp.postman.i2p) by mail.i2pproject.net with esmtp (Exim 4.96) (envelope-from ) id 1uETHS-005ZVQ-0u for bitcoindev@googlegroups.com; Mon, 12 May 2025 15:33:20 +0200 X-Mailer: smtp.postman.i2p - Official I2P Mailer From: pithosian To: bitcoindev@googlegroups.com Subject: Re: [bitcoindev] Re: Unbreaking testnet4 In-Reply-To: <20250512110323.B14F27C0B49@smtp.postman.i2p> References: <20250512110323.B14F27C0B49@smtp.postman.i2p> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" X-Virus-Scanned: clamav-milter 0.103.X on milter.postman.i2p Message-Id: <20250512120531.1AC1F7C0557@smtp.postman.i2p> Date: Mon, 12 May 2025 12:05:31 +0000 (UTC) X-Spam-Score: -4.6 (----) X-Original-Sender: pithosian@i2pmail.org X-Original-Authentication-Results: gmr-mx.google.com; spf=pass (google.com: domain of pithosian@i2pmail.org designates 91.143.83.7 as permitted sender) smtp.mailfrom=pithosian@i2pmail.org 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.7 (/) Another option is to invert the halving logic on testnet (to what some newbies occasionally think the halving is on mainnet); don't halve the subsidy, half the existing supply. Fix the subsidy: validation.cpp CAmount GetBlockSubsidy(int nHeight, const Consensus::Params& consensusParams) { if (consensusParams.fixedSubsidy != 0) { return consensusParams.fixedSubsidy; } Then as the last step of processing a block, after its txs have been applied to chainstate, check if it's a halving block and, if it is (and some consensus flag is set), halve the value of all existing UTXOs. The result is: 1. We'd never exceed a 21m coins. 2. We'd disincentivise hoarding. 3. We'd ensure permanent liquidity on testnet. Updating the entire UTXO set all at once would be pretty expensive, though, and over enough halvings you'd have a bunch of zero value UTXOs we may or may not be able to clean up. On Mon, 12 May 2025 11:03:23 +0000 (UTC) Anthony Towns wrote: > > > 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/20250512120531.1AC1F7C0557%40smtp.postman.i2p.