PQGrind Docs

The lock

The lock is the PQSB-segwit construction with pins from Espresso Systems' paper [P4 §6]. This experiment uses it unchanged.

Parameters

Level β (bits) Commitments N Positions h Pinned c Short-signature limits D_ℓ (bytes) Script Owner's expected trials Source
80.09 79 9 4 56, then 59 × 8 1,985 B 2^31.79 [P4 Table 1]
88.09 79 9 4 55, then 59 × 8 1,985 B 2^39.79 [P4 Table 1]

Paper timing model (same table): 80-bit ≈ 0.9 s on an RTX 5090, ≈ 72 s on an Apple M3; 88-bit ≈ 3.9 min and ≈ 5.1 h. These are the paper's model figures, not measurements of this experiment.

What the script does

Reading top to bottom (exact bytes: Byte layouts):

  1. Push 79 commitments — 20-byte HASH160 values of signatures the owner made in advance (the openings).
  2. For each of 9 positions, select one commitment by an index the spender supplies and check that the supplied opening hashes to it. The first 4 positions also check a 32-byte pin tag equal to SHA256 of a neighbouring opening.
  3. Drop the 66 unused commitments.
  4. For each position, run four signature checks around an OP_CODESEPARATOR and require the short signature T to be exactly D_ℓ bytes.
  5. Check the owner's ordinary signature against a 33-byte key.

The script counts 201 opcodes toward the per-script limit of 201.

Each position's checks tie a fixed secret (from the opening) to a value d derived from the spending transaction's own signature digests. The relation holds only when d falls in a narrow window, which happens with probability p = 4L/q per trial [P4 §5.2]. The spender varies a nonce — in practice transaction sequence and locktime — recomputes the digests, and tests again. With pins and the layout above, the owner needs on average 2^31.79 trials at the 80-bit level [P4 §6.4].

Bitcoin nodes execute the script. A transaction whose witness does not satisfy it is invalid and never confirms. This is the first layer of work, see Two layers of work.

Properties that matter to minters

Property Consequence
One-time Spending reveals 9 openings. A second spend of the same lock is much easier to forge. Never reuse a lock; never send funds to a spent lock's address.
Fee fixed before search Any change to the transaction, including its fee, invalidates the found solution. Pick the fee rate first.
No replacement Bumping fees means searching again with a new lock.
Size ≈ 1,060 vB per spend [P4 §8.2]; with the claim and a change output ≈ 1,110–1,115 vB (regtest).
Security ≈ 150 bits at rest; β bits while in flight; ≈ 2^{β/2} under Grover [P4 §8.3].

Status of tools

  • Creating a lock (making 79 openings and their script): not yet available in public form.
  • Searching for a nonce: not yet available in public form.