Skip to main content

Day-1 pubKey_A-Bound Ed25519-PoKoS Rescue & Complete Classical Sunset (v4)

60-Second TL;DR (ZNN-SPEC-PHASE1-v4): Reconciling ZDC-ZP1-HR-001, ZDC-QS-DEEZ-HR-001, and the Round-4 Independent Cryptographic & Source Audit (R4-02, R4-03, R4-04, R4-06, R4-09), Zenon Phase 1 v4 makes zero-knowledge seed rescue and classical sunset mathematically airtight without any stop-the-world state migration:

  1. O(1) GenesisReceive- & Producer-Aware Exposure Resolver (B06, R4-02, R4-03 fix): Replaces naive Height >= 1 checks (which failed on unsigned Height == 1 GenesisReceive blocks and Height == 0 Pillar producingAddress seals) without any O(All Accounts) activation stall—resolving EXPOSED vs. UNEXPOSED vs. UNKNOWN in O(1) via AuthRegistry[0x03] (bounded <= 250 Pillar/PTLC Ed25519 reveals) + AccountStore[0x0a] + ByHeight(1)/ByHeight(2) against ctx.InclusionMomentumStore()!
  2. True 2^-128 QROM WHIR-SHA3-v1 + Full 32-Byte pubKey_A Binding (B06, R4-04 fix): Binds all 32 B of pubKey_A on EXPOSED accounts (~2^126 Grover), enforces 256-bit classical RBR (32b grind + 224b query -> 128b QROM), and documents UNEXPOSED accounts with exact Zalka MAXDEPTH = 2^64 bounds (M ≈ 2^44 parallel runs, W ≈ 2^98 calls R4-06).
  3. Complete Dual-Ledger H_inc Embedded Sunset (B02, B12, R4-03, R4-09 fix): Phase 1E (Spork #14) enforces sunset at H_inc inside both ApplySend and GenerateEmbeddedReceive (overriding targetMA rewind R4-03!), upgrades embedded blocks to Version = 2, deletes orphan ptlcReclaimLock storage on post-sunset Reclaim, and binds MaxPreCRQCBitcoinHeight in SunsetAnchorCheckpoint.

1. Why RFC 8032 SHA-512 Key Expansion Blocks Shor — And How O(1) Exposure Resolution Works (B06, R4-02 Fix)​

Every standard Zenon wallet (syrius, znn_cli_dart, go-zenon/wallet/keystore.go, go-zenon-v1/internal/crypto/ed25519.go) derives its Ed25519 public key from a 32-byte RFC 8032 private seed seed32 (whether seed32 came from SLIP-0010 over a 12/24-word BIP-39 mnemonic, a KeyFile, or a raw 32-byte key import M05):

Step 1 (RFC 8032): h512 = SHA512(seed32)
scalar_s = Clamp25519(h512[0:32])
pubKey_A = CompressEdwards([scalar_s] * B) // 32 bytes (~252-bit group order)
Step 2 (Zenon): addr20 = 0x00 || FIPS202_SHA3_256(pubKey_A)[0:19] // 19-byte (152-bit) truncation

Closing Both the 152-Bit Truncation Bypass (B06) and the GenesisReceive / Producer Gap (R4-02 Fix)​

  • Shor's Limit: Given pubKey_A, Shor's algorithm recovers scalar_s ([scalar_s] * B), never seed32 behind SHA-512.
  • Why pubKey_A Must Be Pinned When Exposed (B06): Checking only targetAddress (152 bits) would let an unbounded CRQC Grover-search random seed32' values colliding on 19 bytes in ~2^76 ideal queries even when pubKey_A (32 B) was already public on-chain.
  • Why go-zenon-v1 Enables O(1) Exact Resolution Without Full-State Backfill (R4-02 Proof): Direct source audit of go-zenon-v1/internal/vm/verifier/account_block.go:783-799 & genesis/builder.go:188 proves that on any 0x00 account chain, ONLY BlockTypeGenesisReceive (1) at Height == 1 is unsigned (len(PublicKey) == 0); every other block (UserSend, UserReceive) at Height >= 1 is signed! Thus, an account's first AccountBlock key reveal prior to Spork #10 can ONLY reside at ByHeight(1) or ByHeight(2)—never Height >= 3! The only non-AccountBlock Ed25519 reveals on-chain are Momentum producer headers (legacy_dpos.go:281, <= 150 historical Pillar addresses) and PtlcContract PointTypeEd25519 = 0 signature unlocks (ptlc.go:30), which are indexed in tiny AuthRegistry[0x03 || addr] (< 15 KiB total!) without touching AccountStore!
  • Normative 3-State Resolver (ResolveLegacyEd25519Exposure on ctx.InclusionMomentumStore(), R4-02, R4-03):
    1. Check AuthRegistry[0x03 || targetAddress] (external Momentum producer / PTLC Ed25519 reveal) and AccountStore(targetAddress)[0x0a] (legacyEd25519PK): if either is present (verifying PubKeyToAddress(pk32) == targetAddress; conflicting keys fail closed), return EXPOSED(hasExposedPK = 1, pk32) (~2^126 Grover).
    2. Else inspect hh = AccountStore(targetAddress).Identifier():
      • hh.Height == 0: return UNEXPOSED(hasExposedPK = 0, [32]byte{0}) (152-bit address bound).
      • hh.Height == 1: load blk1 := acct.ByHeight(1). If blk1 == nil (pruned/missing), return UNKNOWN -> reject (ErrAuthUnknownExposure)! If blk1.BlockType == BlockTypeGenesisReceive, return UNEXPOSED(0, [32]byte{0}); else extract pk32 from blk1.PublicKey -> EXPOSED(1, pk32).
      • hh.Height >= 2: load blk1 := acct.ByHeight(1); if blk1 != nil && blk1.BlockType != BlockTypeGenesisReceive, extract blk1.PublicKey; else load blk2 := acct.ByHeight(2) and extract blk2.PublicKey (if blk1 or blk2 is nil/pruned, return UNKNOWN -> reject fail-closed!). (Pruner Law R4-02: Sovereign 30-day block pruning NEVER deletes Height in {1, 2} of unrotated 0x00 accounts—bounded permanently at <= 200 MB!)

2. Exact Security Boundary by Account Cohort (H06, B06, R4-02, R4-06 Reconciled)​

Legacy 0x00 CohortOn-Chain Secret BoundPre-Sunset (Spork #10..#13) StatusPost-Sunset (Spork #14, Enforced at H_inc B02, R4-03) Status
Untouched 0x00 (UNEXPOSED: H == 0 or unsigned GenesisReceive only)152-bit addr20 (pubKey_A never revealed on-chain)Migrate Day 1 via sponsor-submitted RescueWithPoKoS (0 Ed25519 key exposure B08, B09).Permanent RescueWithPoKoS (2^76 ideal Grover; Zalka MAXDEPTH = 2^64 @ d=10: M = 2^44 parallel runs, W = 2^98 calls R4-06).
Active 0x00 (Rotated Pre-CRQC)256-bit AuthRegistry PQ key + boundDigest32 (R4-01)PQ-Authorized from H_confirm + 1 (activeRecord rejects 0x00 & prevents PoKoS override B08).PQ-Authorized (2^128 Grover + NIST Cat. 1–2 signature security).
Dormant 0x00 (EXPOSED History, Unrotated)32-byte pubKey_A ([0x0a], [0x03], or ByHeight(1..2))Vulnerable if CRQC arrives BEFORE Spork #14! Active holders MUST rotate via RotateKey pre-CRQC (B09).Protected at ~2^126 Grover once Spork #14 activates pre-CRQC! 0x00 sigs are disabled at H_inc, and R_PoKoS requires seed32 matching all 32 B of pubKey_A (B06, R4-02)!

(Note M05: PoKoS rescues any standard 32-byte RFC 8032 pre-SHA-512 seed across 12/24-word BIP-39, passphrased BIP-39, KeyFile, or raw seed imports; non-RFC-8032 MPC/FROST or raw clamped-scalar keys lacking a 32B pre-SHA-512 seed must rotate pre-sunset via RotateKey.)


3. Exact R_PoKoS Pure-SHA3 STARK Relation (circuitId = 0x01, B06, B08, R4-04)​

Public Inputs (x — Reconstructed Against ctx.InclusionMomentumStore() by AuthRegistry #14)​

  • genesisHash[32] & chainIdentifier (uint64)
  • targetAddress[20]: 0x00 address (authState.activePubKeyHash == 0 && pendingEffectiveHeight == 0)
  • hasExposedPK (uint8 in {0, 1}; UNKNOWN aborts before proof check!) & expectedPubKeyA[32] (pk32 when hasExposedPK == 1, else [32]byte{0})
  • popDigest[32]: Exact SHA3-256 of the 179-byte zenon-auth-pop:v3 preimage (opByte = 0x02, binding sponsor senderBlock.Address, senderBlock.Height, algId, and SHA3-256(newPublicKey) B08, M06)

(Sponsor & Zero-Balance Flow B08: Any funded/PoW 0x02 sponsor account submits RescueWithPoKoS. At H_confirm + 1, targetAddress claims pending UserReceives feelessly using client Equi-X PoW with 0 initial ZNN/QSR balance!)

Private Witness (w) & Verified Constraints (WHIR-SHA3-v1, True 2^-128 QROM R4-04)​

  • Private witness: seed32[32] (RFC 8032 32-byte Ed25519 seed).
  • Constraints:
    1. h512 = SHA512(seed32); s = Clamp25519(h512[0:32]); pubKey_A = CompressEdwards([s]B).
    2. Assert 0x00 || FIPS202_SHA3_256(pubKey_A)[0:19] == targetAddress.
    3. If hasExposedPK == 1: Assert pubKey_A == expectedPubKeyA (32-byte exact equality B06!).
    4. Absorb all public inputs into the SHA3-256/SHAKE256 Fiat-Shamir sponge with 32-bit grinding + 224-bit classical query security + 256-bit extension field (<= 2^-128 QROM soundness R4-04).
  • Projected Engineering Targets (Gated on Gate ZP-Q20 Physical Qualification B07, M11, R4-04): ~57–86 KiB WHIR-SHA3-v1 receipt (<= 128 KiB hard cap), ~0.9–1.5 s laptop prove target, <= 3.5 ms (~1.2 ms typical) Cortex-A76 verify target (<= 8,000 Keccak perms).

4. Complete Phase 1E Classical & Contract Sunset (Spork #14, B02, B11, B12, M09, R4-03, R4-09)​

SporkBitLegacyCryptoSunset (Spork #14) enforces a complete, zero-stranded-funds sunset strictly at InclusionMomentumHeight (H_inc >= H_sunset) across BOTH ApplySend and GenerateEmbeddedReceive (R4-03 fix):

  1. Governance Precondition: ActivateSpork(#14) reverts unless SporkAddress, BridgeAdministrator, and >= 85% of active Pillar stake (M09) already hold active PQ ({0x01, 0x02, 0x03}) authentication records!
  2. User, Hybrid & Embedded Block Version Sunset (M09, R4-03): Rejects AccountBlock.Version == 1, algID == 0x00 (Ed25519), and algID == 0x81 (AlgHybridEdMLDSA44) at H_inc >= H_sunset (while embedded ContractReceive and ContractSend descendants emit Version = 2 from Spork #10 onward R4-03, and AuthRegistry.UpgradeHybridToPureMLDSA44 remains callable under the ML-DSA-44 half of an existing 0x81 record).
  3. BridgeContract Classical ECDSA Halt (B12, R4-03): Permanently disables BridgeContract.Redeem, WrapToken, UpdateWrapRequest, UnwrapToken, and ChangeTssECDSAPubKey at H_inc >= H_sunset (in both ApplySend and ReceiveBlock via ctx.InclusionHeight()).
  4. SwapContract & PillarContract Legacy secp256k1 Sunset (B12, R4-03): Disables SwapContract.RetrieveAssets and PillarContract.RegisterLegacy at H_inc >= H_sunset.
  5. Two-Step Zero-Stranded-Funds PtlcContract {0, 1, 2} Drain (B12, R4-03):
    • Step A (Spork #13): Caps expirationTime <= MaxClassicalPtlcExpiry (or forbids {0, 1, 2} creation once SigLock types 3 & 4 activate).
    • Step B (Spork #14 at H_inc): Disables Unlock, ProxyUnlock, and ReclaimWithSignature for pointType in {0, 1, 2}, while permitting post-expiry Reclaim(id) back to ptlcInfo.TimeLocked (calling both DeletePtlcInfo and DeletePtlcReclaimLock so zero funds are stranded and zero [0x02] keys leak R4-03!).
  6. Height-Bounded SunsetAnchorCheckpoint (B11, R4-09): Seals (H_sunset, MomentumHash_sunset, StateRoot_sunset, CommitteeHash_sunset, BitcoinAnchorHeight <= MaxPreCRQCBitcoinHeight) in params.go and Bitcoin (SHA-256d).
  7. Permanent RescueWithPoKoS: Remains open forever for all RFC 8032 32-byte seed holders.