The paper tells you how to build the lock. A wallet has to answer the questions the paper never needed to ask.

A pool of 79 commitments, nine opened, four pinned

TL;DR I rebuilt PQSB, the quantum-safe Bitcoin lock that fits in a standard P2WSH output, from the paper, put it inside a fork of Sparrow Wallet, and spent from it on testnet4. At the 80-bit level the spend takes a laptop CPU a few billion tries, is 1,072 vB, and relays as a standard transaction. I also counted, independently, the one number the lock's new "pin" mechanism rests on. No code is released with this post.

1. Three days in December

On 2 December 2026 a strange transaction was spotted on mainnet: one input, a 2,205-byte witness script, 52 witness items, and ten signatures of 58 and 59 bytes, where an ordinary one takes 71 or 72. Nothing about it needed a soft fork. It was valid under the rules Bitcoin has had since 2017.

It was a quantum-safe spend. The coins were not protected by the hardness of the discrete logarithm. They were protected by hash preimages and by the cost of finding a transaction whose signatures happen to come out short.

The idea has a short and fast lineage:

Binohash Robin Linus, Feb 2026 transaction introspection by grinding signatures ↓ QSB Avihu Levy, StarkWare, Apr a quantum-safe spend built on it, bare script ↓ PQB Oren Yomtov, Fireblocks, Dec QSB made practical: rented GPUs, a few dollars ↓ PQSB Espresso Systems, Dec the same idea inside standard P2WSH 

I have been following this line since March, when I ran parameter sweeps on Binohash's subset grinding and posted them under Robin's thread on Delving Bitcoin (#3, #4). Grinding itself is older than all of this. Counterparty was grinding fake public keys in 2014, and I wrote about what that teaches us about consensus and policy here. The 2026 version grinds something more useful: a whole transaction.

This post is an engineering note. I rebuilt PQSB from the paper, put it inside a fork of Sparrow Wallet, and spent from it. No code is released with this post. What follows is what I learned and what I measured.

2. The lock on one screen

A PQSB vault is a P2WSH output. Its script carries a pool of commitments, each one HASH160 of a secret opening.

Script (1,985 bytes, 201 non-push opcodes — exactly the limit): <C_79> ... <C_1> 79 commitments, the pool [ 9 picks ] each position takes one commitment and checks HASH160(opening) against it [ 4 pins ] the first four also take a neighbour [ 9 gates ] four signature checks and one OP_SIZE <pubkey> OP_CHECKSIG an ordinary signature at the end 

To spend, the owner must show one opening per position. An opening only passes its gate if a signature derived from it and from the transaction digest comes out at an exact byte length: 59 bytes at most positions, shorter at the first.

A signature that short is rare. So the owner does what a miner does: change the transaction and try again. The nonce is nLockTime plus nSequence. Every try is a new digest, and with 79 openings to choose from, sooner or later nine of them line up.

Witness (51 items): [sig] ordinary signature for each position, last first: [tag] (pinned positions only) [T] the short signature, exact length [A] public key [opening] the secret behind one commitment [B] public key [index] which commitment to take from the pool [witness script] 

A quantum attacker who sees this spend in the mempool learns nine openings. To redirect the coins it must find another transaction where those same nine openings pass. It does not get to choose from 79. That asymmetry is the whole security argument.

3. What the pin fixes

The first SegWit version of this lock had no pins: 90 commitments, 10 positions. I rebuilt that one first, byte for byte, and spent it on testnet3.

It has a weakness the designers saw. The attacker holds ten openings, and nothing ties an opening to a position. It can try them in any order: 10! = 3,628,800 arrangements, about 22 bits handed over for free. To pay for those bits the owner has to make the lengths stricter, and the owner's work goes up.

A pin ties an opening to its place. A pinned position takes its commitment out of the pool, then takes one more: the commitment that sits a fixed number of places below it. That second one must be opened by its tag, the SHA256 of its opening, checked with OP_RIPEMD160.

commitment = RIPEMD160( SHA256( opening ) ) └──── tag ────┘ The owner knows every opening, so it knows every tag. A tag is not an opening. It cannot pass a gate. The attacker has the four tags of one spend, and no others. 

Move a different opening into a pinned position and the script asks for the tag of that opening's neighbour. The attacker does not have it.

With four of nine positions pinned, only the last five can be shuffled:

no pins, 10 positions: 10! = 3,628,800 arrangements 4 pins, 9 positions: 5! = 120 arrangements 

The attacker loses about 15 bits. The designers spend that margin on the owner's side:

level length at position 0 owner's expected tries
64-bit 58 bytes 57 thousand
72-bit 57 bytes 14.5 million
80-bit 56 bytes 3.7 billion
88-bit 55 bytes 950 billion

The other eight positions stay at 59 bytes. One byte less at position 0 is eight more bits for both sides. (Figures from the PQSB paper's formulas.)

For comparison, the lock without pins needed 2^37.89 tries at the 80-bit level. The pinned lock needs 2^31.79. Same security target, about 69 times less work.

4. I counted the 120 myself

The pin's security rests on one number: how many arrangements a spend leaves an attacker. The authors compute it with a formula and say plainly in their notes that nobody outside has reviewed it.

So I counted it a different way. I wrote a small script interpreter that executes the real witness script and lets a forger fill every witness item freely: every index, inside the pool and outside it, every opening and tag it could know. Signature checks pass whenever the operands have the right shape, which makes the forger stronger than a real one.

what was counted my count the authors' formula
the level-88 spend on mainnet, fa160ab0…57b4, from the transaction alone 120 120
300 random spends, 9 positions and 4 pins all equal, minimum 120
300 random spends, 8 positions and 6 pins all equal, minimum 2
small locks, indexes allowed outside the pool, crafted witness items nothing extra accepted

The count holds. This covers the combinatorial half of the bound only. I did not check the probability terms, and the paper's proof uses a different nonce than the one that runs on chain. The authors say both of those things themselves.

5. What a wallet has to answer

The paper's reference tool makes a lock, writes its secrets to a file, and spends it. A wallet cannot work that way. Four questions came up, and none of them is about the script.

1. Where do the keys come from?

A lock has 79 secrets. The reference draws them at random and saves a lock file. Lose the file, lose the coins.

A wallet user has a seed phrase and expects it to be enough. So the secrets have to be derived, and the backup becomes three things: seed words, vault index, security level. Nothing else.

There is a catch. The paper places the 79 secrets so that their "hit windows" never overlap, which is where part of the owner's speed comes from. Deriving them carelessly from a seed scatters them at random, the windows overlap, and the same lock costs several times more tries. The derivation has to produce the spaced layout, not just 79 numbers.

2. What happens when the same seed makes two vaults?

A spend reveals nine openings. If a 64-bit vault and an 88-bit vault from the same seed shared secrets, spending the cheap one would publish openings of the expensive one.

So the level is part of the derivation. Different level, different vault index: disjoint secrets, always.

3. A vault spends once.

After one spend, nine openings are public. The lock is finished. That changes what a wallet may offer:

ordinary wallet grind vault --------------- ----------- spend part, keep the rest spend everything, always bump the fee later (RBF) fee is fixed before grinding change returns to the wallet change must go to a NEW vault address reuse is bad practice address reuse is fatal 

The fee is the hard one. The fee is part of the transaction, the transaction is what was ground, and changing it throws the work away. The dialog says so before the user presses the button.

In my fork the spend goes whole to the next vault index. Paying an arbitrary address with change is not done yet.

4. A found nonce is not yet a spend.

The grinder reports a (locktime, sequence) pair where enough openings pass. Two more checks come after it:

solver says: found ↓ can the pins be met with these openings? no → discard, keep searching ↓ does this choice leave the attacker only 120? no → discard, keep searching ↓ run the complete witness through a script interpreter, locally ↓ hand the transaction to Sparrow's own broadcast page 

About 5% of solutions leave 240 arrangements or more. The level's bound only holds for a spend that leaves 120, so those are thrown away. Of the three searches where I counted them, one hit a discarded solution before finding a good one.

6. Does it match the reference?

I wrote the implementation from the paper and the public documentation, then checked it against the authors' reference in both directions.

  • Same secrets in, byte-identical script and address out, at all four levels.
  • Same nonce: both sides choose the same openings, and the witness is byte-identical except for the final ordinary signature.
  • My witnesses pass the authors' script model and Bitcoin Core's consensus library.
  • Tampering is refused: one satoshi less, two tags swapped, a pinned index moved.

7. What Sparrow shows

Tools → Quantum Vault in the fork. A drop-down picks the lock type, another the level. Check the balance, grind, review the transaction, broadcast.

The Quantum Vault dialog while grinding

The ground spend in Sparrow's transaction tab

After broadcast, on regtest

The grinding in the wallet is plain Java on CPU. No GPU.

8. Numbers

The table is from regtest, with a node running Bitcoin Core's default relay policy. Every spend was accepted to the mempool as a standard transaction and mined.

level found by tries
64 Python reference 39,798
72 command line 6.5 million
80 Java 6.09 billion
80 command line 3.43 billion (one solution discarded on the way)
80 command line 470 million
80 Sparrow dialog about 300 million
80 command line 160 million

Expected at 80-bit: 3.7 billion. Five samples scatter from 0.16 to 6.1 billion, which is what a geometric distribution does.

On a laptop CPU the 80-bit level is a matter of minutes, sometimes seconds. The 88-bit level was not run; by the formula it is 256 times the work.

Each spend:

witness script 1,985 bytes non-push opcodes 201 (the consensus limit is 201) witness items 51 (each at most 80 bytes: standard) size 1,073 vB to a P2WSH vault 1,060 vB to a P2WPKH address (authors' figure) 

On a public network, testnet4, both confirmed in block 164,837: deposit b54a2eef…54fb (60,000 sats into an 80-bit vault) and the spend, broadcast from the Sparrow fork, b0bb2eb3…74d7: vault 0 to vault 1, weight 4,287 (1,072 vB), 51 witness items, about 2.2 billion tries.

The testnet4 spend in Sparrow

Broadcasting on testnet4

9. A correction to my own number

On 4 December I posted a measurement of the older lock, the one without pins: 731 billion tries for the mainnet parameters, with an estimated mean of 1.3 to 1.6 trillion.

The measurement stands. The estimate needs a qualifier. My secrets for that lock were scattered, not spaced, and that alone costs about 6.5 times more tries. With the paper's spacing the same lock needs about 250 billion.

So the gap between "what I measured last week" and "the pinned lock at the same 80-bit level" is about 400 times, and it has two causes: pins, about 69 times, and spacing the secrets, about 6.5 times.

10. PQB and PQSB, side by side

I also ran Fireblocks' PQB on testnet4 with its own tooling, to see the other branch from the inside.

PQB PQSB, 80-bit PQSB, 88-bit
where the script lives bare output script P2WSH P2WSH
relayed by ordinary nodes no, goes to a miner directly yes yes
funding needs the tool, the script is in the output any wallet can pay a P2WSH address same
owner's work three puzzles of about 2^46 each 2^31.79 2^39.79
what that means a fleet of rented GPUs for some minutes a laptop CPU one good GPU, or a long wait
script visible from funding only at spend only at spend

My PQB run used about 70 rented cards for 27 minutes and cost 4.84 USD. It got as far as a spend that verifies locally and was handed to a miner. That spend is not on a public testnet4 explorer as I write this, so I give no txid for it.

They solve different problems. PQB reaches higher security levels and pays for it with a non-standard transaction and outsourced work. PQSB at 80 bits is something a wallet can do by itself, on the user's machine, with a transaction every node relays. That is why PQSB is the one I put in a wallet.

11. What this is not

  • Not audited. Not my code, not the scheme.
  • Not on mainnet. The dialog is disabled there.
  • One spend per vault, fee fixed in advance, as above.
  • The margin is thin by design. An 80-bit level protects the ten minutes between broadcast and confirmation. Unspent coins rest on 160-bit hashes. The authors give their own guidance on how much one address should hold at each level.
  • The pin bound has no third-party review beyond the count above, and the paper's proof models a different nonce than nLockTime + nSequence. The authors state both.
  • Seed-derived secrets are my design, not the paper's. Nobody has reviewed that either.
  • No code is released with this post.

12. Closing

A soft fork for post-quantum signatures is the right long-term answer and it is years away. Meanwhile the rules we already have turned out to be enough for a lock that a quantum computer cannot pick, built from hashes, short signatures and a few minutes of grinding.

The script is the easy part. The paper gives it to you.
The wallet is where it becomes something a person can hold.

References

  • Binohash: Robin Linus, Delving Bitcoin thread
  • QSB: Avihu Mordechai Levy, StarkWare
  • PQB: Oren Yomtov, Fireblocks, github.com/fireblocks-labs/pqb
  • PQSB: Espresso Systems, Practical Quantum Safe Bitcoin, github.com/EspressoSystems/PQSB
  • The first SegWit spend of this kind was noticed by mononaut; Ben Sigman's GrindCore first put the idea in a wallet.
  • Sparrow Wallet: Craig Raw. The fork described here is unofficial.