# Workstream 26: Incremental public-point calculation optimizations (Bitcoin Puzzle #71) **Outcome: no solution found.** This workstream reviewed and measured the optimizations that brute-force tools use to step a secp256k1 public point through consecutive private keys. The measured optimizations change the constant factor by roughly 40-60x over a naive implementation but leave the 2^69 expected-work exponent untouched. At the rates measured here the full interval would take tens of millions of CPU-core-years. Everything labelled "measured" below was executed on this machine; everything labelled "estimate" is arithmetic on those measurements. ## 1. Question and assumptions Question: how fast can one compute, for consecutive private keys k, k+1, k+2, ... in the interval 2^70..2^71-1, the public point k*G and its compressed-key hash160, and does any incremental optimization make Puzzle #71 feasible on commodity hardware? Assumptions: - Puzzle #71 publishes only the P2PKH address (hash160 of the compressed public key). No public key for this address exists on chain, because the address has never spent (verified below). Therefore Pollard kangaroo and BSGS, which require the public key, are not applicable; only hash160 brute force over the interval is. - The key is uniformly random in the interval (the challenge description says "take random number"). Expected work is 2^69 point evaluations; no pattern-based shortcut was assumed or tested here. - Hardware: this machine only (2 vCPUs of an Intel Xeon Platinum 8259CL at 2.5 GHz, 7 GB RAM, no GPU). No paid compute, no network pools. ## 2. Target verification (executed 2026-11-23, UTC) Sources and raw values are in sources.json. - Chain tip at check time: block 977166, hash 00000000000000000001eb8dbe3d5f56627ee265efd5d61d48cc1929cbd4c9ec, timestamp 1795419250 = 2026-11-23T07:34:10Z (mempool.space block API). - Address 1PWo3JeB9jrGwfHDNpdGK54CRas7fsVzXU: 73 funded outputs, 710,196,696 sat (7.10196696 BTC), 0 spent outputs, 73 transactions, nothing in mempool (mempool.space address API). Since spent_txo_count is 0, the public key has never been revealed. Status: UNSOLVED. - Largest UTXO: txid 12f34b58...8d13b3 vout 5, 6.39 BTC, block 785620 (2023-04-16), matching the bitcointalk thread statement that on 2023-04-16 "The creator of the challenge paid rounded amounts of BTC to the remaining unguessed addresses". Oldest UTXO: the original 2015 puzzle transaction 08389f34...a6cd15 vout 70, 0.071 BTC, block 339085. - Interval 0x400000000000000000..0x7fffffffffffffffff (2^70..2^71-1) matches the challenge rule quoted in the bitcointalk thread ("take random number from 2^70 upto 2^71-1" pattern) and the btcpuzzle.info puzzle page, which lists Start 400000000000000000, End 7fffffffffffffffff, 7.10196696 BTC, Unsolved. The original 2015 post (Bulista, 2015-12-28) describes the transaction as "those 32.896 BTC were sent to multiple addresses". - Target hash160 (base58check-decoded locally, checksum verified): f6f5431d25bbf7b12e8add9af5e3475c44a0a5b8. - Recipient bc1pg6luxm9s4qq65lge4l6ual7xwdw5v85eh675cmrl5we0ht3vpfhswxu0cx: decoded locally as hrp "bc", bech32m checksum valid, witness version 1, 32-byte program (a valid P2TR address). Not used for anything else; no funds exist to move. ## 3. Review of the optimizations (analysis) Computing k*G from scratch costs about 256 doublings plus about 128 additions. Incremental stepping replaces this with one point addition P <- P + G per key. The standard optimizations, as implemented in VanitySearch/BitCrack/Kangaroo-class tools, are: 1. **Affine addition with a shared inversion (Montgomery batch inversion).** Each affine addition needs one modular inverse of dx = x_G - x_P. Inverting n values together costs one inversion plus "three multiplications per additional input" (Wikipedia, Modular multiplicative inverse, "Multiple inverses"). With a table T[i] = i*G and a running point P, one computes P + T[i] for i = 1..B from a single inversion, then jumps P <- P + T[B]. Per key: about 3 muls (batch) + 1 mul (lambda) + 1 sqr + 1 mul (y3) = 6 mul-equivalents plus inversion/B. 2. **Plus/minus symmetry (two keys per inverse).** P + T[i] and P - T[i] share the same dx, so one inverse yields both keys k+i and k-i. Cost per key drops to about 4.5 mul-equivalents. This is the only "symmetry" that helps an interval search: the group negation k -> n-k and the GLV endomorphism k -> lambda*k map keys outside the 2^70..2^71 interval, so they give no useful extra coverage for Puzzle #71 (they help vanity search, where any key counts). VanitySearch's README mentions that its simplified description "does not take care of symmetry and endomorphism optimizations". 3. **Projective/Jacobian coordinates** avoid inversions entirely but the address check needs the affine x and the parity of y, so an inversion per key returns; batched affine wins (this is why the GPU tools use affine batches). 4. **Fast inversion** (VanitySearch/Kangaroo: "Fast Modular Inversion (Delayed Right Shift 62 bits)"; libsecp256k1 uses safegcd). With B = 2048 the inversion is amortised to about 0.16 mul-equivalents per key here, so fast inversion matters far more for kangaroo walks (where the batch is the number of kangaroos) than for brute force. 5. **Fast field multiplication** (VanitySearch: "2 steps folding 512bits to 256bits using 64 bits digits"). Implemented here in the same style with 4x64-bit limbs and __int128. 6. **Hashing.** For an address-only puzzle every key needs SHA-256 + RIPEMD-160 of the 33-byte compressed key. Nothing in the EC step can remove this; it is the floor. Inputs required: the address only. Puzzle #71 supplies it. Kangaroo ("limited to a 125bit interval search", expected "2.08*sqrt(k2-k1)" group operations) and keyhunt BSGS ("search privatekeys for a known public key") require the public key, which Puzzle #71 does not supply. ## 4. Method and reproducible code A self-contained C program (about 300 lines, no dependencies) was written in test/scratch/bench.c with: 4x64-bit field arithmetic mod p = 2^256 - 2^32 - 977; Fermat inversion with a 4-bit window; Montgomery batch inversion; affine add/double; naive scalar multiplication for setup; single-block SHA-256 and RIPEMD-160; and three stepping modes (naive, batch, batch+symmetry). A pure-Python reference (ref.py, hashlib only) independently computed k*G and hash160. Correctness checks (all executed, all passed): - Python reference reproduces the known solved addresses for puzzles 1-5 (keys 1, 3, 7, 8, 21). - C hash160/x/parity for 71 keys spanning 1 to 2^71 agreed with the Python reference (0 mismatches). - XOR checksums of hash160 over the same 6144 keys were identical for naive, batch B=512 and batch B=2048; the 1025-key symmetric round matched naive. (A first version had a real bug: T[2] was built with the generic add formula, which divides by zero when P = Q; caught by exactly this check.) Build and run (single thread): ``` gcc -O3 -march=native -o bench bench.c ./bench run MODE B START_HEX COUNT [hash|nohash] [TARGET_HASH160_HEX] # MODE 0 naive, 1 batch inversion, 2 batch + symmetry; B = batch size ``` ## 5. Measured results (this machine, single thread unless noted) Field primitives: | operation | measured | |---|---| | fe_mul (256-bit mod p) | 113 ns | | fe_inv (Fermat, 4-bit window) | 36.7 us = about 325 fe_mul | | hash160 of compressed key (scalar C) | 3.04 us | Public-point stepping without hashing, 2^20 keys per run: | mode | keys/s | ns/key | speedup | |---|---|---|---| | naive, one inversion per key | 26,600 | 37,500 | 1x | | batch B=64 | 657,000 | 1,522 | 25x | | batch B=256 | 934,000 | 1,071 | 35x | | batch B=1024 | 1,038,000 | 963 | 39x | | batch B=2048 | 1,061,000 | 942 | 40x | | batch B=8192 | 1,006,000 | 994 | 38x | | batch + symmetry B=1024 | 1,254,000 | 797 | 47x | | batch + symmetry B=2048 | 1,297,000 | 771 | 49x | | batch + symmetry B=8192 | 1,519,000 | 658 | 57x | 942 ns/key at B=2048 is 8.3 fe_mul-equivalents against a theoretical 6.2; 658 ns/key with symmetry is 5.8 against 4.6. The remainder is additions, subtractions, normalisation and loop overhead. Batch gains saturate around B=1024-2048, exactly as the inversion/B term predicts. Full pipeline (stepping + hash160 + 20-byte compare against the Puzzle #71 hash160): | configuration | keys/s | |---|---| | naive + hash | 35,300 | | batch B=2048 + hash | 306,000 | | batch+symmetry B=2048 + hash, run A | 349,000 | | batch+symmetry B=2048 + hash, run B (later, lighter load) | 528,000 | | two processes, batch+symmetry + hash | 262,000 + 262,000 = 524,000 | The two single-process figures differ by 1.5x between runs on the same binary; the host is a shared 2-vCPU VM and the variance is attributed to CPU frequency and neighbour load, not to the code. Two processes gave only about 1.5x of one, consistent with the 2 vCPUs being hyperthreads of one core. With hashing, the scalar hash160 costs about 3-4x the EC step, so the EC optimizations above are hidden behind the hash unless hashing is also vectorised. End-to-end test on locally generated puzzles (executed): - 26-bit puzzle: random key in [2^25, 2^26), address 16kQNHvp1Ad9ziPUNG9LX86AJZfdGJJ4ge. Interval split into two halves of 2^24 keys, one process each, batch+symmetry B=2048 with hashing. One process reported the key after 63.4 s (0x2dda341, correct); the other scanned its half in 63.6 s without a match. 2^25 keys in 64 s wall clock. - 24-bit puzzle: 2^23 keys scanned in 15.9 s, key 0xaf3011 found (correct). - Negative control: the same 24-bit target against 2^22 keys of the wrong interval returned no match, as expected. - Bounded run on the real interval: 2 x 2^21 keys from 0x400000000000000000 and 0x400000000000000200000 with the real target hash160 (16 s). No match, as expected: this covered 2^-48 of the interval. ## 6. Extrapolation (estimate, arithmetic on the measurements above) Interval size 2^70 = 1.18e21 keys; expected work 2^69 = 5.9e20. | sustained rate | full interval | expected (half) | |---|---|---| | 5.0e5 keys/s (this machine, 1 process, best run) | 7.5e7 years | 3.7e7 years | | 1e9 keys/s (assumed for one well-optimised modern GPU; not measured here) | 37,400 years | 18,700 years | | needed to finish expected work in 1 year | 1.87e13 keys/s | | Even a further 100x from SIMD hashing and libsecp256k1-grade field code would leave the single-core expected time above 10^5 years. Incremental public-point optimizations are necessary engineering for any brute-force attempt, but they are a constant factor on a 2^69 problem. ## 7. Failed or rejected hypotheses - "Symmetry and endomorphism give 3-6 keys per point" (a claim common in vanity-search discussions): for an interval search only the shared-dx plus/minus trick applies; negation and the lambda endomorphism leave the interval. Rejected by analysis. - "Larger batches keep helping": measured gains saturate at B about 1024-2048 for plain batching; the symmetric mode kept improving to B=8192 (table-cache effects not isolated). Partially rejected. - "Faster inversion is the key lever": with batching the inversion is under 2% of per-key cost here. Rejected for brute force; still relevant for kangaroo. - No pattern or address-prefix hypothesis was tested; address prefixes carry no information about numerical closeness of keys and none was assumed. ## 8. Limitations - Measurements are from one shared 2-vCPU VM with 1.5x run-to-run variance; absolute numbers are indicative, ratios are more reliable. - The hash160 implementation is scalar and unoptimised (3 us). Production tools use SIMD or GPU hashing; the EC-only table is therefore the fair measure of the public-point optimizations themselves. - The Fermat inversion is slow (325 muls); this inflates the naive baseline and so the 40x figure. With a safegcd inversion the naive baseline would be perhaps 5-10x faster and the batch speedup correspondingly smaller, but the batch and symmetric absolute rates would barely change. - GPU figures are not measured; the 1e9 keys/s row is an assumption used only to show the order of magnitude. - No part of this workstream brings Puzzle #71 within reach; the public key is unavailable, so the sqrt-time algorithms cannot be used. ## 9. Best next experiment Replace the scalar hash160 with an 8-lane AVX2 SHA-256/RIPEMD-160 and the field code with libsecp256k1's (safegcd inversion, 5x52 field), then re-measure the full pipeline on this machine to establish the CPU ceiling for an address-only incremental search. The expected result is roughly 3-5 Mkeys/s per core, which would still be 10^6-10^7 core-years for the expected work; the experiment is useful to settle the constant factor, not to solve the puzzle. For the goal as a whole, the decisive fact is that Puzzle #71 has no exposed public key, so the only applicable method is exhaustive search over 2^70 keys.