diff --git a/AGENTS.md b/AGENTS.md index 4dae93c1..d2387316 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -44,6 +44,20 @@ chain 21.** What moved, and where it lives: chain 21's); wallet and randscan WASM; bridge commitments. A later circuits PR (EVM block context / PREVRANDAO) moves the evm guest's hc again: one more `CIRCUITS_PIN` step. +### Chain 22's shielded addresses are re-derived under constraint set 11 (2026-11-20, branch `fix/cut22-set11-addresses`, PR open, NOT merged; deploy only) + +Set 11 moves every `rand1` address for the same spend key (`pk = H_PK(nk)` is Poseidon2). The cut +script read every carried address from chain-21 tooling, which would have sealed chain 22's genesis +notes to set-9 addresses no set-11 wallet can spend. Now `deploy/cut-chain22-genesis.sh` takes +`WALLET` (chain 21's rand, reads chain 21) and `WALLET22` (v0.8.7, set 11, no default; derives +everything), told apart by a public probe key's fingerprint (set 9 `XCGM-G4XD-CQQA-753X`, set 11 +`S3VP-7C0T-GGSA-BJJY`). Carry lines name `key=` (re-derived by both binaries) or, under +`SET11_GIVEN` plus a `set11-given:` record line, `given=`; payouts come from +`PAYOUT_KEYS_DIRS`; the fee recipient needs the owner's set-11 `FEE_RECIPIENT_FILE` and +`FEE_RECIPIENT_FINGERPRINT` (89DS-4Q4X-HXSX-MBYW refused by name); a backstop refuses any chain-21 +`rand1` or pk in the finished file. Validator, minter and beacon addresses are blake3 of a Dilithium2 +public key and do not move. `docs/deploy.md` "Every shielded address is re-derived under constraint set 11". + ### The chain-22 treasury is 5 of 6 with its RAND carried; perps carried empty (2026-11-19, branch `feat/chain22-treasury-carry`; deploy only) Owner's decisions of 2026-11-19 in `deploy/cut-chain22-genesis.sh` (OPEN 1–4 of its header; @@ -3096,6 +3110,13 @@ never move them. ### Repo workflow traps +- **A constraint-set cut moves every shielded address.** `rand1…` is derived through Poseidon2 + (`pk = H_PK(nk)`), so a set change gives the same key file a new address. Never carry a `rand1` + from the old chain's genesis, `balances`, a contacts file or an earlier chain's text file into a + new-set genesis: re-derive it from the key file with the NEW set's `rand` (the chain-22 cut's + `WALLET22`), or take it from the holder with its fingerprint. Dilithium-key addresses + (validators, minters, the beacon) and public keys do not move. Fingerprints are blake3 of the + address, so a fingerprint from the old set names the old address. - **This repo is worked on by multiple agents/sessions in parallel**, in the same checkout. Branches and the worktree HEAD move mid-task. Before committing, re-check `git worktree list` and `git log main`; for anything diff --git a/deploy/cut-chain22-genesis.sh b/deploy/cut-chain22-genesis.sh index d7bace55..1e17b2f0 100755 --- a/deploy/cut-chain22-genesis.sh +++ b/deploy/cut-chain22-genesis.sh @@ -51,14 +51,19 @@ # # [PRUNED_SCAN_OK=1] deploy/cut-chain22-genesis.sh snapshot # # chain 21 still up, bridge daemons stopped -# [PRUNED_SCAN_OK=1] WALLET= deploy/cut-chain22-genesis.sh balances -# # read-only toward the chain: the RAND carry list. +# [PRUNED_SCAN_OK=1] WALLET= WALLET22= \ +# deploy/cut-chain22-genesis.sh balances +# # read-only toward the chain: the RAND carry list, +# # each wallet at its SET-11 address (WALLET22) with +# # its key file and chain-21 address on the line. # # PRUNED_SCAN_OK=1 (owner, 2026-11-19): accept a # # pruned CHAIN21_RPC — none other exists (e, obs1: # # prune_floor 187556; rand-archive-2 abandoned); # # the cut then needs it too and the record's # # `scan-floor: ` (what it loses: py_snapshot) -# CUT_RECORD= CHAIN21_SNAPSHOT= NODE= WALLET= \ +# CUT_RECORD= CHAIN21_SNAPSHOT= NODE= \ +# WALLET= WALLET22= \ +# FEE_RECIPIENT_FINGERPRINT= [SET11_GIVEN=] \ # EXPECT_NODE_VERSION= PERP_PROVER= \ # PERPS_MAX_WINDOW_HEIGHTS=<64..4096> MULTISIG_MAX_ACCOUNTS= \ # [BEACON_TSV=] [REFERENCE_BLOCK_WINDOW=<256..4096, 256>] \ @@ -77,8 +82,11 @@ # # chain 22's row (issue #166, below) — it exits # # non-zero until the row the cut printed is added # SELFTEST=1 deploy/cut-chain22-genesis.sh # no network, no binaries: the assembly on fixtures -# DRY_RUN=1 NODE=… WALLET=… PERP_PROVER=… RAND_MSAUTH_VK= \ -# deploy/cut-chain22-genesis.sh +# DRY_RUN=1 NODE=… WALLET=… WALLET22=… PERP_PROVER=… RAND_MSAUTH_VK= \ +# deploy/cut-chain22-genesis.sh # (the carry wallets, the faucet allowlist and, +# # without FEE_RECIPIENT_FILE, the fee recipient are +# # THROWAWAY keys WALLET22 makes; the payouts are +# # derived from PAYOUT_KEYS_DIRS as at the cut) # # no network: the REAL cut path (rand-node genesis, # # alloc-note, perp-prover genesis-state, init, a # # loopback probe node) on inputs synthesised from @@ -251,6 +259,54 @@ # `carries:`). No deploy/cutover-fleet-chain22.sh exists yet: derive it from chain 21's. # * NODE must report rand-node $EXPECT_NODE_VERSION (no default, OPEN 7), v0.8.5 or later. `balances` runs with # chain 21's own build, v0.8.2 (WALLET). +# * EVERY SHIELDED ADDRESS IS RE-DERIVED UNDER CONSTRAINT SET 11 (the cut-blocking bug of +# 2026-11-20; bridge#15 found the same on its side). Set 11 changes the Poseidon2 constants, so +# `pk = H_PK(nk)` — and with it the rand1… address — moves for the SAME spend key (a throwaway +# key: PNKR-0783-FNHS-K5AY under v0.8.0, KWTC-Y3MQ-XX7S-JVXP under set 11). A genesis note, +# payout or allowlist entry at a set-9 address can never be spent or used by a set-11 wallet: +# silent loss of funds. So TWO wallet binaries, never one: +# - WALLET — chain 21's rand (set 9), only to READ chain 21 (`balances`' scan) and to prove a +# key file is the chain-21 wallet a line claims (its set-9 address); +# - WALLET22 — the cut build's rand (v0.8.7, from the signed release; NO default), to DERIVE +# every address chain 22's genesis holds, and for every set-11 step (`perp +# image-hc`, `perp genesis-root`, fingerprints). +# Both are identified by a PROBE: a fixed, public, never-funded spend key (PROBE_SPEND_KEY, 0x01 +# × 32) whose address fingerprint is PROBE_FP_SET9 under set 9 and PROBE_FP_SET11 under set 11 +# (read 2026-11-20 with v0.8.0 and the #194 tree's rand). `check_wallet_sets` refuses a WALLET22 +# that is not set 11 (a set-9 one by name), a WALLET that is set 11, and two binaries that +# derive one address. The design, per input: +# - ALLOC_ADDRESSES (`balances` writes it): `