# Workstream 25 — secp256k1 endomorphism optimizations and their limits for Puzzle #71 **Status: no key recovered. This item is an analysis + bounded-experiment review.** It assesses whether the secp256k1 GLV endomorphism meaningfully reduces the cost of solving Bitcoin Puzzle #71, verifies the relevant constants and the target facts, and measures the claimed speedups on small locally generated instances. Finding, stated up front: **the endomorphism does *not* lower the exponential cost of the Puzzle #71 interval search; it only yields a small constant-factor gain, and for a fixed interval that gain is weaker than for full-group search.** ## 1. Question and assumptions - Question: Does the efficiently-computable secp256k1 endomorphism φ(x,y)=(βx, y)=λ·P reduce the work to recover the Puzzle #71 key below the generic ~2^35.5 group-operation interval bound? - Assumptions: standard secp256k1 parameters (p, n, G); Puzzle #71 is an interval DLP over [2^70, 2^71−1] with a *known* public target. Pollard rho/kangaroo and BSGS are the applicable solvers (no quantum hardware). GPUs are *not* assumed. All experiments are CPU, pure-Python, single-threaded, bounded. - What #71 supplies: a P2PKH **address only** (hash of the pubkey), interval bounds, ~7.1 BTC bounty. The 160-bit pubkey hash — not the pubkey — is public until the key range is swept, so kangaroo/rho that need the target *point* operate on candidate pubkeys derived during the walk. The endomorphism acts on points, so it is relevant to any point-arithmetic-bound solver. ## 2. Verified target facts (with sources, UTC) Checked 2026-11-23 ~07:35 UTC, Bitcoin block height **977166** (blockchain.info latestblock). - Puzzle address **1PWo3JeB9jrGwfHDNpdGK54CRas7fsVzXU**. Live query (blockchain.info rawaddr): `"total_received":710196696,"total_sent":0,"final_balance":710196696` → **7.10196696 BTC, never spent (total_sent = 0) → UNSOLVED.** `n_tx":73` reflects many tiny inbound sends; the funding output is unspent. [S1] - Interval 0x400000000000000000 … 0x7fffffffffffffffff = [2^70, 2^71−1], width 2^70. Consistent with the public puzzle definition; matches the brief. No parameter conflict found. - Reward recipient **bc1pg6luxm9s4qq65lge4l6ual7xwdw5v85eh675cmrl5we0ht3vpfhswxu0cx** independently decoded (my `bech32.py`): valid **bech32m**, HRP `bc`, **witness v1**, 32-byte program `46bfc36c…ae2c0a6f` → well-formed P2TR (taproot) output. bech32 (v0) checksum fails, bech32m passes, confirming correct v1 encoding. No key material is derivable from it; it is only a payout address. I did not and cannot claim to transfer any prize; no transaction was broadcast. ## 3. The endomorphism: constants and method (verified) secp256k1 admits an order-3 endomorphism. With β a cube root of 1 mod p and λ a cube root of 1 mod n, φ(P) = (β·x mod p, y) = λ·P. Published constants (libsecp256k1 / Finney / paul millr) [S2][S3]: ``` beta = 0x7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee lam = 0x5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72 ``` The GLV method uses λ to split a 256-bit scalar k into k = k1 + k2·λ mod n with k1,k2 ≈ 128 bits, halving the double-and-add length. libsecp256k1 derives the split constants (a1,b1,a2,b2) via Gauss lattice reduction / trace of Frobenius; its generator comment: "Generates the constants used in secp256k1_scalar_split_lambda." and "PHI : Z[l] -> Z_n where phi(a + b*l) == a + b*lambda mod n." [S2] **Where the speedup actually applies (and its ceiling):** - *Scalar multiplication / signature verify / ECDH*: real but modest. paul millr's secp256k1 notes: "Endomorphism uses 2x less RAM, speeds up precomputation by 2x and ECDH / key recovery by 20%." [S3] Finney reported ~25% on signature verification. This accelerates *each* point multiply, i.e. the cost of one group operation, not the *number* of operations a DLP needs. - *Pollard rho (full group)*: the endomorphism gives equivalence classes {±P, ±λP, ±λ²P} (order 6), reducing the search space by up to 6 and the expected walk by up to √6 — in theory. In practice fruitless cycles and boundary effects erode this toward √2–~1.3 (negation map alone). [S4] - *Interval DLP (Puzzle #71's actual setting)*: Galbraith–Ruprai show equivalence-class acceleration is much harder for the *short-interval* kangaroo than for rho — "it seems impossible to implement the standard kangaroo method with equivalence classes" — and their best class-based interval algorithm reaches only ≈1.36√N (fast inversion), versus ≈2√N plain and ≈1.71√N for 4-kangaroo. [S4] Kangaroo running times are all Θ(√N) regardless. [S5] ## 4. Executed tests, hardware, results Environment: single CPU core, Python 3.12.3, pure-integer EC arithmetic, no external libraries. Scripts (`test/scratch/endo.py`, `bech32.py`) are reproducible; core logic reproduced below. **(a) Constant / endomorphism correctness** — PASS: - `pow(beta,3,p)==1` True; `pow(lam,3,n)==1` True. - For 5 random P: φ(P)=(β·x mod p, y) equals λ·P (full scalar multiply) — True. **(b) GLV decomposition** (libsecp256k1 split constants a1,b1,a2,b2): over 2000 random k, every k1+k2·λ ≡ k (mod n), and **max bit-length of k1,k2 = 129** vs ~256 for k. Confirms the ~2x scalar-length reduction that underlies the "~20%" scalar-mult speedup. Measured, not estimated. **(c) The decisive limit for a fixed interval** — measured: For 3000 random k in [2^70, 2^71−1], the fraction of λ·k mod n that also falls in the interval is **0.0**. The endomorphism image λ·k (and −k) lands effectively uniformly in [0,n); it leaves the 2^70-wide window. So applying φ to a candidate does **not** produce another candidate inside the search interval — the endomorphism **cannot shrink the interval** the way it shrinks a full-group search. This is the concrete reason the puzzle's √m class speedup is not freely available. **(d) Interval-DLP scaling baseline** (BSGS, to anchor the Θ(√N) cost and verify correctness): recovered the key for random instances of width 2^20/2^24/2^28 in 0.07/0.30/0.75 s, using ≈1.1–1.7·√w group operations — matching textbook BSGS. Extrapolating the *cost model* (not a run): width 2^70 needs ≈2^35 point ops; even the most optimistic class-based interval factor (~1.36/2 ≈ 0.68×) leaves ≈2^34.5 ops — a constant-factor dent, not a structural break. ```python # φ(P)=λ·P and GLV split (core of endo.py) assert pow(beta,3,p)==1 and pow(lam,3,n)==1 P = mul(k,G); assert ((beta*P[0])%p, P[1]) == mul(lam,P) # endomorphism identity k1,k2 = splitk(k); assert (k1 + k2*lam) % n == k # GLV decomposition # limit: lambda*k leaves the puzzle interval assert not (lo <= (lam*k)%n <= hi) # true for essentially all k in [2^70,2^71) ``` ## 5. Limitations and honest negatives - Experiments are single-core Python on interval widths ≤2^28; they validate *correctness and the per-operation/complexity claims*, not large-scale throughput. The 2^70 numbers are **extrapolated cost models, explicitly labelled as such**, never executed. - I did not reproduce a √6 rho speedup end-to-end (fruitless-cycle handling is out of scope here); I rely on cited literature [S4] for the practical ceiling and corroborate the *mechanism* (classes of size 6) directly. - No pattern/"closeness" claim is made. Address-prefix coincidences carry no information about key value; the interval limit test (§4c) shows φ/negation scramble the key across [0,n). - The endomorphism speeds up each group operation (~20–25%) and halves scalar length; these compound into any solver but are **multiplicative constant factors on an exponential cost** (~2^35 ops for #71's 2^70 interval). They do not bring #71 into feasible range on CPU, and offer no asymptotic help. Combined with the §4c interval limit, the honest conclusion is that endomorphism optimization is a real engineering win for implementations but **not a path to solving Puzzle #71**. ## 6. Best next experiment Measure the *realized* interval-DLP speedup of the Galbraith–Ruprai class-based kangaroo [S4] versus plain Pollard kangaroo on secp256k1, on widths 2^30–2^40, counting group operations to completion (with correct fruitless-cycle handling and boundary clamping). This would replace the literature estimate (≈1.36√N vs ≈2√N, i.e. ~1.5× best case) with a measured factor on the actual curve and quantify exactly how much — if any — the endomorphism adds on *top* of the negation map for interval search. That bounds the real-world benefit for #71-class problems without any infeasible full run.