Query/off-chain certificates for hinted Schnorr batches

The selected experimental certificate reduces a complete replicated verification of 100 distinct BIP340 signatures from 57,207,852 to 47,015,059 instructions (17.82%), using 1,026 additional proof bytes. The update independently checks the incoming records and proof; it needs no previous query, key cache or trusted producer. A fresh second canister accepted an independently generated off-chain packet at exactly the same instruction cost.

This is a derived Fiat–Shamir protocol, not an independently audited signature scheme. Its assumptions are additional to those of the original weighted BIP340 batch. See the protocol and soundness conditions, runner and evidence packet.

Complete-call results

All rows include incoming Wire decoding, fresh preparation, page fees and reply work. Whole, body and page views overlap; nothing is subtracted. The selected rows and ordinary control have three identical instruction samples. Costs are for the entire stated population, not one signature.

Operation Whole instructions Included page instructions Population / proof
Ordinary current SIMD/GLV W7 aggregate 57,207,852 1,120,000 100; existing P/R coordinate hints
Selected certificate update, b16/t128/W7 47,015,059 1,200,000 100; additional 1,026B certificate
Off-chain certificate → fresh canister update 47,015,059 1,200,000 Same complete packet; one sample; zero prior queries
Independent filter-only query 113,287,765 880,000 105 checked, 100 accepted, five rejected
Filter + reference-column certificate query, W6 191,338,827 1,040,000 Same 105; 1,026B certificate
Filter + selected four-column SIMD query, W6 175,383,537 1,200,000 Same 105; 1,026B certificate

The saving is 10,192,793 instructions per update, or approximately 470,151 per signature averaged across the batch. Pages account for only 2.55% of the selected update: this improvement primarily removes curve computation. Its measured body counter is 42,865,182 instructions. Explicit update vector backing uses 83,485 bytes; this excludes other decoded values, compiler frames and allocator overhead and is not peak memory.

Query preparation is extra work. The selected query costs 62,095,772 more than filtering alone. Combining one query and one update therefore costs more total instructions than filtering followed by the ordinary update. The purpose is to move work outside replicated verification, including to an off-chain producer. The whole query request is 20,482B and reply 20,687B; the selected update request is 20,533B, including all original records, existing coordinate hints, framing and the new proof. The proof does not replace the signatures.

Parameter and implementation experiments

The final screen measured 42 cells: digit widths 8/16/32, challenge widths 128/160 and windows 2 through 8. Each cell tested both query producers and one update. Selected and primary configurations then received three fresh trials. The table gives each layout's lowest observed complete update; nonselected variants have one screen sample, not a separate three-sample qualification.

Digit / challenge bits Proof bytes Best update window Whole update instructions
8 / 128 2,052 7 47,548,950
16 / 128 1,026 7 47,015,059
32 / 128 513 6 48,794,038
8 / 160 2,052 7 55,198,424
16 / 160 1,026 6 53,534,093
32 / 160 513 7 55,752,551

The 513B variant has the cheapest observed query, 173,504,504 instructions at W7, but its update is more expensive. We selected the cheaper replicated update. The user permits proofs up to 10KiB; this campaign does not exhaust all layouts within that budget. Larger proofs are useful only if their extra terms and reconstruction work produce a measured win.

The final default uses four-column SIMD production, shared point normalization and scalar Jacobian reconstruction for the dependent Horner chain. Both bulk computations retain SIMD128 arithmetic. Compared in the final artifact at query W6, four-column production saves 8.34% of the complete query and 20.44% of its proof-production counter. Against the initial W7 reference implementation, 195,963,497 → 175,383,537 is a 10.50% whole-query reduction; its proof counter falls 82,702,051 → 62,121,561, or 24.89%. That latter comparison combines window tuning and implementation changes, rather than isolating one optimization.

Scalar Horner reconstruction saved 1,982,674 update instructions in the matched intermediate comparison, 48,997,365 → 47,014,691. Later clean builds slightly changed layout/code generation; final comparisons above use the final artifact's matched control. The previous published R13 control was 57,221,619, distinct from the final artifact's 57,207,852 control.

A streamed query producer reduced scratch but increased whole-query work to 184,421,727 against 175,388,926 for four-column SIMD in its matched artifact. Every tested streamed cell lost. Its runtime code was removed; its source commit and measurements remain experimental evidence.

Validation and measurement boundaries

The final native gates passed 153 tests across batch, canister and secp256k1 crates, plus 18 host tests. They cover independent equations, malformed and noncanonical points, identity columns, ordering/transcript changes, all supported coefficient bounds and signed-window carry boundaries. A host oracle using Noble and OpenSSL independently reconstructed every successful query proof byte; 95 query proofs were checked. Live Wasm rejected proof tampering, changed messages, changed order, a well-formed invalid signature and truncated proofs. These tests are implementation evidence, not a formal soundness proof.

Inputs are 105 distinct signers with 32-byte messages and canonical P/R hints. Five changed messages create false equations without cheap parsing failures. The update receives the exact accepted 100. An unmeasured noop precedes trials; distinct fixed-length query callers prevent query-cache replies from replacing execution. Query and update profile observers changed instructions by zero; their charge ledgers reconcile completely. Source lines resolve for 500/540 update and 554/600 query attribution points; missing source lines do not remove their instruction charges. Page detail is complete, while bounded stack-detail capture reports truncation and must not be interpreted as a complete call-stack trace. Local host times are diagnostics and are not IC network latency predictions.

Ordinary nonreplicated queries pay accessed-page charges but no extra dirty-page charges, independently confirmed by the tiny write control. The algorithm runs variable-time on public verification inputs. No randomness, allocation or IC API is ambient in the reusable certificate crate; callers provide scratch. Actual fixture bounds are query N≤105/update N≤100; no N500 certificate result is claimed.

The artifact is Wasm64 with SIMD128, source aba90cfa, Wasm SHA256 b8af80d6b67a3bf777d9b1b299edb21e9b884e80538b346a3fb2bf2d38ba3fad. All campaign comparisons use the frozen PocketIC 16.1.0 binary SHA256 6a9a75ad9b4551d2b0f4a0d954ffb8bd5bbd0ebc44ac00290679b06ad0b2f8e6. The SDK remains pinned to 33f54b62b46a6693ff6e193a752e052eaa124884. No SDK runtime or RRT code changed; Heavy16 was not rerun for this crypto-only experiment. Reproduction commands and source/artifact receipts are in the linked runner and evidence packet.