Receipts with a post-quantum signature, checked on Stellar
Every Nirium receipt can carry an ed25519 signature: the key of whoever declares it. A receipt has to stay checkable for years, for an audit, a dispute or a correction long after the payment. A large enough quantum computer could forge ed25519 signatures. Nobody can do that today. The point is that a record signed today should still hold up when someone checks it later.
Since nirium 0.23.0 a receipt can carry a second signature next to the first: ML-DSA-65, the post-quantum signature NIST standardized as FIPS 204. Both sign the same text, nirium-audit-v1:<content_sha256>. The Audit Trail node checks both before it anchors, on testnet and mainnet.
On Stellar, Protocol 30 (CAP-87) added ML-DSA verification to Soroban, so a contract can check that signature on chain. We deployed a small contract that does exactly that and used it on mainnet on 4 Dec 2026. What gets protected is the receipt, not the payment; more on that under Limits.
How it works
1. Register the key once
Generate an ML-DSA-65 key pair and register its sha-256 on your own Stellar account, with manage_data nirium-pq-v1. That ties the key to the account, with a ledger date.
2. Sign twice and anchor
Sign the receipt's statement with your Stellar key and with the ML-DSA key. The node rejects the anchor if either signature is wrong, and also rejects a post-quantum signature that comes without the ed25519 one.
3. Check it
With npx nirium-cli verify --require-pq, the verify-audit-cid GitHub Action, the pq-receipt-check contract on Stellar, or nirium.xyz/verify, which checks the post-quantum signature in your browser. The CLI, the Action and the contract need nothing from Nirium: they recompute everything from the receipt and the ledger.
Why only the first key counts
A second signature only helps if a forger can't add their own. Someone able to forge ed25519 could also sign a manage_data on your account and register a key of their own. So the verifiers accept only the first nirium-pq-v1 key the account ever registered, and only if it was registered before the receipt was anchored. A later, different key is reported as not the account's key, and --require-pq fails.
That makes the key you register first the one that matters. Keep its secret safe: there is no rule yet for replacing a lost key (see Limits).
In code
With nirium 0.23.0, on testnet:
import { Agent, pqKeygen, pqKeyRegistrationOperation } from "nirium"; // 0.23.0+
import { Keypair, Horizon, TransactionBuilder, Networks } from "@stellar/stellar-sdk";
const signer = Keypair.fromSecret(process.env.STELLAR_SECRET!); // your own Stellar key
const pq = pqKeygen(); // keep pq.secretKey safe: only the first key you register counts
// 1. Once: register the post-quantum key on your own account (testnet here)
const horizon = new Horizon.Server("https://horizon-testnet.stellar.org");
const account = await horizon.loadAccount(signer.publicKey());
const tx = new TransactionBuilder(account, { fee: "1000", networkPassphrase: Networks.TESTNET })
.addOperation(pqKeyRegistrationOperation(pq.publicKey)) // manage_data nirium-pq-v1 = sha-256 of the key
.setTimeout(120).build();
tx.sign(signer);
await horizon.submitTransaction(tx);
// 2. Every receipt: two signatures over the same hash
const agent = new Agent({ apiKey: process.env.NIRIUM_API_KEY!, baseUrl: "https://nirium-agent.fly.dev" });
const receipt = await agent.anchorAuditRecord({
record: { order: "po-1042", amount: "12.50", asset: "USDC" },
signer, // ed25519
pqSigner: pq, // ML-DSA-65
});
console.log(receipt.cid, receipt.pqAttested); // pqAttested: trueChecked on mainnet
On 4 Dec 2026 we registered a key on one of our own accounts and anchored a receipt with both signatures on mainnet, as a self-test with no payment. The published CLI checks it from the receipt and the ledger:
$ npx nirium-cli@4.1.0 verify QmS3gaAiADPXit864n38qy2sBQpW1NmSuARxQvg6X4jEtf \
--require-pq --horizon https://horizon.stellar.org
...
✔ SIGNATURE: VALID (Signed by GAT2WJKATIGTDV3CKQKBIJLTORRF6PXQ5663BEIY3SXLR22TKN2YVAFW)
✔ PQ SIGNATURE: VALID (ML-DSA-65, NIST FIPS 204, same statement)
✔ PQ KEY: REGISTERED by GAT2WJKATIGTDV3CKQKBIJLTORRF6PXQ5663BEIY3SXLR22TKN2YVAFW on 2026-12-04T21:14:59Z, before the anchor (tx 9b12de61097195dba65032ce89b3496c7e45d1d6b72e94123525fe535111e86d)
✅ VERIFICATION PASSEDThen the pq-receipt-check contract on Stellar mainnet checked the same signature on chain. It returns the sha-256 of the key, which is the value the account registered:
$ stellar contract invoke --id CCQQ2G3Q4SAJ5QSC3Z754HGGGQ72F6T5T27IILN3VES3WTATN2HRTFVX \
--rpc-url https://mainnet.sorobanrpc.com \
--network-passphrase "Public Global Stellar Network ; September 2015" \
--send=yes -- verify_receipt \
--public_key <the receipt's pq.key, hex> \
--content_sha256 f66f7b1dcc6db32421ac05d0373cc4b9eef169623add4309f62fcacd0bfa376e \
--signature <the receipt's pq.signature, hex>
✅ Transaction submitted successfully!
🔗 https://stellar.expert/explorer/public/tx/3b9b32c6a63a1c799074c8885ba1d6ed810d96b9f16909a369e8f4e35139e413
"67b0250704a5f9127f2aa9724eecff3b9ff93dd7915db3210a249542fc9a14b1"The contract has no admin and stores nothing: it builds the statement from the hash and calls the ML-DSA host function. A bad signature makes the call fail. That check cost 14,150 stroops in fees.
Limits
It protects the receipt, not the payment
Payments are still signed with the wallet's usual key. The second signature protects the record: what the payment was for, what the policy decided and who declared it.
Wallets can't sign with ML-DSA yet
Stellar accounts and wallets still sign with ed25519. The post-quantum key lives with whoever signs receipts, usually a backend or an agent, not in a wallet.
On chain, only on Stellar today
Of the chains Nirium runs on, Stellar is the only one where a contract can verify ML-DSA today. Receipts on Solana, Avalanche, Base and Arbitrum don't carry this signature yet.
A lost key
Only the first registered key counts, and there is no rule yet for replacing a lost one. Until there is, keep its secret as carefully as the account's own key.
Try it
Install nirium 0.23.0 and nirium-cli 4.1.0, register a key on a testnet account and anchor a receipt with pqSigner. Then open its CID on nirium.xyz/verify, or run npx nirium-cli verify <CID> --require-pq.
Signing and anchoring with a post-quantum signature: testnet and mainnet. Checking it: the CLI, /verify, the GitHub Action and the pq-receipt-check contract on Stellar mainnet. Everything shown here is our own test; no third party uses it yet.