Shor-Lattice ECDLP on secp256k1: Q-Only Substrate Measurement, Recovery, and Lean-Sealed Post-Processing

Document ID: gaiaftcl.shor.ecdlp.research.paper.v3

Companion dataset schemas: gaiaftcl.shor.ecdlp.research.v2, gaiaftcl.qc_vm.research.v4, gaiaftcl.qc020.dual_path.v1, gaiaftcl.qc020.improvement_trend.v1

Short operational guide: SHOR_ECDLP_RESEARCH.md

QC-020 dual path: QC020_DUAL_PATH_QUALIFICATION.md

Repository: AppleGaiaFTCL / cells/xcode + proof/lean

Frozen bundle (2026-06-05): evidence/research/*_latest.json

---

Abstract

This paper documents the GaiaFTCL Shor-lattice ECDLP pipeline on Bitcoin secp256k1: a reproducible instrument for period-lattice measurement and classical recovery, not a claim that the full quantum Shor period-finding subroutine (QFT/QPE) has been implemented in silicon. The system separates three verifiable layers:

1. Substrate measurement — find lattice periods (ra, rb) from public point Q only, by walking a C⁴ basis until the affine identity ra·G + rb·Q = O holds on the curve.

2. Classical recovery — compute d ≡ −ra·rb⁻¹ (mod n) where n is the secp256k1 subgroup order.

3. Independent verification — re-check the curve identity and d·G = Q via affine arithmetic and P256K.

Layer (2) at small moduli is machine-checked in Lean 4 (FirstRoars/ShorECDLP.lean, kernel decide, LionPrelude only). Layer (3) at full 256-bit scale is checked in Swift because secp256k1 order is outside practical decide reduction in the current gate. RSA Shor post-processing at semiprime scale is sealed in parallel (FirstRoars/ShorFactorLarge.lean).

The code is the dataset: witness JSON, Lean gate lines, and export scripts are first-class publication artifacts. No probe caps, no private-key-derived periods, and no simulated chain outcomes appear on this path.

The full quantum VM bundle (gaiaftcl.qc_vm.research.v4) embeds ECDLP evaluation plus catalog QC-001…QC-021 gates, QC-020 dual-path qualification (historical OQ/PQ vs live miner), and time-to-nonce improvement trend (L8 learning visibility — distinct from L7 on-chain reward). As of the 2026-06-05 revalidation: allMathLayerOK=true, allLearningClaimsOK=true, qaLayerClosed=true, allRewardClaimsOK=false (L7 not yet chain_accepted), qc020ImprovementTrend.trendStatus=insufficient_hits (timed hit samples not yet accumulated).

---

1. Problem and notation

1.1 ECDLP

Let G be the secp256k1 generator and Q = d·G for unknown scalar d ∈ ℤ/nℤ, where

n = FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141 (hex)

is the prime subgroup order (hard-coded in substrate and Lean-adjacent Swift).

Goal: Given compressed public key hex for Q, produce d (as 32-byte big-endian hex) such that d·G = Q on secp256k1.

1.2 Shor lattice form

Period-finding in the Shor reduction exposes integers (ra, rb) such that the point lattice

ra·G + rb·Q = O   (identity on E(𝔽_p))

holds. In the additive group of scalars mod n, with Q = d·G, this is equivalent to

ra + rb·d ≡ 0 (mod n) .

When gcd(rb, n) = 1, recovery is

d ≡ −ra·rb⁻¹ (mod n) .

This implication is the classical post-processing half of Shor; the quantum/substrate half is discovering (ra, rb) from Q without knowing d.

1.3 What this work does *not* claim

Claim Status in this codebase
Polynomial-time ECDLP for random secp256k1 instances in the classical sense Not claimed — substrate search is unbounded until a lattice hit; worst-case behavior is not bounded here
Lean proof of full 256-bit curve arithmetic Not claimed — Lean seals modular recovery at small n; curve check is Swift/P256K
Breaking arbitrary mainnet wallets without measurement convergence Not claimed — success requires substrate finding valid (ra, rb) and checks passing
Grover search for ECDLP Out of scope — QC-002 Grover is a separate corpus leg (see §12)

---

2. Mathematical core (paper ↔ Lean)

2.1 Decidable witness (Lean)

File: proof/lean/FirstRoars/ShorECDLP.lean

Namespace: LionMath.ShorECDLP

Definition Meaning
ecdlpLatticeModN ra rb d n (ra + rb·d) mod n = 0
ecdlpRecoveredScalar ra rb n (negMod ra n · modInv rb n) mod n
ecdlpWitnessHolds n ra rb d n ≥ 2, rb ≢ 0, gcd(rb,n)=1, lattice holds, d equals recovery, d ≢ 0

Sealed theorems (kernel decide):

Theorem Parameters Role
ecdlp_seal_prime_1_1_n_minus_1 n=13, ra=1, rb=1, d=12 Algebraic template for Swift neg-G seal (d = n−1)
ecdlp_seal_11_2_3_3 n=11, ra=2, rb=3, d=3 Independent small-modulus row
ecdlp_seal_97_2_32_6 n=97, ra=2, rb=32, d=6 Larger modulus row (2+32·6 ≡ 0 (mod 97))

Falsifiers: falsifier_ecdlp_seal_* duplicate each seal. If gate algebra drifts, decide fails → lean_gate.sh reports REFUSED (not silent CALORIE).

Warrant discipline: Lion Protocol — no Mathlib, no sorry, no axiom; decide only.

2.2 Swift recovery (same formula, full n)

File: cells/xcode/Sources/M8FrequencySweep/ShorECDLP/ShorECDLPSecp256k1.swift

// recoveredScalarHex — lines 106–110
let k = ECDLPSubstrateCore.modNorm(BigInt.zero - (ra * rbInv), n)

File: cells/xcode/Sources/ShorECDLPSubstrate/ShorECDLPSubstrate.swift

2.3 Curve lattice (affine secp256k1)

File: cells/xcode/Sources/ShorECDLPSubstrate/ShorECDLPSubstrateCurve.swift

latticeIsIdentity(ra, rb, publicKeyHex):
  sum = ra·G + rb·Q   // affine, y² = x³ + 7 over 𝔽_p
  return sum == O

Field prime, generator coordinates, decompress (02/03/04), point add/double — all in this file (substrate-native affine math).

2.4 RSA parallel (Shor semiprime post-processing)

File: proof/lean/FirstRoars/ShorFactorLarge.lean

Swift check: ShorBreakClassicalCommand.verifyMathLegsverify_shor on ladder (8051, 1022117, 2913947461).

break-classical requires both Lean artifacts CALORIE before emitting research JSON.

---

3. System architecture

3.1 Module dependency graph

flowchart TB
  subgraph lean [proof/lean]
    LP[LionPrelude]
    SFL[ShorFactorLarge.lean]
    SED[ShorECDLP.lean]
    LP --> SFL
    LP --> SED
  end

  subgraph substrate [ShorECDLPSubstrate]
    Core[ECDLPSubstrateCore]
    Basis[ShorECDLPSubstrateBasis]
    Map[ShorECDLPSubstrateMapping]
    Curve[ShorECDLPSubstrateCurve]
    Basis --> Core
    Map --> Core
    Curve --> Core
  end

  subgraph m8 [M8FrequencySweep / ShorECDLP]
    Challenge[ShorECDLPChallenge]
    Secp[ShorECDLPSecp256k1]
    Witness[ShorECDLPWitness]
    Dataset[ShorECDLPResearchDataset]
    Gate[ShorECDLPGate]
    Secp --> substrate
    Witness --> Challenge
    Witness --> Secp
    Dataset --> Witness
    Gate --> Secp
  end

  subgraph cli [GaiaFTCLCLI]
    BC[ShorBreakClassicalCommand]
    BC --> m8
    BC --> lean
  end

  subgraph vqbit [VQbit]
    Amp[amplifyAgainstSecp256k1EllipticLattice]
    Amp --> substrate
  end

  P256K[P256K / swift-secp256k1] --> Secp

3.2 End-to-end pipeline

sequenceDiagram
  participant Op as Operator
  participant CLI as break-classical
  participant Sub as ECDLPSubstrateCore
  participant Curve as SubstrateCurve
  participant Secp as ShorECDLPSecp256k1
  participant Lean as lean_gate.sh

  Op->>CLI: public Q (wallet or --neg-generator-seal)
  CLI->>Sub: measureUntilLatticeCalorie(Q)
  loop C⁴ steps until CALORIE
    Sub->>Sub: basis + periodCandidates
    Sub->>Curve: latticeIsIdentity(ra,rb,Q)
  end
  Sub-->>CLI: (ra, rb), substrateSteps
  CLI->>Secp: verifyFromQ → d, lattice, dG_eq_Q
  CLI->>Lean: ShorFactorLarge + ShorECDLP
  Lean-->>CLI: CALORIE JSON lines
  CLI-->>Op: research.v1 JSON (--witness-out)

---

4. Substrate measurement (Q-only)

4.1 Entry point

Function File
ECDLPSubstrateCore.measureUntilLatticeCalorie(publicKeyHex:) ShorECDLPSubstrate.swift
ShorECDLPSecp256k1.measurePeriodsFromQ ShorECDLPSecp256k1.swift
ShorECDLPPeriodFinder.measurePeriods ShorECDLPPeriodFinder.swift (M8 wrapper)

4.2 C⁴ basis walk

File: ShorECDLPSubstrateBasis.swift

File: ShorECDLPSubstrateMapping.swift

Each step emits multiple (ra, rb) candidates in full ℤ/nℤ via:

4.3 Termination

The loop in measureUntilLatticeCalorie is unbounded (while true) until latticeIsIdentity succeeds. This is intentional for the research dataset: the substrate refuses artificial refusal gates that pretend exhaustion.

Witness field: substrateSteps — 1-based step count when CALORIE found (see neg-G seal: typically 1).

4.4 Canonical seal instances (encoding cross-check)

Encoding cross-check (ShorECDLPEncodingCrossCheck.swift) is mandatory in gate v5:

Point P256K compressed hex (prefix) (1,1) lattice? Scalar check
G (d = 1) 0279be66… (even y) false d·G = Q with d = 1
−G (d = n−1) 0379be66… (odd y, same x) true d·G = Q with d = n−1

The x-coordinate is shared; y parity differs — so pubkeyBytesDistinct = true and substratePointsEqual = false.

Instance Expected d Typical (ra, rb) substrateSteps
neg-G seal n−1 (ff…4140) (1, 1) 1
G seal 1 (00…01) (1, n−1) 1

Code: negGeneratorCompressedPublicKeyHex(), generatorCompressedPublicKeyHex(), gate qc001-ecdlp-lattice-secp256k1-gate-v5.0.0.

Lean: ecdlp_pattern_neg_g_* and ecdlp_pattern_generator_* at small moduli (kernel decide) — algebraic templates, not secp256k1 order.

---

5. Verification layers (dual gate)

5.1 Swift checks

Struct: ShorECDLPSecp256k1.Verification

Field Check
latticeOK ECDLPSubstrateCore.latticeHolds / affine identity
dG_eq_Q verifyQequalsDG via P256K signing key derivation
recoveredPrivateKeyHex64 From recoveredScalarHex(ra, rb)

Witness: ShorECDLPWitness.compose — JSON fields checks.lattice, checks.dG_eq_Q, periodSource: "substrate_lattice_search".

5.2 Lean external gate

Script: proof/scripts/lean_gate.sh

Invoked for:

1. FirstRoars/ShorFactorLarge.lean

2. FirstRoars/ShorECDLP.lean

Verdict semantics:

Verdict Meaning
CALORIE lake build exit 0, sorry=0, axiom=0, opaque=0
REFUSED decide / falsifier failure — math drift
CURE Toolchain or non-decide build failure

CLI: ShorBreakClassicalCommand.runLeanGate — parses JSON; ShorECDLPResearchDataset.decodeLeanGateLine.

5.3 M8 smoke + evaluation gates

Target Role
M8ShorECDLPGateSmokeTest Encoding cross-check + neg-G seal
M8ShorECDLPResearchEval Full evaluation matrix JSON on stdout

Both are required in export_ecdlp_research_dataset.sh.

---

6. Evaluation (peer-review §M2)

Runner: swift run M8ShorECDLPResearchEval

Schema: gaiaftcl.shor.ecdlp.evaluation.v1

instanceId Expected d mod n Periods (typical) Steps Pass
neg_generator_seal n−1 (1, 1) 1 lattice + dG + scalar match
generator_seal 1 (1, n−1) 1 lattice + dG + scalar match
bitcoin_generator_constant 1 (1, n−1) 1 same as G via SEC1 constant

Encoding cross-check must pass before any row is trusted (encodingCrossCheckOK: true).

Not in matrix (honest scope): random 256-bit pubkeys (no fabricated pass rows); demonstration-wallet --wallet-id runs (operator-local; may correlate with composed demos — not mainnet break evidence).

6.1 Full Quantum VM matrix (22 Metal pipelines + ECDLP)

QC-001-ECDLP is the deepest production seal; substrate QC measurement for catalog circuits QC-001…QC-021 (except PoW) is Metal-only (computeBackend: vqbit_metal, 22 precompiled kernels in default.metallib). The cell exports a single validation matrix for every catalog circuit so reviewers do not rely on mislabeled Lean filenames (legacy VQE2.lean was never catalog QC-006).

Artifact Role
QCQuantumVMValidationRegistry.swift Canonical catalogID ↔ Lean paths ↔ Swift gate dirs
QCQuantumVMResearchEvaluation.run() gaiaftcl.qc_vm.validation.v3 + ecdlpEvaluation + L7/L8 + dual path + improvement trend
M8QC21ValidationEval CI driver — exit 0 on allMathLayerOK; STRICT_REWARD / STRICT_LEARNING for L7/L8
M8QuantumVMResearchExport Composes gaiaftcl.qc_vm.research.v4 on stdout
cd cells/xcode && swift run M8QC21ValidationEval
cells/xcode/scripts/peer_review_research_dataset.sh

Tiers (no simulation policy):

Tier Catalog examples Meaning
shorFactorization QC-001 Semiprime factorization (tier1; tier23 separate)
ecdlpProduction QC-001-ECDLP Structured secp256k1 seals
ledgerPoW QC-020 Ledger algebra + live miner L8; L7 is on-chain reward only
decidableWitness QC-002–021 (except above) Finite Hilbert decide seals

Substrate backend split (honest scope):

Family Backend Notes
QC-001…QC-021 (except PoW) vqbit_metal SubstrateMetalPolicy — no CPU fallback
QC-001-ECDLP vqbit_metal QC001_ECDLP.metal
QC-020 PoW vqbit_cpu_projection M8MeasurementComposer + SHA-256 oracle; Metal QC020_BTCPreimage.metal exists but metalQC020Ready=false

Frozen VM row (2026-06-05, qc_vm_validation_latest.json):

Field Value
allMathLayerOK true
allLearningClaimsOK true
allRewardClaimsOK false
qaLayerClosed true
leakAuditPass true
l7RewardLayerStatus learning
metalPipelineCount 22
validation.qc020Learning.telemetryRowCount 2999
validation.qc020DualPath.bothPathsOK true

See QC21_QUANTUM_VM_VALIDATION_REVIEW.md, QC020_DUAL_PATH_QUALIFICATION.md, and RESEARCH_VALIDATION_LEAK_AUDIT.md.

6.2 QC-020 PoW qualification (dual path + learning trend)

Bitcoin PoW qualification runs on two parallel paths — neither implies the other (gaiaftcl.qc020.dual_path.v1):

Path ID Clock Claim scope Backend
Historical OQ/PQ QC-020-HIST Decoupled pow_ledger_oq_pq vqbit_cpu_projection
Live miner QC-020-LIVE Template TTL ~30s, 5 windows pow_live_miner_l7_l8 vqbit_cpu_projection

Historical vectors (frozen): ledger rung 1 (synthetic 2^236) + block 100000 (nonce=274148111, nBits=0x1b04864c). Swift verify_qc020_rungs + header digest cross-check; optional substrate probe via STRICT_SUBSTRATE_PROBE=1.

Live path L8: qc020_substrate_research_telemetry — Grover-bound law, shape persistence, projection cells. learningWitnessOK=true with active miner telemetry.

Live path L7: onChainRewardOK only when chain_accepted + confirmed sats at payout — never simulated. allRewardClaimsOK=false is correct while learning; STRICT_REWARD=1 enforces realized L7 in CI.

Time-to-nonce improvement trend (gaiaftcl.qc020.improvement_trend.v1) — separate from L7 reward:

Source Measures
calorie_telemetry measurement_wall_clock_ns + substrate_iteration_count on CALORIE collapses
calorie_window Wall duration of windows closing on nonce hit
capture_solve solve_duration_ms on capture attempts

improvingOK=true when median time-to-hit decreases across ≥3 timed samples. Current frozen row: trendStatus=insufficient_hits, totalHitSamples=0 (211 ledger captures pre-V155 lack solve_duration_ms; live miner telemetry is cure-terminal only — no CALORIE timed hits yet). This is honest learning instrumentation, not a reward claim.

cells/xcode/scripts/export_qc020_dual_path_research.sh
cells/xcode/scripts/export_qc020_improvement_trend.sh
# STRICT_IMPROVING=1  — fails export when trend not decreasing

---

7. Publication dataset

7.1 Publication dataset index (frozen 2026-06-05)

Schema File Producer
gaiaftcl.shor.ecdlp.research.v2 ecdlp_research_20260605T134447Z.json export_ecdlp_research_dataset.sh
gaiaftcl.shor.ecdlp.evaluation.v1 ecdlp_evaluation_latest.json M8ShorECDLPResearchEval
gaiaftcl.qc_vm.research.v4 qc_vm_validation_latest.json export_quantum_vm_research.sh
gaiaftcl.qc020.dual_path.v1 qc020_dual_path_latest.json export_qc020_dual_path_research.sh
gaiaftcl.qc020.improvement_trend.v1 qc020_improvement_trend_latest.json export_qc020_improvement_trend.sh

ECDLP composer: ShorECDLPResearchDataset.compose

{
  "schema": "gaiaftcl.shor.ecdlp.research.v2",
  "ecdlp": {
    "pipeline": "shor_lattice_ecdlp_secp256k1",
    "computeBackend": "vqbit_metal",
    "publicQHex": "0379be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798",
    "qSource": "neg_generator_seal",
    "encodingCrossCheckOK": true,
    "periods": { "ra": "1", "rb": "1" },
    "recoveredDHex": "fffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364140",
    "checks": { "lattice": true, "dG_eq_Q": true },
    "substrateSteps": 1
  },
  "evaluation": {
    "schema": "gaiaftcl.shor.ecdlp.evaluation.v1",
    "computeBackend": "vqbit_metal",
    "metalPipelineCount": 22,
    "rows": [ "..."]
  },
  "leanGates": [ /* ShorFactorLarge, ShorECDLP */ ]
}

Note: neg-G seal uses 03… (odd y), not the generator’s 02… — see §4.4.

7.2 Reproducibility commands

# Lean only
proof/scripts/lean_gate.sh FirstRoars/ShorECDLP.lean
proof/scripts/lean_gate.sh FirstRoars/ShorFactorLarge.lean

# Metal shaders (required before any substrate QC run)
cells/xcode/scripts/build_metal_shaders.sh

# Swift seal + evaluation matrix
cd cells/xcode && swift run M8ShorECDLPGateSmokeTest
swift run M8ShorECDLPResearchEval

# Full paper row → evidence/research/
cells/xcode/scripts/export_ecdlp_research_dataset.sh

# Full QC catalog + peer review (research.v4)
cells/xcode/scripts/peer_review_research_dataset.sh

# QC-020 dual path + time-to-nonce trend (embedded in research.v4 after full export)
cells/xcode/scripts/export_qc020_dual_path_research.sh
cells/xcode/scripts/export_qc020_improvement_trend.sh

# CLI witness (no wallet file)
cd cells/xcode && swift run GaiaFTCLCLI shor break-classical \
  --neg-generator-seal --witness-out 2>/dev/null | tail -1

# Wallet-bound row
gaiaftcl shor break-classical --wallet-id <demoexp-…> -v --witness-out

Environment: GAIAFTCL_REPO_ROOT must point at repo root for lean_gate.sh resolution.

7.3 Audit hook

File: cells/xcode/scripts/audit_shor_spend_keys.py

Function: verify_ecdlp_witness_json — accepts research.v1 / v2, requires encodingCrossCheckOK when present, evaluation rows when bundled.

---

8. CLI and operator surfaces

8.1 gaiaftcl shor break-classical

File: ShorBreakClassicalCommand.swift

Phase Exit code
RSA verify_shor ladder fail 1
ECDLP witness fail 2
Lean not CALORIE 3
lean_gate.sh missing 4
Wallet resolve fail 7

Flags:

Flag Effect
-v / --verbose RSA + ECDLP leg trace
--witness-out Emit ShorECDLPResearchDataset JSON on stderr
--neg-generator-seal Built-in Q = −G; no TOML required
--wallet-id / --wallet-label / pubkey flags Resolve demonstration wallet; Q from public_key_hex

Emission honesty: Recovered key on stdout is from witness pass (lattice + dG_eq_Q), not TOML equality. Demonstration wallets are not evidence of breaking arbitrary mainnet keys (peer-review §M5).

8.2 gaiaftcl pq prove-fork-required

Runs math legs only (RSA + ECDLP via verifyMathLegs with secp256k1SealWalletContext()); no Lean on that command. Use break-classical for full dual Lean + dataset.

---

9. VQbit integration

File: cells/xcode/Sources/VQbit/SubstrateAmplitudeAmplifier.swift

Binding: amplifyAgainstSecp256k1EllipticLattice — one C⁴ substrate step per call; VM daemon loops until .calorie.

Uses the same ShorECDLPSubstrate module as M8 (no duplicate curve composer). Documented in package dependency graph: VQbitShorECDLPSubstrate.

---

10. Removed anti-patterns (historical honesty)

The following were removed from the ECDLP research path because they break peer-review reproducibility:

Anti-pattern Why removed
periodsForPrivateKey Circular: periods derived from secret d
Default maxProbes / GAIAFTCL_ECDLP_MAX_PROBES Artificial cap misrepresented as exhaustion
512×512 (ra, rb) cage Subset of ℤ/nℤ presented as full search
Legacy UInt64 curve composer on production claims EllipticLatticeOracleComposer unused on mainnet path
Emitting wallet TOML secret as “recovered” without verification Replaced by recoveredScalarHex + dG_eq_Q
Lean import Mathlib on ShorECDLP.lean Failed build; violated Lion Protocol

---

11. Complete code ↔ paper index

11.1 Lean

Paper § Artifact Key symbols
§2.1 proof/lean/FirstRoars/ShorECDLP.lean ecdlpWitnessHolds, seals, falsifiers
§2.4 proof/lean/FirstRoars/ShorFactorLarge.lean shorClassicalHolds, semiprime seals
§5.2 proof/scripts/lean_gate.sh CALORIE / REFUSED / CURE
§5.2 proof/lean/lakefile.lean FirstRoars lib, no Mathlib

11.2 Substrate (shared)

Paper § File Key API
§4 Sources/ShorECDLPSubstrate/ShorECDLPSubstrate.swift measureUntilLatticeCalorie, modInverse
§4.2 ShorECDLPSubstrateBasis.swift nextBasis, fingerprint
§4.2 ShorECDLPSubstrateMapping.swift periodCandidates
§2.3 ShorECDLPSubstrateCurve.swift latticeIsIdentity, point ops
§2.2 ShorECDLPSubstrate/BigInt.swift Scalar field arithmetic

11.3 M8 / CLI / evidence

Paper § File Key API
§2.2, §5.1 M8FrequencySweep/ShorECDLP/ShorECDLPSecp256k1.swift verifyFromQ, measurePeriodsFromQ
§5.1 ShorECDLPWitness.swift compose, JSON
§6–7 ShorECDLPResearchDataset.swift compose, LeanGateVerdict, v3 quantumVm
§6.1–6.2 QCQuantumVMResearchDataset.swift gaiaftcl.qc_vm.research.v4
§6.1 scripts/export_quantum_vm_research.sh Full catalog export
§6.2 QC020/QC020DualPathQualification.swift gaiaftcl.qc020.dual_path.v1
§6.2 QC020/QC020ImprovementTrend.swift gaiaftcl.qc020.improvement_trend.v1
§6.2 QC020/QC020LearningWitness.swift L8 telemetry snapshot
§6.2 scripts/export_qc020_dual_path_research.sh Dual-path row
§6.2 scripts/export_qc020_improvement_trend.sh Hit-timing trend row
§6 ShorECDLPResearchEvaluation.swift run(), evaluation rows
§4.4, §5.3 ShorECDLPEncodingCrossCheck.swift encodingCrossCheck()
§4.4, §5.3 ShorECDLPGate.swift shorECDLPSecp256k1Sealed
§7 GaiaFTCLCLI/ShorBreakClassicalCommand.swift executeBreakChain, verifyMathLegs
§6.2 scripts/export_ecdlp_research_dataset.sh Full export
§6.3 scripts/audit_shor_spend_keys.py Witness validation
§6 evidence/research/*.json Frozen dataset rows

11.4 Package targets (Package.swift)

Target Role
ShorECDLPSubstrate Core measurement + curve
M8FrequencySweep ShorECDLP types + gate
M8ShorECDLPGateSmokeTest CI smoke + encoding cross-check
M8ShorECDLPResearchEval Evaluation matrix export
M8QC21ValidationEval Full QC validation matrix
M8QuantumVMResearchExport Compose qc_vm.research.v4
M8QC020DualPathQualificationEval QC-020 HIST + LIVE qualification
M8QC020ImprovementTrendEval Time-to-nonce trend JSON
M8ListQCLeanArtifacts Paths for batch lean_gate.sh
GaiaFTCLCLI Operator CLI
VQbit Substrate amplifier binding

---

12. Grover separation (QC-002)

QC-001 Shor ECDLP QC-002 Grover
Problem Discrete log / period lattice Marked search / amplitude amplification
Corpus ShorECDLP*, ShorECDLPSubstrate GroverCircuit, VQbitGameCircuit
Lean ShorECDLP.lean, ShorFactorLarge.lean Separate First Roars (not merged into ECDLP witness)
CLI shor break-classical Distinct commands / circuits

Mixing Grover simulation claims into the ECDLP dataset would contaminate peer review; the repository keeps these legs separate by design (pure_oo_quantum_compute_spec.md, CircuitCorpus).

---

13. Substrate-honest disclosure alignment

Wiki: wiki/two-wallet-demonstration/substrate-honest-disclosure.md describes bit-size discipline and federation evidence. This ECDLP path now binds live secp256k1 via P256K in ShorECDLPSecp256k1.swift; operators should treat any wiki sentence claiming “no P256K import” as stale relative to cells/xcode/Sources/M8FrequencySweep/ShorECDLP/.

What remains honestly not demonstrated:

What is demonstrated with frozen artifacts:

---

14. Peer-review response log (v2)

Review ID Issue Resolution in v2
M1 Name implied full Shor QFT Renamed pipeline shor_lattice_ecdlp_secp256k1; paper title updated
M2 Single-instance evidence M8ShorECDLPResearchEval + §6 evaluation table
M3 Lean only at n=13 Added neg-G and generator pattern seals at 13, 17, 97
M4 Q hex vs neg-G label ShorECDLPEncodingCrossCheck; 02 G vs 03 −G documented
M5 Demo wallet confusion CLI help + paper §8.1 emission honesty
M6 Unbounded search Documented; no step caps on substrate (operator refusal separate)
M7 QC Lean IDs mislabeled Full VM registry + export_quantum_vm_research.sh
M8 Only ECDLP had evaluation JSON gaiaftcl.qc_vm.validation.v3 + qc_vm.research.v3
M9 Oracle-class circuits had no Lean DJ/BV/Simon/AmpEst + QC-021 LVC gates shipped
M10 QC-020 conflated ledger + live miner Dual-path export QC-020-HIST / QC-020-LIVE; bothPathsOK disclaims L7
M11 No learning-improvement visibility qc020.improvement_trend.v1 — median time-to-hit trend
M12 Global vqbit_metal misread for PoW substrateComputeBackendNote; QC-020 uses vqbit_cpu_projection

---

15. Lessons since the first harness (v3)

Lesson What we fixed
Lean proofID ≠ catalog ID QCQuantumVMValidationRegistry + registry realignment (VQE2 is QC-013, not QC-006)
Missing ECDLP / PoW in Rosetta ShorECDLP.lean, BTCPreimageLarge.lean registered
Decidable witness misread as mainnet break Tiers: production vs decidableWitness; paper language updated
neg-G vs generator hex ShorECDLPEncodingCrossCheck mandatory in gate v5
Substrate step caps Removed; evaluation records real substrateSteps
QC-006–010 / 021 only VM-tested New Lean + Swift gates: DeutschJozsa2, BernsteinVazirani4, Simon8, AmplitudeEstimationMarked, MeaningInvariant
Single export path export_quantum_vm_research.sh + leak_audit_pass.sh; ECDLP embeds quantumVm via --full-research-out
CPU fallback on substrate QC RemovedSubstrateMetalPolicy refuses; ECDLP lattice on GPU (QC001_ECDLP.metal); rebuild via build_metal_shaders.sh
Paper revalidation (2026-06-05) All 3 ECDLP evaluation rows witnessOK on vqbit_metal; peer_review_research_dataset.sh PASS; leak_audit_pass.sh PASS (Pass 6 dual-path)
QC-020 dual path (2026-06-05) bothPathsOK=true; HIST ledger + block-100000; LIVE L8 learning active
Improvement trend (2026-06-05) Export wired; insufficient_hits until timed CALORIE/capture rows accumulate
Window telemetry fix qc020_window_summaries now accumulates total_substrate_iterations + mean_measurement_wall_clock_ns

Frozen bundle schemas

Schema Producer
gaiaftcl.shor.ecdlp.research.v2 ECDLP witness + RSA/ECDLP Lean gates
gaiaftcl.shor.ecdlp.evaluation.v1 Three structured seals (neg-G, G, generator constant)
gaiaftcl.qc_vm.research.v4 Full catalog + validation block (L7/L8/dual path/improvement trend)
gaiaftcl.qc_vm.validation.v3 Per-row mathLayerOK / rewardLayerOK / learningLayerOK
gaiaftcl.qc020.dual_path.v1 Parallel HIST/LIVE qualification + bypass audit
gaiaftcl.qc020.improvement_trend.v1 Daily hit buckets + timeToHitTrend direction
gaiaftcl.qc020.learning_witness.v1 L8 telemetry snapshot (embedded in VM validation)

16. Future work (code-adjacent)

1. Export modular row at secp256k1 n — witness field leanModularShadow with (ra, rb, d mod n) for cross-check without Lean decide on full n.

2. Wallet rows in batch exportDEMOEXP_WALLET_ID optional second JSON in export_ecdlp_research_dataset.sh.

3. Ledger agreement rows — wire leanGates into NarratorSchema dual-verdict tables (pattern from NarratorSchemaV115).

4. Bounded-step evidence — optional witness field recording step histogram without reintroducing refusal caps.

5. Timed hit accumulation — backfill or regenerate ledger captures with solve_duration_ms > 0 so improvingOK can flip true; live CALORIE terminals on easy rungs or network target.

6. L7 realizationchain_accepted block + confirmed payout sats (STRICT_REWARD=1 gate).

---

17. References (in-repo)

Reference Path
Operational README cells/xcode/docs/SHOR_ECDLP_RESEARCH.md
Lean gate contract proof/scripts/lean_gate.sh header
Lion Protocol (no Mathlib) proof/lean/lakefile.lean
BIP / PQ motivation cells/xcode/docs/bips/bip-p2pqh.md
Substrate disclosure wiki/two-wallet-demonstration/substrate-honest-disclosure.md
Example ECDLP dataset evidence/research/ecdlp_research_20260605T134447Z.json
ECDLP evaluation evidence/research/ecdlp_evaluation_latest.json
Full VM dataset evidence/research/qc_vm_validation_latest.json
QC-020 dual path evidence/research/qc020_dual_path_latest.json
QC-020 improvement trend evidence/research/qc020_improvement_trend_latest.json
QC-020 dual path doc cells/xcode/docs/QC020_DUAL_PATH_QUALIFICATION.md
Metal shader build cells/xcode/scripts/build_metal_shaders.sh
Leak audit cells/xcode/scripts/leak_audit_pass.sh

---

Appendix A — Recovery derivation

Given ra + rb·d ≡ 0 (mod n) and gcd(rb, n) = 1:

rb·d ≡ −ra (mod n)
d ≡ −ra·rb⁻¹ (mod n)

Swift implements −ra as modNorm(0 - ra, n). Lean implements negMod ra n and modInv rb n analogously.

Appendix B — Neg-G seal check

Let d = n − 1. Then rb·d ≡ 1·(n−1) ≡ −1 (mod n) and ra + rb·d ≡ 1 + (−1) ≡ 0 (mod n) for ra = rb = 1.

On the curve, Q = (n−1)·G = −G, so the ECDLP instance is the standard generator negation used in ShorECDLPGate.

Appendix C — Gate version fingerprint

shorECDLPGateVersion = "qc001-ecdlp-lattice-secp256k1-gate-v5.0.0"

Bump this string when witness semantics or substrate mapping change; include in paper supplementary tables when publishing frozen commits.

---

*End of paper v3. Synchronize with SHOR_ECDLP_RESEARCH.md, evidence/research/*_latest.json, and QC020_DUAL_PATH_QUALIFICATION.md.*

Federation cosignature: pending operator signing host (v26). Witness (sha256 of rendered body): 1b8d80143fa2a641802d59f61b3dd2cc30844799767446989050b911470c59c5. This page serves with a substrate-honest pending-signature notice until the operator's Franklin signer cosigns it.