From c08246d68c84e27020fe35d8d4dfe54f2f855657 Mon Sep 17 00:00:00 2001 From: VictorLux Date: Tue, 9 Jun 2026 22:31:45 +0200 Subject: [PATCH] Activate ZIP-209 shielded turnstile on mainnet Enable fZIP209Enabled on mainnet (CMainParams) with a Sprout value-pool checkpoint at height 3000000 (balance 1316412375709, block 0000038aee939c8017f4ad353e3fd1313c6a0da565bbc1d3269bbe855fe33505), mirroring the existing testnet configuration. With this set, ConnectBlock's existing ZIP-209 enforcement rejects any block that drives the Sprout or Sapling shielded value-pool balance negative (turnstile containment), bounding the damage of any shielded-circuit soundness bug: value forged inside a pool cannot be withdrawn past the pool boundary undetected. This is a consensus rule-tightening (soft fork) and wants a coordinated network upgrade -- see the PR description. Co-Authored-By: Claude Opus 4.8 --- src/chainparams.cpp | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/chainparams.cpp b/src/chainparams.cpp index fab7224ba22..6033c95d0ef 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -202,6 +202,21 @@ class CMainParams : public CChainParams { 1138 // * recent transactions/day (measured: ~1.0 tx/block, ~1138 blocks/day) }; + // ZIP-209: reject any block that drives a shielded value pool balance + // negative (turnstile enforcement). Previously configured on testnet + // only; this mirrors that for mainnet. The hardcoded Sprout checkpoint + // re-seeds nChainSproutValue for nodes whose block index predates pool + // monitoring, so they can enforce from this height forward WITHOUT a full + // reindex; nodes that tracked the pool from genesis instead assert their + // computed balance equals this value, so it MUST be the exact genesis- + // derived Sprout balance at this block. Verified on a synced mainnet node: + // getblock 0000038aee939c8017f4ad353e3fd1313c6a0da565bbc1d3269bbe855fe33505 + // -> valuePools[id=sprout].chainValueZat == 1316412375709 (height 3000000) + nSproutValuePoolCheckpointHeight = 3000000; + nSproutValuePoolCheckpointBalance = 1316412375709; + fZIP209Enabled = true; + hashSproutValuePoolCheckpointBlock = uint256S("0000038aee939c8017f4ad353e3fd1313c6a0da565bbc1d3269bbe855fe33505"); + fastSyncAnchorData.nHeight = 3126937; fastSyncAnchorData.hashBlock = uint256S("0x00000663e40f1fe0bc32a7e7282fac25de5fe8ecefd9c627e2fd948d388f7053"); fastSyncAnchorData.hashAnchorSha256 = uint256S("0x376d6d5e6f7d02459b89ae0988f5c51bb1deaf2a3e4b3a1de745e4f2e3bb279d");