Written 2026-09-06. Sections 7, 9, 11 and 12 re-verified line by line against commit
9220195, 2026-09-07. Section 9 was rewritten 2026-11-09 to cover only what the code
promises about the public material that reaches a genesis. Sections 1–6, 8 and 10 carry their original 2026-09-06 citations and were not re-walked
in that pass; where one of them is stale the function name beside it is still the anchor.
Section 14 was written 2026-10-30 and covers GodCypher timestamps: the Urdarbrunn
counter-validator over each timestamp, and the raw evidence sealed by GodCypherPQProvider, which
that change took from a library to a running path. §6.2 and §12 carry an amendment saying so.
Section 13 was written 2026-09-10 and covers Accretion and Occultation, the two ciphers that landed with hostless spaces and STR.talk. It is appended rather than inserted so that every section number an older copy of this document carries still means what it meant; its entries are also written into §12's three lists in place, because §12 is meant to be read alone. Sections 1–12 were not re-walked in that pass.
This is the reference for everything under src/crypto/, plus src/node/keystore.ts, which
holds the keys the rest of it uses. It is written for two readers who need opposite things
from it:
- A reviewer deciding whether to trust this with value. You need to know which properties are enforced by running code, which are correct code that nothing calls, and which are sentences. Section 12 is those three lists, and it is written to be read alone.
- An engineer who must not weaken this by accident. You need to know why each check is where it is, because a check whose reason has been forgotten is a check that gets removed in a routine cleanup. Every non-obvious control below names the failure it exists for.
How to read the citations#
file.ts:line is a line in this tree. Line numbers move; the function names beside them do
not, so if a number is stale the name is the anchor. npm run citations
(scripts/check-citations.mjs) re-reads every citation written in the form
`Symbol` (`src/path.ts:NNN`) and fails the build when one no longer lands on its symbol,
which is why that form is preferred here over a bare path. Where an existing document carries a
line citation that has already gone stale, section 11 names it rather than quietly repeating it.
How the numbers in this document were obtained#
Every figure is one of three kinds, and the kind is always stated:
- Measured here — run on this tree on 2026-09-06 on the machine below. Reproducible.
- Measured in-source — a figure recorded in a code comment by whoever made the change. Attributed to its line. The machine it was taken on is not recorded, which matters for the ratios in §2.6.
- Unmeasured — said so, in those words. Not estimated.
Measurement host: Windows 11, Node v22.14.0, Intel Core i9-14900KF, 32 logical CPUs. A number from this host belongs in a sentence that begins "on this machine, one process".
1. Addresses and signing — src/crypto/signing.ts#
1.1 The format#
zk13str_<40 hex>_<4 hex>Assembled in exactly one place, formatAddress at signing.ts:63, which is the reason the
format has no second spelling anywhere in the tree. The constants are
signing.ts:20-23: prefix zk13str_, body 40 hex characters, checksum 4, total length 53,
computed rather than written down.
Derivation, deriveAddress at signing.ts:56:
body = sha256(raw 32-byte ed25519 public key)[0..20] // 160 bits, hexThe digest is taken over the raw key bytes, not over a DER or PEM encoding
(signing.ts:58). That is why nothing in the chain data model depends on an OpenSSL encoding
detail: keys travel as 64 hex characters and are wrapped into DER on demand at
signing.ts:154 and signing.ts:163.
1.2 What the checksum is for, and what it is not#
addressChecksum at signing.ts:69:
sha256(`zk13str-checksum:${body}`).slice(0, 4) // 16 bitsIt is a typo guard. It is never integrity. The function is unkeyed, deterministic and public, so anyone can compute the correct checksum for any body they like. An attacker who wants you to pay a wrong address computes its checksum in one line. What the checksum stops is a human error: a transposed character, a dropped digit, a truncated paste. Sixteen bits means a random corruption survives with probability 2^-16, about 1 in 65,536.
isValidAddress at signing.ts:73 returns true for any well-formed, correctly-checksummed
string. It does not assert that a public key exists which derives that address, that anyone
holds the corresponding secret, or that the address has ever been seen on chain. It is a
syntax check with a spelling correction on the end. Treating it as anything more is the way a
recipient field gets trusted.
1.3 The honest security margin of a 160-bit body#
The body is a 160-bit truncation of SHA-256.
- Second preimage — finding a different public key that derives your address — is 2^160 work. That is the property that matters for "can somebody else claim my address", and it is not close to reachable.
- Collision — finding any two public keys that derive the same address — is 2^80 work by the birthday bound. 2^80 is the number that deserves a sentence rather than a shrug: it is above what is publicly known to have been done, and it is not a comfortable margin by 2026 standards for a value that lives forever. It is the same order as the margin that retired 160-bit hashes elsewhere in the industry.
Whether 2^80 is exploitable here depends on whether a collision buys anything. On this chain
an address is bound to its key by deriveAddress at every spend: validateTransactionStateless
recomputes it at src/core/transaction.ts:118-122 and refuses a mismatch, and signTransaction
refuses to sign one at signTransaction transaction.ts:223. So a colliding pair would let one party hold two
keys for one address, which is a griefing and repudiation shape, not a theft-from-a-third-party
shape. The exact exploitability of a 160-bit collision against this chain's flows is
unmeasured. It has not been analysed against Ghost Ledger admission, the wNFT holder binding
or the governance roll, and it should be before this is trusted with material value.
The Gemini address (§2.3) is the same 160 bits.
1.4 Signing and verifying#
signMessage (signing.ts:466) and verifyMessage (signing.ts:471) are thin over
node:crypto ed25519 — OpenSSL, not a JavaScript implementation. verifyMessage gates shape
before it gates cryptography:
if (!/^[0-9a-f]{128}$/.test(signatureHex)) return false; // signing.ts:94
if (!/^[0-9a-f]{64}$/.test(publicKeyHex)) return false; // signing.ts:95and wraps the verify in try/catch returning false (signing.ts:103). Both matter because
this function is reached from the network: a throw on hostile input is a node that stops, and
an unbounded hex string is an allocation an attacker chooses the size of.
1.5 The key object caches, and the lifetime they cost#
signing.ts:108-147. Building a KeyObject costs more than using it.
Measured in-source, before the caches existed (signing.ts:111-116):
| Operation | Cost |
|---|---|
createPrivateKey | 275 µs |
| ed25519 sign | 24.7 µs |
createPublicKey | 53 µs |
| ed25519 verify | 70 µs |
So 92% of the cost of signing was rebuilding a key object from the same hex string. Both maps are pure — same hex, same object — so nothing about correctness depends on whether a lookup hits.
Both maps are bounded, and the public one is the reason. Public keys arrive from peers;
every transaction names one. An unbounded map is a memory an attacker fills for the price of
generating keypairs. Both are least-recently-used (BoundedLruCache, src/crypto/key-cache.ts):
the public map, in signing.ts and in every verify lane, holds 8,192 keys and the private map
1,024. Eviction costs a rebuild, never a wrong answer.
They held 1,024 each and evicted the oldest INSERTED key first until the 2026-11-12 ecosystem
audit (CRYPTO-02): with 1,313 seats a block's attestations walked more keys than the cache held,
and a key in constant use was rebuilt for being old. Measured on the build host with
scripts/cpu-defences-bench.mjs: about 76 µs a verify with 1,000 keys in rotation before and
after, 205 µs with 3,000 keys before and 94 µs after, 192 µs with 5,000 before and 98 µs after.
The cost, stated in the source rather than discovered in review (signing.ts:126-131): a
cached private key object holds key material for longer than a per-call object did.
forgetCachedKeys (signing.ts:569) shortens that window for a caller that has just rotated;
it does not end it, because the caller still holds the hex it passed in.
1.6 Deterministic keys from a seed#
deriveAccountKeypairFromSeed (signing.ts:261) is sha256("strzk13-seed:" + seed) used
directly as the ed25519 private key. There is no KDF, no salt and no stretching, deliberately:
it exists for reproducible genesis allocations and test vectors, where determinism is the
point.
Every key it produces from a public seed string is public. The seeds in this tree are
public constants — sourceless-genesis-node-${index} at src/core/genesis-nodes.ts:100,
producer:${...} at src/core/blockchain.ts:1263, demo:alice at src/cli/strblk.ts:699.
genesis-nodes.ts:98 says so: "Production replaces these with custody keys."
The producer fallback is the one that already bit. blockchain.ts:1247-1260 records the
failure: a production node that reached the fallback signed with a key anyone can derive,
produceBlock then refused every attempt because the derived address is not in the validator
set, and startProducing swallowed the throw — so the node reported height 0, produced 0,
needsAttention false. Structurally incapable of sealing, and describing itself as healthy. The
refusal now lives at seal time (blockchain.ts:1258), because a production node that only
follows is ordinary and has no business holding a producer key.
2. Aegis and Gemini — src/crypto/aegis.ts#
Aegis is the post-quantum layer; Gemini is the hybrid identity and signature.
Both names are in the registry at docs/NAMING.md:105-106.
2.1 The primitives#
aegis.ts:39-56.
| Constant | Value | Note |
|---|---|---|
PQ_SIGNATURE_SUITE | ml-dsa-65 | FIPS 204, NIST category 3 |
PQ_KEM_SUITE | ml-kem-768 | FIPS 203, category 3 |
GEMINI_SUITE | ed25519+ml-dsa-65 | matched exactly, never parsed |
ML_DSA65_SIGNATURE_BYTES | 3309 | |
ML_DSA65_PUBLIC_KEY_BYTES | 1952 | |
ML_DSA65_SECRET_KEY_BYTES | 4032 | |
ML_KEM768_PUBLIC_KEY_BYTES | 1184 | |
ML_KEM768_CIPHERTEXT_BYTES | 1088 | |
ML_KEM768_SECRET_KEY_BYTES | 2400 |
The sizes were measured against @noble/post-quantum, not copied (aegis.ts:44-48), and
the comment names why: the pq-crystals page still publishes the round-3 figures (3293 / 4595),
FIPS 204 as published is 3309 / 4627, and anything pinned to the old number rejects every valid
signature. pq-hardening.integration.test.ts:169 pins the FIPS 204 length against exactly that
mistake.
2.2 The composite representative#
aegis.ts:184-208. Both halves sign the same bytes:
M' = "CompositeAlgorithmSignatures2025" ‖ "COMPSIG-MLDSA65-Ed25519-SHA512"
‖ len(ctx) ‖ ctx ‖ SHA-512(M)This is modelled on draft-ietf-lamps-pq-composite-sigs, whose label and OID for this pair are
MLDSA65-Ed25519-SHA512 and 1.3.6.1.5.5.7.6.48 (aegis.ts:194-196). Both are recorded for
reference only. The wire carries the house suite string GEMINI_SUITE, the draft is not yet a
standard, and the bytes are not the draft's: the ed25519 half signs the hex text of M', and ctx is
the Aegis surface label. Corrected 2026-11-16: this read "the wire identity is a standard one, not a
house string". pq-hardening.integration.test.ts:111 asserts the constant, not interoperability.
Why not sign the raw message with each half independently. That construction is weakly non-separable: either half can be lifted out of the pair and replayed on its own as a standalone signature over the same message somewhere else, and neither half commits to the other's key. Signing a common representative that carries the label and the context is what binds the two halves into one object.
The context length is written as a single byte at aegis.ts:204, and FIPS 204 caps a context
at 255 bytes, checked at contextBytes aegis.ts:127. Every label in AEGIS_CONTEXTS is far inside that, so
the byte-length prefix cannot truncate.
2.3 The hybrid address commits to both keys#
deriveGeminiAddress (aegis.ts:176):
sha256("ed25519+ml-dsa-65" ‖ "|" ‖ ed25519PubHex ‖ "|" ‖ mlDsaPubHex)[0..20]Both inputs are asserted to their exact lengths first (aegis.ts:157-158), so the |
delimiters cannot be shifted: the preimage is unambiguous. The output goes through
formatAddress, so a Gemini address is the same zk13str_ shape as a classical one.
An address does not say whether it is hybrid. Two consequences worth stating:
- A classical address and a Gemini address are indistinguishable by format. Nothing in the address tells a reader which key material stands behind it.
- The preimages are disjoint by construction —
deriveAddresshashes 32 raw key bytes,deriveGeminiAddresshashes a UTF-8 string beginning with the suite name — so a classical and a hybrid address cannot collide except by the 2^80 chance of §1.3.
pq-hardening.integration.test.ts:148 pins that the address commits to both halves.
2.4 verifyGemini is a true AND — line by line#
aegis.ts:236-273. Six gates, in order, every one of which returns false rather than
throwing:
if (signature.suite !== GEMINI_SUITE) return false; // :244
if (signature.surface !== expectedSurface) return false; // :245
if (identity.address !== undefined) { // :249
derived = deriveGeminiAddress(identity.publicKeyHex, identity.pqPublicKeyHex);
if (derived !== identity.address) return false; // :256
}
if (!verifyMessage(toHex(representative), signature.signatureHex, identity.publicKeyHex))
return false; // :260
if (!isHex(signature.pqSignatureHex, ML_DSA65_SIGNATURE_BYTES)) return false; // :261
if (!isHex(identity.pqPublicKeyHex, ML_DSA65_PUBLIC_KEY_BYTES)) return false; // :262
return ml_dsa65.verify(..., { context: contextBytes(expectedSurface) }); // :264- Exact suite match, no fallback (
:244). Reducing a hybrid scheme to its weaker half by negotiation is the usual way a hybrid scheme fails, so there is no parse, no prefix match, no version range. An unknown suite is rejected, never downgraded to.pq-hardening.integration.test.ts:116pins it. - Surface must match what the caller expected (
:245). The surface is a field on the signature, so it is attacker-controlled; it is checked against what the verifier asked for, never read to decide what to check.pq-hardening.integration.test.ts:85pins that rewriting the field is a rejection. - Address binding, when an address is supplied (
:249-257). The comment at:247-248is the whole point: "Verifying against a caller-supplied key pair alone proves a signature, not an identity." Both production verifiers pass an address —praeco.ts:225passesidentityOf(record)(built atidentityOfpraeco.ts:330, carriesaddress), andbifrost.ts:223,336pass aNodeIdentity, which carriesaddress(bifrost.ts:401). So on the live paths this branch is taken, not skipped. - Classical half (
:260), over the composite representative. - Exact lengths before the PQ verify (
:261-262). Not "some hex": this runs on unauthenticated peer input, and without a length bound a 10 MB "signature" is a free allocation on every node that looks at it.pq-hardening.integration.test.ts:159pins that an oversized signature is refused without being handed to the verifier. - Post-quantum half (
:264-269), in atry/catchreturningfalse(:271).
There is no branch in which one half passing substitutes for the other. aegis.ts:235 states
it as the contract: "Both signatures must verify. A single valid half is a failure, not a
partial pass." pq-hardening.integration.test.ts:96 asserts a valid classical half with a
forged PQ half fails, and the reverse.
2.5 What each half protects against#
| Half | The adversary it survives | The adversary it does not |
|---|---|---|
| ed25519 | A break in ML-DSA-65 — a young lattice scheme with a short cryptanalytic history — or a bug in this particular unaudited JavaScript implementation of it. | A cryptographically relevant quantum computer. Shor's algorithm recovers the private key from the public one. |
| ML-DSA-65 | A quantum adversary, and any future break of elliptic-curve discrete log. | A break of ML-DSA, or a fault or side-channel attack on this implementation. |
The pairing is what makes each half's failure survivable, and it is the only mitigation this
repository claims for the second row of §2.7's known limitation. docs/SECURITY.md:263-265
says the same thing in the same words.
One consequence of hedged signing, stated at aegis.ts:211-218: ML-DSA signing is
randomized (FIPS 204 hedged mode, kept as the default because deterministic signing is
materially more exposed to fault attacks). Two calls over the same message produce different
bytes. For a chain that means a signature hash is never a valid transaction id or dedup key,
and a replay test must compare verify() results, never signature bytes.
2.6 The measured cost, and the conflict in the record#
Measured here, 2026-09-06, three runs, warm caches, 200-byte message:
| verifications/second | ||
|---|---|---|
verifyMessage (ed25519, cached key object) | 14,520 – 14,970 | median ~14,800 |
verifyGemini (ed25519 + ML-DSA-65) | 906 – 914 | median ~910 |
| Ratio | ~16× |
Measured in-source, aegis.ts:518-527, machine not recorded: hybrid ~801/s against ed25519
~8595/s, a ratio of ~10.7×.
A third record was added 2026-09-10 and is in §2.7: validateTransactionStateless on a
classical transaction measured 12,798–13,432/s (median ~13,379) against a Gemini transaction at
881–890/s (median ~887), a ratio of ~15×, on the host named at the top of this document.
That is a whole-validation figure rather than a bare verifyGemini one, so it is not directly
comparable to either row above — it is recorded here because it is a third data point on the
same disagreement, not because it resolves it.
These records disagree and the disagreement is named rather than averaged. Both figures
are plausible on their own hardware: ed25519 runs through OpenSSL and scales with the host's
CPU, while ML-DSA-65 is pure JavaScript in @noble/post-quantum and scales with V8, so the
ratio is a property of the machine, not of the algorithms. The absolute PQ figure is stable
across all three records (801, 887, 910/s); the ed25519 figure is not (8595, ~13,379,
14,800/s), which is where the whole difference lives.
What both records agree on, and what the decision actually rests on: hybrid verification is
roughly an order of magnitude slower than ed25519, on every machine measured. Anyone quoting
a single multiplier at an auditor should quote the machine with it. Per the standing rule, the
conflict between aegis.ts:521 and the measurement above is recorded here for governance to
settle — it is not silently resolved by picking one.
2.7 Transactions: hybrid is opt-in per account, and the block-size arithmetic is why#
Implemented 2026-09-10. This section previously ended "is not implemented" and named
the two functions that had no slot for it. They have one now. What has not changed is the cost
argument, which is why the policy is optional and not required, and the arithmetic below is
still what the decision rests on.
What was built#
ChainTransaction (spec/interfaces.ts) carries three optional fields — pqSuite,
pqPublicKeyHex, pqSignatureHex — and transactionSigningPayload
(src/core/transaction.ts) folds the first two into the signed payload only when the
transaction declares them. A transaction with no post-quantum material produces the same
bytes it produced before the fields existed, which is what leaves every historical transaction
and every historical block valid. Verified three ways rather than asserted: the payload is
pinned against a literal captured before the change
(tests/integration/gemini-transactions.integration.test.ts), the committed conformance
vectors still reproduce (tests/integration/conformance-vectors.integration.test.ts), and
strblk genesis --identity still prints genesisHash 8ee28b94…, genesisStateRoot a6bf0085…,
genesisBlockHash abaa1b65….
signGeminiTransaction calls signGemini on the transaction surface, so the bytes each half
signs are the composite representative of draft-ietf-lamps-pq-composite-sigs —
MLDSA65-Ed25519-SHA512, OID 1.3.6.1.5.5.7.6.48 — with sourceless:aegis:tx:v1 bound in.
It is not a second scheme; it is §2.4's scheme with a message it did not previously have.
The property that makes the post-quantum half worth carrying#
pqPublicKeyHex travels on the wire, so on its own it is attacker-chosen: a quantum
adversary who recovers the ed25519 private key from the public one would attach a lattice
keypair of their own, and both halves would verify against the keys as declared. What stops
that is the address. A Gemini sender's from is deriveGeminiAddress(publicKeyHex,
pqPublicKeyHex) (§2.3), which commits to both keys, so a substituted post-quantum key produces
a different address and the transaction is refused.
The consequence is a design decision and is stated as one: being post-quantum is a property
of the account, not of the transaction. A Gemini address cannot emit a classical transaction —
its from does not derive from the ed25519 key alone — and a classical address carrying the
three fields is refused, not accepted-and-ignored, because an adversary who had broken
ed25519 could simply delete them and re-sign. Per-transaction opt-in on a classical address
would advertise a protection that lasts exactly until it is attacked.
The measured cost#
Measured here, 2026-09-10, canonical serialisation via canonicalStringify, every figure
pinned by a test:
| bytes | |
|---|---|
| A signed transfer, minimal fields | 486 |
A signed transfer with tokenType, purpose, payloadHashHex | 609 |
Gemini overhead: pqSuite, pqPublicKeyHex, pqSignatureHex | 10,592 |
| The same minimal transfer, Gemini | 11,078 |
| The same fuller transfer, Gemini | 11,201 |
10,592 is exact and not a mystery: 6,618 characters of signature hex + 3,904 of public key hex
- 70 characters of JSON field names, quotes, colons and commas. It is 19 bytes below the
10,611 this section estimated in the previous cycle, because the shape that was costed carried
a surface field and the implemented one does not — the surface is fixed at transaction on
both sides, so there is no field on the wire for an attacker to relabel.
Against the block bounds at MAX_BLOCK_BYTES (src/core/blockchain.ts:1225) and
BLOCK_ENVELOPE_HEADROOM_BYTES (blockchain.ts:1708), leaving the 383,616-byte record budget
that produceBlock actually spends:
| ed25519 | Gemini | |
|---|---|---|
| Transactions per block, against the 400 KB ceiling | 823 / 656 | 36 / 35 |
| Transactions per block, against the 383,616-byte record budget | 789 / 629 | 34 / 34 |
(Two figures per cell: minimal transaction, then the fuller one.)
789 → 34 is 23.2×; 629 → 34 is 18.5×. Quoted as a range rather than a single multiplier because it depends on the shape of the classical transaction being compared against, and a single number is what gets quoted without its shape. The "714 → 35" figure carried into earlier cycles sits inside this range.
Verification cost, measured here, 2026-09-10 on the host named at the top of this document,
three runs of validateTransactionStateless in a warm process:
| validations/second | ||
|---|---|---|
| Classical transaction | 12,798 – 13,432 | median ~13,379 |
| Gemini transaction | 881 – 890 | median ~887 |
| Ratio | ~15× |
This is a whole-validation figure (shape, id binding, address derivation and signature) rather
than the bare verifyGemini figure in §2.6, and it does not settle the conflict recorded
there. The disagreement between aegis.ts and §2.6 lives in the ed25519 number, which is a
property of the host; the post-quantum number is stable across all three records (801, 887,
910/s). That conflict is still standing for governance.
The policy, and why optional#
AEGIS_POLICY_LAUNCH.hybridSignatures.transaction is optional, and as of this change it is
read on a production path — validateTransactionStateless calls aegisAdmits
(src/crypto/aegis.ts), which is the first enforcement point any AegisPolicy entry has ever
had. The three values mean:
| value | a transaction with no PQ material | a transaction with PQ material |
|---|---|---|
optional (what this chain runs) | accepted, ordinary ed25519 | accepted only if both halves verify |
required | refused | accepted only if both halves verify |
forbidden | accepted | refused |
Under all three, a transaction carrying some of the three fields is refused as incomplete.
There is no configuration in which a partial composite is read as "classical" — that is the
downgrade, and PqPresence exists as a three-valued type specifically so no caller can reach
it by accident.
optional rather than required because mandatory hybrid cuts block capacity by 18–23×,
and a chain should be capped by a design decision rather than by a signature size nobody chose.
optional costs the account that wants post-quantum protection its own block space and costs
everyone else nothing.
required is a hard fork, not a configuration, and this is worth saying plainly because
AegisPolicy reads like a switch. A node running required refuses blocks containing classical
transactions, so it splits from a node running optional with no error message anywhere —
the failure shape compareBytes (src/core/canonical.ts:21) describes. There is nowhere
chain-wide to put the value either: it would have to be a genesis field, and adding one changes
the genesis hash and therefore the identity of every existing network. The override on
StatelessOptions.pqPolicy exists for tests and for a network that adopts required at its own
genesis.
The identity half, which used to be the thing that was not reachable#
This section read: a Gemini account cannot obtain a STR.domain after genesis, and the entry rule means no domain, no transaction. That was true when it was written and is no longer.
verifyDomainProof (src/identity/str-domain.ts:706) required
deriveAddress(proof.publicKeyHex) === proof.walletAddress, and a Gemini address derives from
both keys — so a Gemini account worked if it was allocated at genesis and not otherwise.
domainClaimPayload, domainProofPayload and their two verifiers now take the same
absent-when-absent treatment ChainTransaction took, under a surface of their own
(AEGIS_CONTEXTS.strDomain, sourceless:aegis:str-domain:v1) and a policy entry of their own
(GEMINI_IDENTITY_POLICY, optional). claimGeminiDomain and proveGeminiDomain are the two
signers. A person can create a post-quantum account on a running chain, book a name, prove it
and transact — walked end to end from an address no genesis mentions in
tests/integration/gemini-identity.integration.test.ts, which funds it, seals each record into a
block, has a follower accept every block and replays the chain.
The extra bytes are the same composite and therefore the same 10,592, measured for the name
STR.measure — the classical column moves with the length of a name and the overhead does not:
| record | ed25519 | Gemini | per block, against the 383,616-byte record budget |
|---|---|---|---|
| Domain claim | 354 | 10,946 | 1,083 → 35 (30.9× fewer) |
| Domain proof | 461 | 11,053 | 832 → 34 (24.5× fewer) |
| Onboarding one identity (claim + proof) | 815 | 21,999 | — |
The difference from the transaction figures above is not the size, it is the frequency. A
claim and a proof are paid once per identity and never again; the 11,078-byte transfer is paid
every time that account moves value. A chain onboarding a thousand post-quantum identities pays
22 MB once, spread over as many blocks as it likes. That is why the identity entry is optional
on the same reasoning as the transaction entry and not on a weaker one: required there would
refuse every classical claim and proof on every chain that exists, genesis domains included,
which are declared rather than signed and which no policy can retroactively furnish with a
lattice key.
Three fields also had to reach the records root. computeRecordsRoot
(src/core/blockchain.ts) folds a named field list per record kind, so the Gemini fields are
spread into the allocation and registration folds — absent when absent, so no historical root
moves. Left out, they would have been the one part of an identity record the producer's
signature did not reach: the address commits to both public keys, so an edited lattice key makes
a claim fail rather than redirect it, and the failure is a chain split — strip
pqSignatureHex in flight and the root still matches, so a follower holding the stripped copy
rejects a block every other node accepted, with no error naming the cause.
What is still not reachable#
attestation and governance are still required in AEGIS_POLICY_LAUNCH and still unmet:
consensus/poe.ts signs Valkyrie attestations with plain ed25519 and src/governance/odin.ts
signs proposals and votes the same way. Those are the long-lived, never-rotated keys, so they
remain the largest gap on this surface — larger than either of the two this cycle closed.
One consequence of randomised signing is worth naming here rather than being found later:
the gossip dedup key (dedupContentOf, src/network/protocol.ts) is taken over the decoded
transaction, which includes pqSignatureHex. FIPS 204 hedged signing is randomised, so a
holder who signs the same transaction twice gets two dedup keys for one transaction id and two
relays. The mempool still admits only the first — it dedups on tx.id — so this costs relays
and not state, and it is bounded by the sender's own block space. Whether the projection should
drop that one field is a network-layer trade-off (a shared key means the first spelling seen
suppresses the second, including when the first is the invalid one) and is not decided here.
There is now a wallet and a CLI surface, which is the second thing this section used to say
there was not. Agena (src/wallet/agena.ts, registered in docs/NAMING.md) is the keystore:
a sealed file holding both secrets, refusing an unknown suite outright rather than opening as a
classical wallet, and proving on every read that the address still commits to both public keys
and that the lattice secret still matches the lattice public key — the second of which nothing
shorter than a sign-and-verify can establish, because ML-DSA-65 as implemented here offers no
public-key-from-secret derivation. strblk wallet gemini create | show | book | mint | send
drives it. It is a separate verb group and a separate file rather than a flag on the existing
wallet, because being post-quantum is a property of the account: a Gemini address cannot emit
a classical record and a classical address cannot emit a hybrid one, so --pq would be a flag
that is mandatory or forbidden depending on which file happened to be open.
There is no recovery phrase for a Gemini account. Ariadne derives 32 bytes of ed25519 seed;
an ML-DSA-65 secret is 4,032 bytes that no phrase in this tree produces. The keystore file and
its passphrase are the only things that reach the identity, and gemini create says so on the
screen rather than leaving it to be discovered.
Skidbladnir still holds ed25519 keys only. The browser wallet
(src/wallet/web-crypto.ts) and the Python SDK (sdk/python) refuse to build a Gemini
payload rather than silently dropping the fields, because WebCrypto has no ML-DSA-65 and the
SDK has no lattice library. Dropping them would produce an id that binds a different
transaction and a signature the chain rejects while blaming the signature.
The record of what moved#
aegis.ts used to say transactions were "PQ-capable from block zero and opt-in per account, so
the format never needs a flag day". Corrected 2026-09-06: that sentence was removed and
replaced by one naming the missing field. Implemented 2026-09-10: opt-in per account is now
true, and the flag-day consequence the old sentence denied is true as well and is stated above —
adopting required is a consensus change. §11 row 5 carries the same correction.
2.8 Domain separation: the mechanism exists and nothing uses it#
AEGIS_CONTEXTS (aegis.ts:89-96) defines a FIPS 204 context per surface:
attestation, peerRecord, godcypher, transaction, governance, generic. The set is
suffix-free — each label carries its surface name before its version — so no label is a
suffix of another, which is what would let one signing oracle be cloned as another
(aegis.ts:66-67, pinned at pq-hardening.integration.test.ts:72). ML-DSA takes the context
natively and enforces it on verify, so a signature made under one label fails under every
other, and fails with no label at all.
One surface now names itself; the other five do not. aegis.ts:69-82 states which, and it
checks out against the tree: all six call sites omit the argument and take the 'generic'
default —
| Call site | Function |
|---|---|
src/network/praeco.ts:178 | signGemini |
src/network/praeco.ts:287 | verifyGemini |
src/network/bifrost.ts:361 | signGemini |
src/network/bifrost.ts:399 | verifyGemini |
src/network/bifrost.ts:476 | signGemini |
src/network/bifrost.ts:521 | verifyGemini |
Re-read 2026-09-12, and these six numbers have now been wrong twice and corrected twice: once
as :185,223,291,336 (§11 item 3) and once as :194,232,300,345. They moved again because
slnn-handshake-2.0.0 added a block comment to bifrost.ts, and they will move again. The
generic default has been the finding throughout and has not changed; what keeps changing is the
line. Treat the FILE as the citation and the line as a convenience.
signAegis and verifyAegis (aegis.ts:313, verifyAegis aegis.ts:336) have no production caller of any
kind. So a peer record signature and a handshake signature are made under the same context, and
the separation between them is whatever their payload encodings give — not what ML-DSA gives.
The labels are kept rather than deleted because the mechanism is correct and the fix is a
one-argument change at six sites. But it is a coordinated change (aegis.ts:83-87): the
context is an input to ML-DSA, so a node that starts passing 'peerRecord' emits signatures a
node still passing 'generic' rejects. That is a flag day on the handshake and the peer record,
owed to the network layer.
2.9 The policy objects are a declared target, not a control#
AEGIS_POLICY_STRICT (aegis.ts:607) and AEGIS_POLICY_LAUNCH (aegis.ts:745) express, per
surface, where post-quantum material is required. The reasoning at aegis.ts:423-428 is
sound and worth keeping: validator, governance and treasury keys are permanently published and
never rotated, so they carry the harvest-now-decrypt-later property that ordinary transaction
keys do not. A chain's public keys are the harvest.
Three of the seven entries are enforced, and this paragraph has been rewritten downward twice.
It read "Nothing enforces them" until 2026-09-10, when validateTransactionStateless began
reading the transaction entry through aegisAdmits; it then read "one of the six" until
2026-09-12, when verifyDomainClaim / verifyDomainProof were counted properly as the
strDomain entry and verifyPeerRecord (src/network/praeco.ts) began reading peerRecord.
So swapping AEGIS_POLICY_LAUNCH for AEGIS_POLICY_STRICT now changes what transactions, what
domain records and what peer records this software accepts. The remaining four — attestation,
governance, godcypher and generic — are enforced by nothing, and requiresHybrid
(requiresHybrid aegis.ts:785) still has no caller outside
tests/integration/pq-hardening.integration.test.ts. The last sentence that stood here, "there
is no runtime object a governance action could flip", is still true and is the honest residue:
the policy is a module constant, not chain state.
There is a second, structural reason the other five are hard to consult (aegis.ts:459-463): verifyGemini
has exactly one behaviour and must keep it. So 'optional' and 'forbidden' decide whether
a surface may carry Gemini material at all — which is a question aegisAdmits
(src/crypto/aegis.ts) now answers on the transaction path — and they never decide how
strictly it verifies. There is no value here that admits one half. Corrected 2026-09-10: this
paragraph used to say these were not states any verifier could be put into, which read as "the
policy is inert". One of the six entries is not.
Surface by surface against AEGIS_POLICY_LAUNCH, verified against the tree on 2026-09-10:
| Surface | Declared | Actual | Where |
|---|---|---|---|
attestation | required | Plain ed25519 | valkyrieAttest consensus/poe.ts:391, in valkyrieAttest |
governance | required | Plain ed25519 | src/governance/odin.ts:1377 (propose), :1387 (vote) |
peerRecord | required | ENFORCED and met (2026-09-12). verifyPeerRecord reads the entry through aegisAdmits before verifying; hybrid, still under the generic context | src/network/praeco.ts |
strDomain | optional | Enforced. verifyDomainClaim and verifyDomainProof call aegisAdmits; the wallet address must derive from both public keys | src/identity/str-domain.ts |
godcypher | required | Vacuous — GodCypher carries no signature of any kind, and neither provider has a production caller | §6 |
transaction | optional | Enforced. validateTransactionStateless calls aegisAdmits and refuses a partial or unaccepted composite; hybrid when the sender is a Gemini account | §2.7 |
generic | optional | Exceeded — Bifrost and Praeco both sign hybrid | §2.8 |
The two unmet required entries are the ones that matter most, because they are the long-lived
keys the policy's own reasoning is about. They are kept at required rather than lowered to
match the code, and that is the right call: lowering a security target to make it true is a
governance decision, not a documentation edit (docs/SECURITY.md:244-247).
pqKeyEncapsulation: 'required' deserves its own note. Its stated meaning is "reject
confidential payloads whose key was not established through ML-KEM", and the gap it leaves is
that a bare ML-KEM handshake satisfies it — which is precisely the configuration Bifrost had.
The note used to end "a requirement worth enforcing would name the hybrid suite", and on
2026-09-12 one does: AegisPolicy.acceptedKemSuites is an exact-match allowlist for key
establishment, listing HYBRID_KEM_SUITE and not PQ_KEM_SUITE, and aegisAdmitsKemSuite
(src/crypto/aegis.ts) is read by crossBifrost on the unauthenticated handshake leg. The
pqKeyEncapsulation field itself is still consulted only for its 'forbidden' case, which no
deployment here sets — the suite list is what actually decides.
3. ML-KEM: where hybrid is used, and where bare was#
3.1 The two constructions#
Hybrid — KitchenSink ML-KEM-768 + X25519 (aegis.ts:324-376):
| Constant | Value |
|---|---|
HYBRID_KEM_SUITE | ml-kem-768+x25519 |
HYBRID_KEM_PUBLIC_KEY_BYTES | 1216 |
HYBRID_KEM_CIPHERTEXT_BYTES | 1120 |
HYBRID_KEM_SECRET_KEY_BYTES | 32 |
The secret key is a 32-byte seed rather than 2,400 bytes of expanded material, which is what
makes a wallet backup survive the move to post-quantum unchanged (aegis.ts:321-322, pinned at
pq-hardening.integration.test.ts:197).
The combiner is KitchenSink, not X-Wing (aegis.ts:345-348). Both are in the library and
measured within noise of each other; KitchenSink hashes both ciphertexts and both public keys
into the shared secret rather than relying on ML-KEM ciphertext-second-preimage resistance, so
it drops an assumption for no cost.
Bare — ML-KEM-768 alone, no X25519, no classical fallback. It has no caller left in src/
as of 2026-09-12, and the next section is what it used to be.
3.2 Say it plainly: the SLNN session key WAS the bare one, and is not any more#
The module argues at length — and again at godcypher.pq.ts:36-39 — that confidentiality is the
surface where staking everything on a young primitive is least acceptable, because a signature
only has to hold until it is verified; a secret has to hold forever. It then named the surface
where that argument had not been applied, and this section existed to repeat it:
src/network/bifrost.ts:170callsencapsulateandbifrost.ts:229callsdecapsulate— the bare functions. So the confidentiality of every frame between two nodes rests on ML-KEM-768 alone, against an implementation that is unaudited and does not claim constant time. A recorded handshake is exactly what a harvest-now-decrypt-later adversary collects, and this is the largest remaining exposure of that class in this repository.
That was fixed on 2026-09-12. crossBifrost calls encapsulateHybrid and
verifyBifrostResponse calls decapsulateHybrid (src/network/bifrost.ts), against a 1216-byte
hybrid key the dialer publishes in the challenge, under handshake version
slnn-handshake-3.0.0. Breaking the session key now means breaking both ML-KEM-768 and
X25519. The five things a reader needs that the sentence above does not carry:
1. The key is derived, not newly persisted, and both its inputs matter. The node identity
keystore holds a Gemini signing keypair and a bare ML-KEM keypair and nothing else, and adding a
third key to it is a keystore migration on every existing node — owed to the node layer, not taken
by the crypto desk. So deriveHybridKemKeypair (src/crypto/aegis.ts) seeds the hybrid keypair
from SHA-256(domain | ed25519 secret | ML-KEM secret). Both inputs are load-bearing, and this
is the whole security argument rather than a tidiness choice. The KitchenSink secret key is its
32-byte seed, which expands to both child keys, so whoever reaches the seed holds both halves. A
seed derived from classical material alone would fall to a quantum adversary — who recovers the
ed25519 private key from the published one by Shor — and would hand them the lattice child key
along with it. A seed derived from lattice material alone would fall to whoever breaks ML-KEM, who
holds the node's decapsulation key by assumption, and would hand them the X25519 child key.
Either one alone makes the hybrid worth nothing. With both as inputs, the first adversary lacks
the ML-KEM secret and the second lacks the ed25519 secret, so one surviving primitive keeps the
seed out of reach. BifrostLocalConfig.hybridKemSecretKeyHex takes an independent seed when the
node layer has one to give, and nothing sets it today.
2. It is a flag day, by choice. The suite is matched against acceptedKemSuites, not
negotiated, because the handshake is the one operation available before anybody has authenticated:
a suite field in the clear on that leg is a downgrade oracle, and the signature covering the
transcript is verified only after the responder has already encapsulated. A 1.0.0 node and a
2.0.0 node therefore hold no session — an old challenge is refused on the version before any
lattice work, an old response on the dialer's first check — and the whole mesh moves together.
SLNN_WIRE_VERSION stays at 1: the frame envelope did not change, and bumping it would make
every node refuse every frame on every protocol from the other build, with no named reason.
3. Forward secrecy is still absent, and the hybrid swap did nothing for it. The session KEM
key is long-lived and derived from material on the node's disk. Whoever takes that disk still
decrypts every recorded session the node dialled — only the dialer's key is encapsulated to, an
asymmetry the swap left exactly as it was. Ephemeral keys and in-session rekey are costed in
src/network/bifrost.ts beside deriveSessionKey, and are a second version bump that should not
have been bundled into this one: the first is a confidentiality fix that needed no API change, the
second changes this module's interface and src/network/starw-node.ts with it.
4. Measured cost. Median of three runs of 300 iterations, darwin arm64, Node v22.22.3:
| bare ML-KEM-768 | hybrid | delta | |
|---|---|---|---|
openBifrost | 0.00 ms | 0.44 ms | one getPublicKey on the derived seed |
crossBifrost | 9.31 ms | 10.92 ms | +17% |
verifyBifrostResponse | 1.99 ms | 3.69 ms | +85% |
| three legs end to end | 22.28 ms | 26.4 ms | +18% |
| challenge on the wire | 6,803 B | 9,293 B | +2,490 |
| response on the wire | 16,270 B | 16,334 B | +64 |
| confirm on the wire | 14,056 B | 14,056 B | — |
Gleipnir's handshake allowance is still right at 2 a second with a burst of 32: it was derived from the largest honest inbound rate this code can produce — about 0.8 a second on a 13-node loopback mesh — rather than from the cost, and 2 × 10.9 ms is about 2% of one core. The pre-session byte budget of 512 KB/s carries about 23.4 KB per handshake at that rate, eleven times over.
5. One allowance is NOT still right, and it is not this section's to fix.
PROTOCOL_LIMITS[handshake] caps a handshake payload at 16,384 bytes. The response now has 50
bytes of headroom, and each further protocol id in ALL_PROTOCOLS costs about 28 of them. A
response carrying a real UrdProof checkpoint is 16,718 bytes and cannot be framed at all —
16,654 before the swap, so a node holding a checkpoint could not answer a handshake on the
previous build either, and the 64 bytes this change adds moved neither side of that line. That
ceiling lives in src/network/protocol.ts. Every figure in items 4 and 5 is asserted in
tests/integration/bifrost-hybrid-kem.integration.test.ts, including the overflow, so the day one
of them moves is a red test rather than a silent refusal on a pre-authentication path.
3.3 A finding, and its correction: the hybrid KEM runs off the node, never on it#
docs/SECURITY.md:182 records the hybrid KEM as covering "wNFT envelopes (Lethe),
GodCypher-PQ". Against the tree on 2026-09-06, both of those are libraries:
- GodCypher-PQ —
GodCypherPQProvideris constructed nowhere insrc/. §6. - Lethe's recipient envelope —
sealEntryForRecipient(wnft-envelope.ts:789) andopenEntryAsRecipient(wnft-envelope.ts:818) are the only Lethe functions that touch the KEM, and grep finds them called from exactly one place in the tree:tests/integration/lethe-wnft.integration.test.ts:487. The wallet (src/wallet/skidbladnir.ts:31-42) importssealEntryandopenEntry— the local AES-256-GCM envelope — and not the KEM pair.
So neither of those two is a caller. That is not the same as no caller, and the sentence that
stood here — "encapsulateHybrid has no production caller at all" — was wrong. Corrected
2026-09-08. A third caller exists and was missed because it is not in src/crypto/ and not in
any subsystem this volume walks:
- Operator key tooling, off the node.
sealSeatKeycallsencapsulateHybrid(src/ops/hofvarpnir.ts:149) andopenDeliverycallsdecapsulateHybrid(src/ops/hofvarpnir-host.ts:142). Both are reached from shipped operator commands, and a shipped command is a production path, so the confidentiality of the keys that tooling protects rests on ML-KEM-768 or X25519 holding.
The narrower claim WAS the one to keep, and it expired on 2026-09-12. It read:
"encapsulateHybrid never executes on a RUNNING NODE — on a running node the only KEM that
executes is still the bare ML-KEM-768 in Bifrost." It executes on a running node now, on the one
leg every peer reaches before it has authenticated (§3.2). What survives from this subsection is
the distinction it was drawing, which still separates two different exposures: the operator
tooling runs before a node starts and serves no traffic, so a break in both halves of the hybrid
there is a compromise of the keys it protected — recoverable by issuing fresh ones. The same break in Bifrost is a live compromise of every recorded session. Both now
rest on the same primitive and they are not the same risk, and the four enumerated callers below
are still four rather than six: src/messaging/occultation.ts and src/hostless/accretion.ts
call encapsulateHybrid too, and were missing from this list (§11).
Keeping the distinction explicitly is the point. "No production caller" collapsed it in one
direction and understated a real dependency; "in production use" would collapse it in the other
and overstate the live exposure. SECURITY.md's §1 assumption row, its §3 table row and the
paragraph under that table all now carry both halves. §11 item 2.
This does not make Lethe's recipient envelope or GodCypher-PQ any less of a library. It makes the primitive under them something the launch procedure already depends on.
3.4 Why decapsulate checks both arguments#
aegis.ts:407-416. decapsulate asserts the ciphertext length and the secret key length.
The comment at :401-405 records why the second one was added:
ML-KEM's implicit rejection is designed to hide WHICH ciphertext failed, and it hides a broken key just as well. The caller would get 32 bytes that look exactly like a working shared secret.
That is the failure worth internalising before touching any of this: a KEM whose design goal is to never tell you why it failed will also never tell you that you handed it garbage. Validation has to be in front of it, not inferred from its output.
4. The verify pool — src/crypto/verify-pool.ts, src/crypto/verify-worker.ts#
This component has no house name, unlike Aegis, Gemini, Lethe and Fafnir. Under the standing naming rule it is owed one. Naming it is not this document's to do, and it has not been done.
It does now have a docs/NAMING.md entry, added 2026-09-06 under "Components awaiting a
name" — a section that did not exist, because the file's only pending-names section reserved
names with no component and this is the opposite case. The entry records the debt and names no
name.
4.1 Why it exists#
Measured in-source (verify-pool.ts:9-11): 82% of the cost of accepting a block is signature
verification — 18.8 ms of 23 ms for a 256-transaction block — while applying the state is
16 µs per transaction. On a chain with no fees, checking signatures is the work, and a node
verifies every transaction at least twice: once entering the mempool and once when the block
carrying it is applied.
4.2 Why this is safe to parallelise when execution is not#
verify-pool.ts:14-20. Verifying a signature is a pure predicate: the answer does not
depend on what else has been verified or in what order. So checking a thousand at once produces
exactly the answers checking them one at a time would, and the block-level decision — every
signature holds, or the block is refused — is a conjunction, which is order-independent.
Applying transactions is the opposite: order decides the state root. This does the big half and touches no consensus rule.
4.3 Why Atomics.wait and not promises#
verify-pool.ts:22-28. Two reasons, both recorded:
- Blocks arrive through synchronous callbacks —
onBlock,acceptBlock, the whole transport is sync. An async verifier would ripple anawaitthrough the network path, the CLI, the fork resolver and every caller. - It would be slower. Passing jobs by
postMessagestructured-clones them, and that cost capped a prototype at 4× and made it go backwards past 8 workers (2.5× at 16, 1.6× at 24) on a 32-core machine.
Jobs go into shared memory instead, so nothing is copied and the main thread blocks on a futex.
4.4 The shared-memory protocol#
Two SharedArrayBuffers per lane (verify-pool.ts:208-209): a control buffer of
Int32Array and an 8 MiB data buffer (LANE_BYTES verify-pool.ts:81).
Control slots, mirrored in both files — verify-pool.ts:45-52 and verify-worker.ts:40-47.
The comment on both is the same sentence: "Changing one without the other deadlocks."
| Slot | Meaning |
|---|---|
0 SLOT_STATE | IDLE=0, WORKING=1, DONE=2, STOP=3 |
1 SLOT_COUNT | jobs in this lane's batch |
2.. RESULTS_FROM | one int32 per job: 1 is valid, anything else is not |
Data layout per job, written by loadLane (verify-pool.ts:301-323) and read by the worker
(verify-worker.ts:74-82):
u32 LE message length ‖ 32-byte public key ‖ 64-byte signature ‖ message bytesThe handshake:
- Main thread fills the data buffer, stores the job count, then stores
WORKINGintoSLOT_STATEandAtomics.notifys — for every dispatched lane before waiting on any of them (verify-pool.ts:370-373), so all lanes work while the main thread sleeps on the first. - The worker wakes from
Atomics.wait(state, SLOT_STATE, IDLE)(verify-worker.ts:60), verifies each job, and stores1or0into its result slot (verify-worker.ts:92). - The worker stores
DONEand notifies (verify-worker.ts:97-98), thencompareExchange(DONE → IDLE)on itself (verify-worker.ts:102). - The main thread's collection loop waits on the slot leaving
WORKING(verify-pool.ts:384), so it cannot miss the completion whichever of the worker's two writes it observes.
The compareExchange in step 3 rather than a store is load-bearing twice over. Its absence
was a real bug: verify-worker.ts:52-58 records that a worker which looped straight back to
Atomics.wait(state, SLOT_STATE, IDLE) while the slot held DONE got 'not-equal'
immediately and spun a core at 100% between finishing a batch and being collected. Eight cores
of nothing, on a machine that had just been told to verify signatures quickly. The batch still
came out right, which is exactly why it survived — the only symptom was a node that was hot
and slow. And it is compareExchange rather than store so that a STOP the main thread wrote
in the meantime is never overwritten with IDLE (verify-worker.ts:66-67,
verify-worker.ts:99-102).
tests/integration/verify-pool.integration.test.ts:234-302 drives one worker directly over the
buffer — under the pool, because the property is not in an answer, it is in what the lane does
with the slot afterwards — and measures process.cpuUsage() to assert the lane is asleep rather
than merely reset.
4.5 Why it cannot return a false valid#
Five structural reasons, each checkable:
- A result slot is written by exactly one thread. Lane i owns its own control buffer; no other lane can reach it. There is no shared result array across lanes.
- A result is only ever the output of
nodeVerify.verify-worker.ts:86is the sole writer of a1. There is no default-true, no "assume valid on error", no short circuit. - The failure path writes zero, not a throw.
verify-worker.ts:87-91: a malformed key or signature is a failed verification, not a crashed lane, because the batch comes from the network and a throw here would take the node down on a hostile block. - Results are read only after the slot leaves
WORKING(verify-pool.ts:384-396). A lane that has not finished cannot have its stale slots read as answers. And the read isAtomics.load(...) === 1(verify-pool.ts:395) — an equality against one specific value, so a leftover, a partial write or an uninitialised zero reads asfalse, never astrue. The failure direction of every ambiguity is invalid. - Every abandonment falls through to the serial path, which is
verifyMessageon each job (verify-pool.ts:325-327). A timeout does not return partial results; it returnsserial(jobs)(verify-pool.ts:390).
The safety argument is that the parallel path answers exactly what the serial path answers,
and tests/integration/verify-pool.integration.test.ts asserts that directly rather than
arguing for it — including with a single forged signature buried at position BIG - 7
(:67-77), with every third signature belonging to a different job so a misaligned lane
boundary would be caught (:52-65), and with verifyPoolLanes() asserted greater than 1 in
each so a silent fallback to serial cannot make the file pass while testing nothing (:46-47).
Evidence, measured here on 2026-09-06. 342 batches of 2,048 jobs — 700,416 verifications — across 8 lanes, one in every seven signatures deliberately forged by flipping the last byte, run while 40 concurrent CPU-spinning intervals oversubscribed all 32 cores to force preemption of the lanes mid-batch:
verifications: 700416 batches: 342 lanes: 8
falseValid: 0
falseInvalid: 0
laneTimeouts: 0 availability: running elapsed: 24.7 sThis is consistent with, and independent of, the 685,217 verifications with zero false valids under deliberate preemption carried into this cycle and the two audits that reviewed the protocol. Neither of those two audits nor that run is recorded anywhere in this tree — the two internal audit documents present, both dated 2026-08-30, do not mention the verify pool. That the pool was audited twice is therefore a claim this document repeats and cannot verify from the repository. The run above is the part I can show you.
Two limits on what any such run proves, stated so nobody over-reads them: a run of ~700k verifications bounds a false-valid rate to roughly 1 in 10^5 at the usual confidence, not to zero; and forcing preemption by oversubscribing cores is not the same as exercising every interleaving. The structural argument in points 1–5 is what carries the property. The measurement is what shows the structure was implemented.
4.6 Every fallback path#
verifyBatch (verify-pool.ts:336) drops to serial in seven distinct places. All of them are
return serial(jobs), and all of them are slower, never wronger:
| Condition | Line |
|---|---|
Fewer than PARALLEL_VERIFY_THRESHOLD (128) jobs | :337 |
| Lanes could not start, or the pool is inside a cooldown | :340 |
| Any job's signature or public key is not exactly the right hex shape | :345-347 |
| Fewer than 2 useful lanes for this batch size | :352 |
A lane's slice exceeds MAX_JOBS_PER_LANE (4,096) | :362 |
A lane's slice does not fit in LANE_BYTES (8 MiB) | :365 |
| A lane stopped answering inside the batch deadline | :389-390 |
And two at start-up (startLanes verify-pool.ts:183) that set unavailableReason — the
permanent flag, set only for conditions that cannot change while the process runs
(verify-pool.ts:126-128):
- no
SharedArrayBufferin this runtime (:186-189); - no compiled
verify-worker.jsbeside this module or underdist(:191-194); - and
new Workerthrowing outright (:229-232).
Two of the thresholds have measured reasons. MIN_JOBS_PER_LANE = 64 (:65) exists because an
earlier version split on this number alone, so a 64-signature block computed exactly one
lane, paying every cost of the pool and getting none of its parallelism: accepting ten blocks
went from 64 ms to 96 ms, slower than doing nothing. MAX_LANES = 8 (:87) is not the core
count, because throughput peaked at 8 in measurement and fell away past it — past a point the
main thread spends longer dispatching than the lanes spend verifying, and a 64-core machine
would be slower than an 8-core one.
The lane count floor of 2 (:205) is also load-bearing: a two-vCPU box would otherwise compute
a single lane, a single lane is refused as not worth the coordination, and the pool would exist,
start, and never once be used — on exactly the machines most likely to run CI
(verify-pool.integration.test.ts:172-179).
workerUrl (verify-pool.ts:171) looks for the compiled worker beside this module and then
under dist. The comment at :158-169 names the failure it prevents: running from src, the
sibling .js does not exist, new Worker fails asynchronously, and the pool falls back to
serial without saying anything — so the tests that exist to prove the parallel path is
equivalent would pass while never running it. "That is the worst kind of green." The worker is
also spawned with execArgv: [] (:217) so a parent started with a loader hook does not fail
to spawn a lane and get silently downgraded.
4.7 The honest note on whether degradation is reported#
The mechanism is complete. Whether an operator sees it depends on a surface outside this module, and that is the honest limit.
What is fixed. A lane timeout used to set a module-global flag that disabled the pool for the
life of the process, with nothing recorded anywhere: "a node that had silently lost 82% of its
block-acceptance throughput looked, from every surface, exactly like one that had not"
(verify-pool.ts:36-38). A restart was the only cure and nothing told an operator to try one.
Now a timeout calls degradeAfterTimeout (verify-pool.ts:242), which is temporary:
cooldown starts at 60 s (:105) and doubles per consecutive failure to a ceiling of 15 minutes
(:115), so the worst case is 30 seconds lost per 15 minutes while the door stays open — the
cause may be transient load, a suspended VM, a container throttled to nothing. A clean batch
resets the consecutive counter (:403). laneTimeoutCount is cumulative and never reset
(:134), because an operator needs to see a lane that fails every hour.
verifyPoolState() (verify-pool.ts:263) reports availability as one of running,
not-started, degraded or unavailable, with a reason in words an operator can act on and
a retryAtMs. It has three readers: src/cli/strblk.ts:952,986, src/hostless/orrery.ts:644
and src/ops/astrolabe.ts — and orrery.ts:638 notes it is read, never started, so asking
for status does not spawn a lane.
What is not established:
- Nothing alerts. The state is pollable. There is no threshold, no escalation, no entry
written to Clio, no
needsAttentionderived fromlaneTimeouts. An operator who does not look does not learn. Whether any deployed dashboard surfaces it prominently enough to be noticed is unmeasured. - The batch deadline is 30 seconds (
verify-pool.ts:102), and during it the main thread is asleep in a futex on a node whose job is to accept blocks. That is the right trade against the alternative it replaced — it was per lane inside the collection loop, so eight dead lanes cost eight full deadlines, 240 seconds frozen (:96-101) — but 30 seconds is still 30 seconds. - A permanently
unavailablepool is reported but is not an error. A packaged binary that cannot resolve the worker file runs correctly and single-threaded forever, saying so only to whoever asks.
5. Fafnir — the node keystore, src/node/keystore.ts#
Registry entry at docs/NAMING.md:119. In Norse myth Fafnir is the one who lies coiled on the
hoard: the gold does not move because something is on top of it. That is the whole job.
5.1 What it closes#
keystore.ts:11-18. A node's identity.json held its ed25519 private key, its ML-DSA-65 secret
key and its ML-KEM-768 secret key as plaintext hex — about 6.4 KB of secret material —
written with the process umask (0666 on a default image), no passphrase, no KDF, no keystore.
For a validator that file is the validator: whoever holds it can sign blocks as this node,
sign peer records as this node, and decrypt anything KEM-wrapped to it.
The threat is not exotic: a backup that copies the data directory, a container image built with the volume baked in, a log shipper with read access to the node's home, a stolen laptop, or a second process on the same host owned by any user at all.
5.2 scrypt at the OWASP floor#
keystore.ts:67-74: N = 2^17, r = 8, p = 1, 32-byte output.
Measured here, 2026-09-06, one seal and one open on this host:
| Peak RSS above baseline, per derivation | 128.1 MiB |
Seal (sealEnvelope, one derivation) | 254 ms |
Open (openEnvelope, one derivation) | 256 ms |
That confirms both the in-source figure at keystore.ts:68-70 ("roughly 250 ms and 134 MB" —
134 MB decimal is 128 MiB) and the arithmetic: scrypt's working set is 128 · N · r
bytes = 128 × 131072 × 8 = 134,217,728 bytes = exactly 128 MiB.
The 13-process case. scripts/testnet.mjs:150 defaults to 13 nodes on one machine. Thirteen
derivations running concurrently is:
13 × 128 MiB = 1,664 MiB = 1.625 GiB = 1.745 GB (decimal)The "~1.67 GiB" figure carried into this cycle is the same number rendered with a 1000-MiB "GiB"; the precise value is 1,664 MiB, 1.63 GiB. Either way the operational point stands and is worth stating loudly: a thirteen-node local testnet where every node starts at once and every node has a passphrase set will ask the host for about 1.6 GiB of scrypt working set simultaneously, for about a quarter of a second. On a laptop with other things running that is a real transient. It is not a defect — it is the KDF doing exactly what it is paid for — but an operator who has not been told will read it as a memory leak.
Note that deriveKey sets maxmem to 128·N·r·2 + 32 MiB (deriveKey keystore.ts:595), which is a
288 MiB ceiling per call, not the working set. Do not read the ceiling as the usage.
The parameters live in the envelope (FafnirKdfParams keystore.ts:180) so they can be
raised later without orphaning an existing keystore.
5.3 AES-256-GCM, and the KDF parameters as AAD#
AES-256-GCM, not CTR or CBC (keystore.ts:26-28). A keystore that decrypts without
authenticating lets an attacker who cannot read the file still flip bits in it. With GCM a
wrong passphrase and a tampered file are the same event — a tag failure, which is a clean
refusal.
The KDF parameters are authenticated as AAD (keystore.ts:29-30, sealEnvelope at
:385, openEnvelope at :421). Without it, an attacker rewrites N down to 2 in the file
and the next reseal is derived cheaply.
headerAad (keystore.ts:520) fixes field order in code rather than taking it from the parsed
object, so the AAD is a function of the values and not of however the JSON happened to be
serialised — otherwise two encoders that disagree on key order produce a keystore that only
opens on the machine that wrote it.
A fresh random 96-bit IV per write (keystore.ts:79, :380), never a counter and never
derived from the key. Reusing a (key, IV) pair under GCM does not merely weaken it, it leaks
the authentication subkey.
Parameters read from a file are bounded before use
(assertReadableEnvelope keystore.ts:542), because they come from disk and disk is attacker-reachable in exactly the
scenario this module exists for. N must be an integer power of two greater than one (:499),
r in 1..32 (:502), p in 1..16 (:503), the key length exactly 32 (:504), and the
derived memory demand under 1 GiB (:505-510) — "a keystore does not get to choose how much of
this node it consumes". An unbounded N is a one-line memory kill of the node.
The passphrase is NFKC-normalised before derivation (deriveKey keystore.ts:592), so a passphrase
containing anything outside ASCII opens the same keystore on every platform. Two encodings of
the same typed characters are two different keys, and an operator experiences that as "the
passphrase stopped working".
5.4 The atomic write#
writeSecretFile (keystore.ts:619): temp at 0600 → chmod the open handle → write →
handle.sync() → rename → chmod the last file.
Each step has a reason (keystore.ts:549-556, :569-579):
- Atomic, because the alternative is a window in which a node's only copy of its identity is half a file.
- The temp file matters as much as the last one. A temp written 0666 and then renamed is a 0666 file, and a temp that is merely readable for a moment is readable long enough by anything watching the directory.
- The explicit
chmodon the open handle, becauseopen(..., mode)only applies the mode when it creates the file — so a temp left behind by a previous crash keeps whatever mode it had, and that stale temp is exactly the file a crash-then-restart writes secrets into. sync()beforerename. A rename that lands ahead of the data publishes an empty identity file, and an empty identity file is an identity that is gone.
On Windows the 0600 buys nothing. keystore.ts:82-90 says it outright: Node maps chmod
onto the read-only attribute and nothing else, so the file is protected only by the NTFS ACL it
inherits from its parent directory. The bit is set anyway because it is the whole defence on
Linux and macOS, where validators run, and a mode that is merely ignored costs nothing. The
chmod failure is swallowed (:563-567) "and reported honestly in the comment rather than
retried: the file's protection there is the directory ACL it inherits, and pretending otherwise
is how a control gets counted twice."
5.5 The failure taxonomy#
KeystoreFailure (keystore.ts:119-129) and KeystoreError (keystore.ts:173).
| Failure | Meaning | Thrown at |
|---|---|---|
wrong-passphrase | The passphrase does not open the file, or the file was tampered with | keystore.ts:431 |
passphrase-required | The file is sealed and no passphrase was supplied | keystore.ts:316 |
malformed | Not a keystore, or not a shape we can read | :274, :332, :486 |
unexpected-plaintext | A passphrase is set and the file is not sealed | keystore.ts:299 |
unreadable | Exists and could not be read at all: permissions, I/O, a directory | :262, :540 |
The whole taxonomy exists so that exactly one condition returns null. readKeystore
(readKeystore keystore.ts:310) returns { value: null } for one case only — ENOENT, the file is not
there, which is first run. Every other outcome throws, because every other outcome is a state
where creating a new identity would destroy the old one.
keystore.ts:131-140 records the bug: the old code called JSON.parse inside a bare
catch { return null }, so a keystore that was merely unreadable — a bad mount, a permissions
change, a half-restored backup — looked exactly like first run. The node generated a brand new
identity and carried on; every peer that knew the old record would then be talking to a
stranger, and the real keys were one atomic write away from being overwritten. Losing an
identity silently is worse than refusing to start.
Two distinctions in the taxonomy are worth preserving deliberately:
wrong-passphrasenames both causes in one message (keystore.ts:428-437), because GCM gives one bit and the two are genuinely indistinguishable here — "so nobody concludes 'bad passphrase' and stops looking at an integrity failure."- A decrypt that succeeds and then fails to parse is
malformed, notwrong-passphrase(keystore.ts:328-337). The tag verified, so the passphrase was right and the ciphertext is intact; what came out is genuinely not JSON. Conflating them costs an operator the outage looking in the wrong place.
Every refusal message ends by saying what did not happen: "Nothing was loaded and nothing was written — this node did NOT fall back to a new identity."
5.6 The plaintext-substitution refusal, and its one-shot escape#
This is the subtlest control in the module and the easiest to weaken by accident.
readKeystore at keystore.ts:281: the file parses but is not an envelope.
- No passphrase set → it loads (
:286). With no passphrase to check it against there is nothing to be suspicious about and nothing that could be done differently; refusing would strand every node created before this module existed. - A passphrase set → this is a substitution until an operator says otherwise (
:298).
The reasoning at keystore.ts:288-297 is the part that must survive any future cleanup:
Whoever wrote it did not hold the passphrase — a holder would have sealed it — so it is either the one legacy file this deployment is migrating, or it was planted. The two are indistinguishable from here, and the consequences are not: the caller adopts these keys, re-seals them under the real passphrase, and then honestly reports that the node's keys are encrypted at rest. An attacker with write-only access to the data directory — no read, no passphrase — becomes the validator, and every surface that reports on key protection says the protection held.
That is the attack: the reporting is what makes it work. A control that turns a planted file into a sealed, endorsed identity is worse than no control.
The escape. KEYSTORE_MIGRATE_ENV = 'SOURCELESS_KEYSTORE_ADOPT_PLAINTEXT'
(keystore.ts:62). keystore.ts:52-60 states the shape of the problem exactly: "'load the
plaintext file anyway' is a real operation an operator has to be able to perform exactly once
… and it is also the whole of an attack. Both need the same code path, so the only thing that
can separate them is whether a human asked for it."
legacyPlaintextAdoptionAllowed (keystore.ts:223) accepts exactly two spellings, 1 and
true, both after trim and lowercase. Anything else — including 0, false, no and the
empty string — is not authorisation, because "a flag whose semantics depend on truthiness is a
flag that gets set by accident" (keystore.ts:193-196).
It is a one-shot flag by convention, not by mechanism. Nothing clears it, nothing expires
it, nothing counts uses of it, and nothing warns on the second run. keystore.ts: "Set it for
the migration run and unset it afterwards. Leaving it set converts a validator back into one
that will adopt any plaintext identity file left in its data directory." Leaving it set is a
full re-open of the attack, and only an operator's discipline closes it.
Corrected 2026-09-06. The constant's header used to call the flag "one-shot" without
qualification, which named a property the module does not have; it now says "one-shot by
convention, not by mechanism" and spells out what "left set" means. Enforcement was considered
and deliberately not attempted, and the reason is recorded there rather than left as an
omission: a durable "already used" marker would have to live in the data directory, which is
precisely what the adversary in this threat model is defined by write access to — they delete
it and the flag is fresh — and a process-lifetime cap of one adoption forbids nothing, because
the attack completes in a single adoption inside a single process. Enforcement that would hold
has to come from outside the module: a supervisor that unsets the variable, or a migrate
subcommand carrying the intent as KeystoreReadOptions.allowLegacyPlaintext, which is scoped
to the one call that passes it. That seam exists; nothing uses it.
5.7 What Fafnir is not#
Stated in the module itself (keystore.ts:40-45) rather than left to be discovered:
- A passphrase in an environment variable is readable by the same user, by anything that can read this process's environment, by a core dump, and by any process this node spawns.
- Once the node is running the keys are in its heap in the clear. They have to be — it signs with them.
key.fill(0)in thefinallyblocks (keystore.ts:401,:439) is best effort and named as such: it clears one Buffer, not the copy the passphraseStringalready made on the V8 heap, which is immutable and unwipeable, nor anything the allocator moved. It costs nothing and it shortens one window.
This raises the cost of theft of the file at rest. It does nothing about a compromise of the running process or of the account it runs as. "Fafnir was, in the end, killed and the hoard taken."
Short passphrases are warned about, never rejected (keystore.ts:95-102,
ADVISED_PASSPHRASE_LENGTH = 12), because rejecting one would lock an operator out of a
keystore already sealed with it, and losing a node's identity is worse than a weak one.
Whitespace-only is treated as unset (keystore.ts:219) — an operator who exports the variable
empty in a systemd unit has not chosen "encrypt with the empty string", and silently sealing
with '' would be worse than not sealing, because it looks encrypted.
An unsealed file carries UNENCRYPTED_BANNER (keystore.ts:143) as a __WARNING__ key
inside the file (keystore.ts:357-359), because status output scrolls away and log lines
get filtered. stripBanner (keystore.ts:696) drops it on read so it never travels into a
sealed file.
By default, nothing is sealed. docs/SECURITY.md:612-614 records it:
SOURCELESS_KEY_PASSPHRASE is unset in every default path, so a node's secret keys sit
unencrypted on disk, and no release gate consumes keysEncryptedAtRest. Fafnir works; it is
opt-in.
6. GodCypher — godcypher.webcrypto.ts, godcypher.pq.ts#
6.1 What it is#
Three-way envelope encryption: the content key is derived from secret material contributed by all three parties (sender, receiver, witness), so possession of the public identifiers is not sufficient to decrypt. Party ids and the version are bound as AES-GCM additional data, so a ciphertext cannot be re-attributed to other parties.
The regression this pins is real and it worked: the original derived the content key from
the public identifiers, so anyone who knew the three names could decrypt
(godcypher.webcrypto.ts:44-47).
Two providers.
GodCypherWebCryptoProvider | GodCypherPQProvider | |
|---|---|---|
| Version | gc-webcrypto-v2 (:7) | gc-mlkem768-x25519-v2 (pq:14) |
| Key material | three 32-byte party secrets, concatenated | three hybrid KEM encapsulations |
| KDF | PBKDF2-SHA-256, 210,000 iterations (:9, :143) | HKDF-SHA-256 (pq:198) |
| Content cipher | AES-256-GCM | AES-256-GCM |
| Ciphertext cap | 256 KiB (:20) | 256 KiB (pq:23) |
The PQ provider's HKDF info binds the version, the suite, every party's id and public key,
and all three ciphertexts (kdfInfo, godcypher.pq.ts:222-234). The comment at
pq:190-196 names why: binding only the ids left the content key independent of the
encapsulations, so swapping a ciphertext for another one that decapsulates to the same secret
produced the same key — "the derivation was bound to who the parties were, not to what was
actually sent." The transcript is ~14 KB and Node caps HKDF info at 1024 bytes, so it is
committed to by SHA-256 digest (pq:215-221); a digest binds exactly the same material.
decrypt3Way calls its own validate before decapsulating (pq:141), and the comment at
pq:137-140 says why that was added: "a check a caller may run is not a check, it is a
suggestion." The same fix landed on the classical provider at webcrypto:89. validate itself
was tightened three ways (pq:163-172): odd-length ciphertext hex used to pass and then throw
in the decoder; there was no upper bound, so validating cost whatever the sender chose; and the
KEM ciphertexts were checked for length but never for being hex, so 1088 bytes of anything
reached decapsulateHybrid.
6.2 Plainly: an unused library with no production caller#
Both module headers say it — godcypher.webcrypto.ts:30-33 and godcypher.pq.ts:41-44 — and
it checks out. encrypt3Way and decrypt3Way appear nowhere in src/ outside the two provider
modules and the barrel. No block, transaction, wNFT or network path constructs a GodCypher
provider, and no GodCypherPayload is ever placed on chain. The only callers are
tests/integration/aegis.integration.test.ts and
tests/integration/pq-hardening.integration.test.ts.
The barrel says so too, at the export site where a consumer chooses what to import
(src/index.ts:10-16): "Importing one of these does not put it on a consensus path; that path
does not exist yet."
The godCypherVerifiedCount a PoE proof used to carry was never produced by either
provider. godcypher.webcrypto.ts:35-41: it was a number a producer passed to
buildPoEProof, no production caller ever passed it, so it read 0 on every block ever sealed,
and no Block carries a GodCypherPayload anywhere in its shape for a verifier to recount it
from. The counter and this class shared a name and nothing else — which is why
spec/interfaces.ts drops the field under poe-v3.
It is kept rather than deleted because the three-way envelope is a named SourceLess primitive
with a spec type, because the properties are real and pinned by tests reproducing an attack that
worked, and because deleting it would strand GodCypherPayload in files this module does not
own. What it must not be mistaken for is a control that is running.
Consequence for §2.9: the policy entry godcypher: 'required' is not merely unenforced, it is
vacuous. GodCypher carries no signature of any kind.
AMENDED 2026-10-30 — the PQ provider has a running caller now; the classical one still does not. The section above is kept as written.
GodCypherPQProvider.encrypt3Wayis reached fromsrc/entropy/jord.evidence.ts, which the timestamp poller (src/entropy/sigyn.ts) calls for every GodCypher timestamp it makes once the printer, archive and witness parties are configured, anddecrypt3Wayfromnode scripts/jord.mjs open-evidence. On a host with no parties configured the call site is reached and returns not sealed before anything is encrypted, and the record says so. Still true: no block, transaction or record kind carries aGodCypherPayload, andGodCypherWebCryptoProviderhas no caller. §14.
7. ZK13 — src/crypto/zk13.providers.ts#
This is a reference implementation and the tree now says so in the type system, not only in prose. Section 7.6 records the decision and what was rejected with it. Read 7.2 before anything else; it is the finding the rest of the section is organised around.
7.1 What the reference prover proves#
ReferenceSchnorrZK13Provider (zk13.providers.ts:68) is a non-interactive Fiat-Shamir proof
over RFC 3526 group 14 — a 2048-bit MODP safe prime, generator 2 — taken from Node's built-in
table rather than hardcoded so the constants cannot drift (zk13.providers.ts:9-18). Since
ZK13_REFERENCE_VERSION (src/crypto/zk13.providers.ts:7) became zk13-schnorr-cp-modp14-v2
it proves two statements under one challenge:
- Schnorr — the prover knows
xwithy = g^x, for theycarried in the proof. - Chaum–Pedersen — the key image
ncarried in the proof satisfiesn = h^xfor the samex, whereh = hashToSubgroup(publicInput)is derived from the public input by both sides.
verify (:102-154) does real group arithmetic on both and refuses the standard degeneracies:
if (y <= 1n || y >= P) return false; // range, on all four elements
if (s < 0n || s >= Q) return false;
if (modPow(y, Q, P) !== 1n) return false; // subgroup membership, on all four
if (proof.nullifierHex !== nullifierFor(keyImage)) return false; // :143
const h = hashToSubgroup(publicInput);
if (modPow(G, s, P) !== (t1 * modPow(y, challenge, P)) % P) return false; // g^s == t1·y^c
if (modPow(h, s, P) !== (t2 * modPow(keyImage, challenge, P)) % P) return false; // h^s == t2·n^cThree details that are correct and easy to get wrong:
- Uniform nonces by rejection sampling (
randomScalarsrc/crypto/zk13.providers.ts:369). The comment names the attack precisely: drawing 512 bits and reducing mod a 2047-bitQleaves the top ~1535 bits of every nonce at zero; two proofs from one secret then over-determine it as a Hidden Number Problem and lattice reduction recovers the secret scalar outright. Sampling at full width and rejecting out-of-range candidates has no bias. - One nonce across both relations, deliberately (
:77-84, and again at:355-357). Two independent nonces would prove "I knowlog_g(y)" and "I knowlog_h(n)" separately and say nothing about whether the samexappears in both — which is the gap a chosen nullifier walks through. This is not the nonce reuse the paragraph above warns about: what leaksxis one nonce under two different challenges, and there is one challenge here. his derived, never carried (hashToSubgroupsrc/crypto/zk13.providers.ts:393). A prover who could choosehwould chooseh = g^kfor a knownk, and thenh^x = y^kis computable from the publicyby anyone holding the proof — the key image would be forgeable without knowingxat all.
7.2 What it does not prove — the statement is prover-chosen#
This is the part a reviewer must not miss, and since 2026-09-07 it is pinned by a test rather
than only written down (crypto.integration.test.ts, "accepts a proof from a secret invented
one line ago").
prove(secret, publicInput) takes the commitment y = g^x from the prover's own secret and
returns it inside the proof. verify(proof, publicInput) reads y from proof.commitmentHex
and checks both relations against that y.
Nothing anywhere constrains which y the prover chose. There is no registry of admissible
commitments, no binding from y to an address, a wNFT, a validator seat or any other identity
in this system, and verify takes no argument that could carry one. So what the verifier learns
is exactly:
"Whoever produced this proof knows the discrete log of some group element they picked, and the key image is the one determined by that element's exponent and this public input."
An attacker generates a fresh x, gets a fresh y, and gets a fresh nullifier — for free, as
often as they like. Therefore nullifier uniqueness means nothing today. Uniqueness of a
nullifier is only a spend-once property when the set of admissible commitments is closed and
each one is bound to something the attacker cannot mint at will. Neither condition exists here.
A nullifier ledger would not repair it: an attacker who wants a fresh unspent nullifier does not
attack the nullifier, they mint a new secret and take one legitimately.
And there is no anonymity set, so there is no anonymity. commitmentHex is g^x and
depends on the secret alone — not on publicInput — so one secret presents the same 512-hex
element in every context it ever proves in, and two proofs from one secret are linked by a
string comparison. The context-separated key image reads as cross-context unlinkability and does
not deliver it: it sits in the same struct as the stable pseudonym that defeats it. What the key
image buys is narrower and real — a nullifier from one context cannot be presented in another.
Pinned by "leaks the link between contexts through commitmentHex, so this is not anonymous"
(crypto.integration.test.ts:178). The module header says the same thing in an imperative, at
zk13.providers.ts:53-59: "Do not describe the key image as cross-context unlinkability."
The bindingTagHex field is bindingTag(y, publicInput) — a plain SHA-256 of the commitment
and the public input. It is not a range proof. It binds nothing an attacker does not
control, and nothing about the payload's magnitude is proved.
It was called rangeProofHex until 2026-09-06, and was renamed. The blast radius was
measured before the change and was three code sites — the field on ZK13Proof in
spec/interfaces.ts, and one write and one read in zk13.providers.ts — with no test naming
it and nothing persisted to migrate, since no Block carries a ZK13Proof anywhere in its
shape. Both the interface and the bindingTag helper now say in words that it never was a range
proof, so restoring the old name has to be a deliberate act against a written refusal rather
than an ordinary tidy-up.
7.3 The nullifier was a prover convention until v2, which meant it detected nothing#
Found and fixed 2026-09-07. Until v2 the nullifier was
sha256(version|nullifier|x|publicInput) — computed by the prover, written into the struct, and
bound into the Fiat-Shamir challenge. Binding it into the challenge is a real property and was
correctly claimed: a third party cannot rewrite the field of an existing proof. What was
missing is that the verifier had no way to check the value was the one the secret determines,
because the verifier does not hold x. verify checked only that nullifierHex was 64 hex
characters.
So the prover was free to pick any 32 bytes, derive the challenge over them, and produce a
perfectly valid proof carrying them. Measured on this tree before the fix: one secret, one
public input, three proofs carrying 08b11374…, aaaa… and bbbb…, all three accepted, all
three with identical commitments. One secret could mint unlimited distinct nullifiers.
That is worse than a missing feature. Determinism was a habit of an honest prover rather than a property a verifier checks, and a double-spend tag that only honest parties compute honestly detects no double spend — the party a nullifier exists to catch is precisely the one not following the convention. Even with the closed admissible set of §7.2 and a chain-state ledger, the v1 construction would still have permitted unlimited double spends.
The fix is the standard key-image construction and adds no dependency: n = h^x where
h = hashToSubgroup(publicInput), and nullifierFor (src/crypto/zk13.providers.ts:448) is
sha256(version|nullifier|n) — recomputed by the verifier at zk13.providers.ts:143, with
the reason for the change written beside it at :135-142 — and a
Chaum–Pedersen proof of equality of discrete logarithms tying that x to the x in the
commitment. The strongest form of the attack — splicing in a self-consistent key image and
nullifier taken from a real proof of another secret, which defeats any check that merely
recomputes one from the other — now fails on the group arithmetic, and that is what the test
"refuses a nullifier that is not the one this secret determines" presents.
7.4 NullifierRegistry was deleted, and why#
zk13.providers.ts:215-235 stands where a reader would look for a nullifier ledger, and says
there is none.
NullifierRegistry was a Set<string> in process memory with spend, isSpent and size. It
had no callers, and — this is the part that made deletion right rather than tidy — it could
not usefully have acquired one. Replay protection that lives on one node's heap is empty after
a restart and is shared with no other node, so two honest nodes would hold different answers to
"is this nullifier spent" and the chain would have no way to settle it. That is the same defect
class that made ValhallaRegistry unusable for quorum. A double-spend ledger has to be chain
state, folded into the state root and replayed from blocks, the way Idunn and Sindri are.
It was deleted rather than kept and labelled, "because a class named for a property is the thing that makes a reader believe the property exists, and this one was already being cited as ZK13 replay protection while protecting nothing."
verifyZK13Batch deliberately does not deduplicate nullifiers across a batch, for the same
reason: a batch-local Set answers "twice in this batch" and reads as an answer to "twice
ever", which is the NullifierRegistry mistake in a smaller box.
What remains is the cryptography, and since §7.3 it is sound within its own frame: the nullifier is deterministic in the secret and the public input and the verifier checks that it is. That makes reuse detectable by anyone who keeps a record. Nothing in this repository keeps one.
7.5 What v2 cost, measured#
Measured here, 2026-09-07, on the host named at the top of this document, twenty iterations after a warm-up:
| v1 (Schnorr only) | v2 (Schnorr + Chaum–Pedersen) | |
|---|---|---|
prove | not separately measured | 87.4 ms |
verify | 118.0 ms | 305.2 ms |
| proof, JSON bytes | 1,834 | 2,922 |
Verification is 2.6× and the proof is 59% larger. Roughly 67 ms of the increase is two subgroup
checks that are strictly redundant — t1 and t2 are pinned by the two verification equations,
so an element outside the subgroup cannot satisfy them once y and n are checked. They are
kept anyway, and the reason is in the code: a check removed as redundant is a check nobody
re-derives when the equation beside it changes. A four-modpow subgroup test also has a cheap
replacement in a safe-prime group — the Jacobi symbol — which is not used here, because a
reference implementation should be obviously correct rather than fast, and a Jacobi routine is a
place a soundness bug can hide.
These figures are a reason to care about §7.2 rather than a reason to optimise: nothing calls either function on any path, so the number that matters is 0 ms × 0 proofs.
7.6 The decision: this is a reference implementation, and the tree is arranged to say so#
Reviewed 2026-09-07 against three options — make it sound, make it honestly a reference implementation, or delete it.
Making it sound is not reachable, and the reason is not budget, it is that the cheap version
of "sound" is a different thing. Binding y to one named identity — the obvious reading of
"bind the statement" — turns the construction into a proof of knowledge of the discrete log of a
known public key, which is a Schnorr signature. This tree already has ed25519 and Gemini, so
that route produces a slower, larger, redundant signature scheme and no privacy at all. The
property that makes a nullifier worth having is "I am one of these N and I will not say
which", and that needs an anonymity set: a linkable ring signature, whose proof grows linearly
in N, or a SNARK over a Merkle-membership circuit. Neither is a variation on the code in this
file. ZK13_PRODUCTION_REQUIREMENTS (src/crypto/zk13.providers.ts:164) carries the five items
as an exported constant so the list is reachable from an editor, not only from this document, and
ZK13_PRODUCTION_DEPENDENCY_NOTE (src/crypto/zk13.providers.ts:205) carries the escalation
beside it.
The dependency cost, measured against scripts/check-deps.mjs on 2026-09-07 — budget 1
direct / 8 transitive, tree currently at 1 direct (@noble/post-quantum) and 4 transitive
(history: the ring signature was chosen and both went to 2 direct on 2026-09-22):
- A linkable ring signature over an EC group would use
@noble/curves, which is already in the transitive tree. Promoting it to direct costsMAX_DIRECT1 → 2 and zero new packages — the cheapest route by dependency count, and still not cheap, because the scheme itself would be hand-written consensus-critical cryptography and the proof carries two scalars per ring member, so the anonymity set trades directly against block size (§2.7). Building it in this group needs no dependency at all and is worse: an element here is 256 bytes, so a ring of 100 is roughly 50 KB per proof. - A SNARK toolchain (
snarkjs+circomlibjsand their trees) is well past 8 transitive packages — the exact count is unmeasured, because measuring it means installing it — and adds a compiled circuit as a build artefact plus a trusted-setup ceremony whose output becomes a verifying key committed to genesis and thereafter consensus-critical. That is an operational event with named participants and a published transcript, not a merge.
Neither was added. Raising the budget is a governance decision, not this agent's.
Deletion was rejected, and the reason is narrow. The blast radius is small — one module, one
barrel line, one type in spec/interfaces.ts, one interface in src/crypto/interfaces.ts, and
tests in two files; nothing persisted, no Block field, no consumer outside tests. What deletion
would destroy is not the prover, which anyone can rewrite, but four defect records embedded
where the next implementer will meet them: the biased-nonce Hidden Number Problem of §7.1, the
prover-chosen nullifier of §7.3, the one-sided gate of §7.7, and the batch counter of §7.8. The
nonce one is a key-recovery bug that a fresh implementation would very likely reintroduce. That
is worth more than the risk of the surface being misread, provided the surface is framed,
which is the condition the rest of this decision satisfies.
What changed so that "reference implementation" is structural rather than a comment:
ZK13Provider(src/crypto/interfaces.ts) — the abstract contract an integrator programs against, and previously the one place in the chain with no warning at all — now states exactly what atruefromverifymeans, and that the signature has no parameter that could carry an admissible commitment.ZK13Proof(spec/interfaces.ts) — the protocol shape, and the most authoritative file — says it is produced and consumed by a reference implementation only, andcommitmentHexsays the prover chooses it and that it is a stable pseudonym. Previously it said only "Public statement y = g^x mod p", which is true and is the omission that misleads.- Two tests turn the findings from prose into executable facts, and the first carries an instruction to rewrite rather than delete it if the statement ever becomes admissible.
What was considered and not done. Moving the module out of src/crypto/ was rejected:
GodCypher (§6.2) is also an unused library living there, and the hybrid KEM (§3.3) has no
on-chain caller either, so moving
only ZK13 would assert a distinction that does not exist and would break this document's own
organising principle. Removing it from the barrel was rejected for the same reason —
src/index.ts:10-16 already carries a shared statement covering GodCypher and ZK13 together —
extended at :18-25 with what ReferenceSchnorrZK13Provider specifically is not — and narrowing
one half of it would leave the other reading as an endorsement. The taxonomy in §12 is where that
distinction is drawn, and it is drawn for every module at once.
What changed on 2026-09-10: the gate is reached. Nothing else changed. The section above
and the whole of §7.7 were written about a refusal that was constructed nowhere outside a test,
and docs/BUILD_STATUS.md recorded the corresponding gate as met, vacuously — it held because
the feature was absent. A gate that holds by absence stops holding on the day somebody adds the
feature, and it stops holding silently: the shortest path from "I need a proof here" to a
passing test is new ReferenceSchnorrZK13Provider(), and nothing about that line looks wrong at
a review.
So the selection is made once and from the node's own mode. talosZK13Provider
(talosZK13Provider src/crypto/zk13.talos.ts:103) returns StrictProductionZK13Provider in both modes —
delegating in development, refusing in production — and BlockchainCore holds what it returns —
BlockchainCore.zk13 (src/core/blockchain.ts:2344). talosZK13Policy (src/crypto/zk13.talos.ts:81) derives
allowReferenceProofSystem from the mode rather than accepting it, so the switch that would
re-enable the reference system in production is not a field any configuration can reach; the
constructor refusal of §7.7 point 1 remains, now as the second lock rather than the only one.
The component is named Talos in docs/NAMING.md — the bronze guardian who walked the shore
and let no ship land, and whose single vein was closed by one bronze nail.
Three things this deliberately does not do, because each is the way this change could be misread:
- It binds no circuit and shortens
ZK13_PRODUCTION_REQUIREMENTSby nothing. All five items are still missing. Two of them — a closed on-chain set of admissible commitments, and a trusted setup if the route is a SNARK — are chain state and an operational event with named participants and a published transcript. Neither becomes true by wiring, and the argument at the top of this section is untouched. - It puts no proof on a block path. No
Blockcarries aZK13Proof, and nothing insrc/callsproveorverifyoutside the two ZK13 modules. A node holds a provider; holding is not verifying, and the field's own comment says so at the declaration. - It does not make the refusal worth much. A gate on a proof system with no anonymity set gates nothing worth gating. What it buys is that the failure, when a ZK13 call site is finally added by somebody who has not read this file, is a production node that refuses rather than a production node that accepts a reference proof.
Both halves are re-read against the built tree by scripts/check-security-claims.mjs
(zk13-gated-not-absent), which constructs a production-mode node from the Midgard genesis and
makes it refuse a genuinely valid reference proof — with a development node accepting the same
proof as the positive control, because a refusal with no control is indistinguishable from an
outage — and then re-checks that no caller has appeared. The claim that cannot be checked
there is registered rather than hidden: zk13-circuit-is-real is UNVERIFIABLE HERE, because no
predicate in this repository can distinguish a verifying key produced by a real ceremony from 32
bytes generated on a laptop. tests/integration/zk13-gate.integration.test.ts holds the
executable version of everything in this paragraph.
7.7 The production gate is a written refusal, not an active control#
The heading was true until 2026-09-10 and is now HALF true, which is why it is kept rather
than rewritten. Every branch below is real code that does real work when it is reached, and
until that date nothing reached any of them: no CryptoRuntimePolicy was constructed anywhere in
src/, so no instance of this class existed outside a test. That half has changed — Talos (§7.6)
now selects this class from the node's mode and every BlockchainCore holds one, so the refusal
is executed on every production node. The other half has not: there is still nothing to refuse,
because no ZK13 proof is produced or verified on any path. Written refusal, now reached, still
with no traffic is the accurate sentence, and the module's own comment says the same at the
class docstring.
StrictProductionZK13Provider (src/crypto/zk13.providers.ts:270) does three things:
- Refuses at construction the combination that would re-enable the reference system in
production —
{ mode: 'production', allowReferenceProofSystem: true }— because "a misconfiguration should fail where it is written, not on the first proof that happens to matter." (:275-281.) - Gates
proveunder production:mode === 'production' && !allowReferenceProofSystemthrows (:285-287). - Gates
verifyunder production, returningfalserather than throwing, because that is the shape of the interface and every caller treats a throw as an outage rather than as a rejected proof.
Point 3 is worth reading exactly, because the branch is narrower than the property:
if (this.policy.mode === 'production' && proof.proofVersion === ZK13_REFERENCE_VERSION) {
return false; // :295-297
}
return this.referenceProvider.verify(proof, publicInput); // :298The branch refuses only a proof that declares the reference version, and delegates everything
else. That is not a hole, and the reason is one line further down the call: the reference
verifier's own first statement is if (proof.proofVersion !== ZK13_REFERENCE_VERSION) return
false (zk13.providers.ts:103). So under mode: 'production' the composition refuses every
proof — the reference version by the gate, and everything else by the version check it delegates
to. There is no version string that gets through. Stated because the two halves live in different
classes and a change to either alone would break it silently.
That point 3 exists at all is the fix, and the reasoning behind it generalises well past ZK13:
provethrew in production andverifydelegated unconditionally, which is the wrong half: the honest party is the one who callsprove, and refusing them changes nothing an attacker has to do. An attacker only ever callsverify— with a proof they produced themselves, from their own copy of a reference prover that no policy of ours reaches. A gate shaped like that does not restrict the reference system, it restricts everyone except the person exploiting it.
No longer dormant, and still with nothing to refuse. Since 2026-09-10 this class is
constructed by talosZK13Provider for every node (§7.6) and a CryptoRuntimePolicy is derived
from the node's mode — but no ZK13 proof is produced or verified on any block, transaction or
network path, and no Block carries one. docs/BUILD_STATUS.md records the corresponding
production gate as met and no longer vacuously, while saying in the same row that the feature
is still absent: the gate now holds because a production node refuses, AND the thing it refuses
has no callers. Two sentences, both true, and the second is the one a reader most needs.
It is kept because ReferenceSchnorrZK13Provider is exported from the barrel
(src/index.ts:27, under the statement at :10-25) and is a working prover whose proofs verify. Deleting the gate would leave
that export with nothing anywhere saying it must not carry a production claim. Whoever binds a
real prover has to reach this file, and the decision should still be there when they do.
What would make it real is item 5 of ZK13_PRODUCTION_REQUIREMENTS, and items 1 to 4 have to
land first: a gate on a proof system with no anonymity set gates nothing worth gating.
7.8 The batch counter, and the three things called ZK13#
verifyZK13Batch (:325) reports attempted, verified and failures separately. verified
used to be results.length — the number attempted — so a batch of three with one forgery
reported verified: 3. That is the single number a consensus surface reads to decide a batch is
good, and it was structurally incapable of being anything other than the batch size.
ZK13 names three unrelated things in this ecosystem, and docs/NAMING.md:110 says so rather
than letting a reader discover it: the proof system, the zk13str_ address format, and the ZK13
token standard. Two consequences worth stating flatly, because both are the kind of coincidence
that makes a reader assume a dependency where there is none:
zk13str_addresses share nothing with this module but the name.deriveAddress(src/crypto/signing.ts:56) issha256of a raw ed25519 public key truncated to 40 hex, with asha256checksum tail. The citation in this bullet readsigning.ts:70until 2026-09-07 and was 14 lines out; §1.1 had the right line all along, which is exactly the divergencenpm run citationsnow catches. It imports nothing fromzk13.providers.ts, carries no proof, involves no group arithmetic, and is unaffected by every finding in this section. The identity layer's use ofzk13str_addresses is real and is entirely independent of whether ZK13 the proof system exists at all.- The ZK13 token standard assumes nothing this implementation lacks.
docs/ZK13_TOKEN_STANDARD.mdis a contract interface involving no proofs; it never referencesZK13Proof,prove,verifyor a nullifier, its own header records the collision, and its §7.4 already forbids a token from claiming identity or backing it does not have. Checked 2026-09-07: there is nothing in it to resolve.
8. Lethe — wNFT envelopes, src/crypto/wnft-envelope.ts#
Registry entry at docs/NAMING.md:109. Named for the river of forgetting, because the chain
cannot forget: every node keeps every block forever, so a private payload written on chain is
written for everyone who will ever run this software, including whoever breaks that cipher in
twenty years. "Burn" applied to on-chain ciphertext removes a row from current state and
nothing else — a promise the data structure cannot keep. Lethe makes forgetting possible by
making sure the chain never learned.
the chain holds a salted commitment, and nothing else
the holder holds the payload, the ciphertext, and the opening that ties them together8.1 The commitment#
commitEntry (wnft-envelope.ts:338):
commitment = HMAC-SHA-256(key = salt, msg = label ‖ wnftId ‖ slotId ‖ version ‖ name ‖ payload)
salt = HKDF(ikm = opening, salt = slotId, info = LABEL_SALT ‖ wnftId ‖ version)Binding rests on collision resistance: a second (name, payload) pair with the same
commitment is an HMAC-SHA-256 collision. Hiding rests on HMAC being a PRF under a uniform
secret key, so the output is indistinguishable from random whatever the payload is
(:321-330).
That second half is the reason a bare sha256(payload) is the wrong primitive here, and the
reason is worth memorising: when the payload is a country, a birth year or a yes/no answer, the
digest is the value to anyone with a dictionary, and two entries holding "Romania" produce
the same 32 bytes on a public ledger forever. The salt is the HMAC key rather than a prefix
because HMAC gives the PRF argument directly and is not exposed to length extension, at the same
cost (:331-332).
Hiding is computational and conditional on the opening staying secret (:334-336). Once an
opening is disclosed, that commitment is open to whoever holds it, forever, because the chain
keeps the commitment forever.
commitmentMessage (:254) binds the wNFT, the slot, the version, the entry name and the
payload, so a holder cannot open a passport commitment as if it were a nickname, and a
commitment cannot be lifted out of one entry and presented as another's. Every field is
length-prefixed through lp() (:178), so the concatenation is unambiguous.
LETHE_CHAIN_FIELDS (:130) publishes the complete list of what goes on chain — scheme,
wnftId, slotIdHex, version, commitmentHex — as data rather than prose, so the
identity layer can assert it and a future change that quietly adds a sixth field fails a test
instead of shipping.
LETHE_ABSENT (:122) is the canonical "this slot holds nothing" value. Committing it into a
slot from the day the wNFT is created makes the presence of an entry as private as its value:
an observer sees a slot that has always been there and cannot tell an empty one from a full one.
It costs one commitment.
slotIdHex is random, not derived from the name (:135-139), because a derived label can
be recovered by anyone who later obtains the holder's seed, and the whole point of a burn is that
recovery must stop being possible.
8.2 The two-layer seal, and the AAD binding#
Layer one — the local envelope, LETHE_ENVELOPE_LOCAL (:71). sealEntry (:680):
AES-256-GCM under localContentKey (:663) = HKDF(opening, salt = slotId, info =
LABEL_CONTENT_KEY ‖ envelopeBinding).
Layer two — the recipient envelope, LETHE_ENVELOPE_KEM (:74). sealEntryForRecipient
(:743): hybrid ML-KEM-768 + X25519 encapsulation to the recipient, then AES-256-GCM under
kemContentKey (:717) = HKDF(sharedSecret, salt = commitment, info = LABEL_KEM_KEY ‖ suite ‖
envelopeBinding ‖ digest(recipientPublicKey)).
Hybrid rather than bare, for the reason Aegis gives (:734-736). Note §3.3: this is the hybrid
KEM's only intended surface on the chain, and it has no caller today. The primitive itself
does have a production caller — operator key tooling — but that runs off the node, so it puts
nothing behind this envelope.
The AAD is the envelope binding, and that is what welds a ciphertext to one chain record.
envelopeBinding (:274) is scheme ‖ wnftId ‖ slotId ‖ version ‖ commitmentHex, each
length-prefixed. Without it, a ciphertext is a free-floating blob that decrypts under whatever
key it is handed, so "an attacker who can rewrite the holder's index moves last year's passport
into this year's slot and the holder's own tooling reports a value that was never committed
there" (:674-678). The KEM variant appends the KEM ciphertext to the AAD as well (:754,
:784), so the encapsulation cannot be swapped.
The AAD deliberately excludes the entry name (:265-272). A custodian holding a sealed
envelope must be able to reconstruct the AAD to open it, and the name is the one part of the
path that is not already on chain. Putting it in the AAD would mean shipping it in the clear
beside the ciphertext, which hands a storage provider the field list of an identity document for
free. The name travels inside the plaintext, where GCM authenticates it and the commitment
binds it. That is a subtle and correct choice; do not "simplify" it.
The recipient can read the payload but cannot verify it against the chain, because the
opening is not in the envelope (:738-741). That separation is deliberate: a storage provider
that could open the commitment could confirm guesses about a low-entropy value it is merely
holding bytes for.
8.3 Disclosure#
discloseEntry (:478) hands one verifier one entry at one version: name, payload, opening,
audience, issuedAtMs, expiresAtMs and a 16-byte nonce. Default TTL is 10 minutes
(:441) — "a disclosure is a hand-off, not a credential." Nothing is submitted, so the chain
never learns that a disclosure happened.
The signature is optional and does not make the value more true (:465-470). The commitment
on chain already does that, and anyone holding (payload, opening) can produce a valid opening.
What the signature establishes is consent: that the holder chose this verifier, at this time,
for this entry. That is an audit property, not a confidentiality one, "and the difference is
stated because a verifier who assumes otherwise will build a forwarding check on it that does
not hold."
The disclosure signature is plain ed25519, not Gemini, and the reason is stated
(:472-476): a disclosure lives for minutes and is verified immediately, so it has no
harvest-now-decrypt-later exposure — which is the property that makes long-lived keys hybrid in
this repository. A holder who wants a post-quantum consent record can sign the same
disclosureStatement with signGemini alongside; the format does not have to change.
8.4 The vault, and rotation#
WrappedVault (:839) is two layers on purpose (:829-837):
index ← encrypted under vaultIndexKey(seed, wnftId)
seed ← wrapped under deriveVaultWrappingKey(walletPrivateKey, wnftId)A wallet key rotation therefore rewrites 32 bytes and leaves the index — which may be large and replicated across devices — untouched, and leaves every commitment on chain valid. A single-layer design would force a full re-encrypt on every rotation, and "a holder who cannot complete one is a holder whose identity becomes unreadable because they changed a key. That is a data-loss bug."
deriveVaultWrappingKey (:860) derives from a signature over a fixed statement, not from
the raw private key (:848-859). ed25519 is deterministic (RFC 8032), so the same wallet always
produces the same 64 bytes for the same statement, and HKDF turns that into the wrapping key.
The reason is forward-looking and worth keeping: a signer that never exports its key — a hardware
wallet, a remote signer, a future keystore that only offers sign — can still produce this. A
derivation that needs the raw private key silently makes those unsupported. The statement names
the wNFT, so one wallet holding several domains does not use one key for all of them.
rotateVaultWallet (:954) unwraps the seed under the old key and rewraps under the new. The
index ciphertext comes out byte-identical; no chain transaction, nothing re-committed, nothing
re-disclosed. Both seed and index are bound by AAD — seedAad (:871) includes the wallet
public key, so the wrapper cannot be swapped, and indexAad (:875) the wNFT id.
What it does not do (:948-952): recover a lost wallet key. If the wallet key is gone the
seed is gone, and with it the openings, and with them any ability to disclose or decrypt. The
holder's independent backup is the 32-byte seed itself. "That is stated rather than solved:
there is no escrow here and no recovery service, because either one is a second party who can
read the identity."
putEntry (:1001) gives every version its own opening, never a reused one (:993-999).
Two consequences: a disclosure of version 3 says nothing about version 4, and a commitment never
repeats — an observer who sees the same 32 bytes twice on this chain is looking at a bug, not at
a coincidence.
8.5 What Lethe is running today#
Live through Skidbladnir (src/wallet/skidbladnir.ts:31-42): commitEntry, createVault,
discloseEntry, openEntry, putEntry, rotateVaultWallet, sealEntry, unwrapVault,
verifyDisclosure, wrapVault — used at skidbladnir.ts:343, 368, 768, 769, 899, 900, 920,
974, 1014, 1055-1061. unwrapVault also at src/wallet/at-rest.ts:118. The chain half consumes
isWnftCommitment at src/identity/wnft.ts:5.
Not live: sealEntryForRecipient and openEntryAsRecipient (§3.3).
Two limits carried from docs/SECURITY.md:562-570 and not fixable inside this module: a
disclosed opening cannot be revoked, because the chain keeps the commitment forever; and
burnEntry removes references in a garbage-collected runtime with immutable strings, which is
not zeroing — a heap dump, a swap file or a core dump taken before collection still holds the
opening.
9. Key custody — what the genesis builder will and will not accept, src/ops/fulla-public.ts#
The keys that seal blocks on Asgard and authorise movements of its treasury were not produced by this repository and cannot be derived from it. How they are produced and held is operational practice and is not described in this book. Treasury movements require several independent signers; no single person can move it. What this section records is what the code promises about the public material that reaches a genesis, because that is the part a reader can check.
Key custody is not Fafnir (§5). Fafnir is one running node's key, on one machine, at rest, in
a file. A key reaches Fafnir already made, and the two never meet; fulla-public.ts:25-28 says so
at the top of the module rather than leaving it to be inferred.
9.1 The public half holds no private-key operation#
src/ops/fulla-public.ts contains no private-key operation of any kind: it does not sign,
does not derive a public key from a private one, and does not import any module that does. That
is not a comment. tests/integration/fulla-custody.integration.test.ts:497-518 reads the file's
own source with block comments stripped and fails if createPrivateKey, generateKeyPair,
signMessage, publicKeyHexFromPrivate, deriveAccountKeypairFromSeed, privateKey or
randomBytes appears in the code.
9.2 The type-level property, and the two textual sweeps#
CustodyPublicBundle (src/ops/fulla-public.ts:203) extends the bundle data with a brand keyed
on PUBLIC_ONLY, a unique symbol declared at :202 and not exported. No other module can
write a value of that type, so parsePublicBundle (src/ops/fulla-public.ts:253) is the only
function in any program that can produce one, and buildCustodyGenesis accepts nothing else.
"The genesis builder cannot be handed a secret" is enforced by tsc, not promised in a
document and not reviewed by a person.
parsePublicBundle takes the file's text, not a parsed object, because the strongest check
available is about what is in the file — a private key sitting in a field JSON.parse would
happily keep — and an object has already lost the evidence of how it was written. Two textual
defences:
assertExactKeys(src/ops/fulla-public.ts:213) refuses any object carrying a field the format does not define. A bundle is a closed format and an extra field is somewhere for a secret to sit. The offending field is named and never echoed.- Every 64-hex run anywhere in the text must be one of the values the format put there
(
fulla-public.ts:388-400). A private key is exactly 64 hex characters, so this says there is nowhere in a valid bundle for one to sit.LOOSE_HEX64(src/ops/fulla-public.ts:211) excludes longer runs rather than slicing into them, and the offending value is not printed.
Two more refusals in the same function: two slots may not share a public key, because one signer
counted twice is a quorum that is smaller than it looks (fulla-public.ts:336-340); and every
address must be one nobody can derive from this repository — reproducibleAmong
(fulla-public.ts:372), the check core/genesis.ts already owns, applied a step earlier,
because a repo-derivable key is a validator seat whose private key is printed in the source.
9.3 Proof of possession#
Every public entry carries a signature by its own private key over popMessage
(popMessage src/ops/fulla-public.ts:154), verified in parsePublicBundle at fulla-public.ts:353-360.
The message binds the generating session's id, the slot and the public key itself, so a proof
cannot be replayed from another session, two entries cannot be swapped while both still verify,
and the signature cannot be separated from the key it is presented beside.
It catches two failures. A private key pasted into publicKeyHex: the signature no longer
verifies under it, so the whole bundle is refused. A mistyped public key: nothing else in a
genesis notices one — the address derives cleanly from whatever 64 hex characters are there,
validateGenesisSpec accepts it, and the network would launch with an address authorised to
seal blocks that nobody can ever sign for. The proof of possession turns that into a refusal
before a genesis exists, and the error says which of the two cases it is.
9.4 What this section does not claim#
It makes no claim about how the private halves are generated, stored or used; that is operational
practice outside this repository, and no test here can observe it. There is still no
hardware-security-module path for any key (§12). Building a genesis is not launching a network:
the realm record in core/snotra.ts is a code change a person makes in a release, and nothing in
this module touches it (fulla-public.ts:64-70).
10. The seams#
Things that are individually fine and interact in a way worth knowing:
- The verify pool is ed25519-only. Its wire format hardcodes a 32-byte key and a 64-byte
signature (
verify-pool.ts:306,verify-worker.ts:77-79). If transactions ever go hybrid, the parallel path does not carry them, and the 82% of block-acceptance cost it recovers goes with it. That is a second, structural cost of §2.7 that the byte arithmetic does not show. signatureAlreadyVerifiedskips arithmetic, not rules.src/core/transaction.ts:71-85and:126. The flag exists because doing the work twice would give back everything the pool won. Everything else still runs — above all the id binding attransaction.ts:125— andverify-pool.integration.test.ts:156-168pins that a mutated transaction is still refused withtransaction id does not bind its contentswhen the flag is set. Do not extend that flag to skip anything else.wnft-envelope.ts,verify-pool.tsandkeystore.tsare not in the public barrel (src/index.tshas 69 lines and none of the three). They are internal.aegis.ts,signing.ts, both GodCyphers andzk13.providers.tsare exported, andsrc/index.ts:10-16and:31-35carry the running/library distinction at the export site.- The randomised ML-DSA signature and dedup. §2.5. Anything that ever caches or dedups on signature bytes is wrong for Gemini, and would be wrong silently.
11. Where the code and docs/SECURITY.md still disagree#
docs/SECURITY.md was corrected on 2026-09-06 and is now broadly accurate on this layer — the
four false claims in §3 are marked and the dormant surfaces are stated in §10. What follows is
what did not line up, checked against the tree on the same date.
Items 2, 4, 5, 6 and 7 were acted on later the same day and each carries a Fixed or Half-fixed note saying exactly what changed. In every case only the claim moved: no missing feature was implemented, which is the point of the exercise and the thing not to misread. Items 1, 3, 8 and 9 stand open.
Every row re-walked at the line on 2026-09-07 against commit 9220195. Nothing here was
deleted for having been resolved: a closed row keeps its entry with the resolution beside it,
because the record of what was once wrong is the part that stops it being written again. Two rows
moved: item 1 turns out to have been half-fixed and then re-broken by ordinary drift, and
item 3 is now worse than when it was written. Both are marked. Every docs/SECURITY.md line
number below was also stale — that document has grown — and each has been re-pointed.
consensus/poe.ts:304is the wrong line.docs/SECURITY.mdandaegis.tsboth cited it as where Valkyrie attestations are signed with plain ed25519. Line 304 wasexport function valkyriePayload(— the payload builder, which signs nothing. Half-fixed, and then partly re-broken by drift. Re-walked 2026-09-07:aegis.ts:437was corrected and now citesconsensus/poe.ts:326. That is now stale too —poe.tshas grown andsignMessageinsidevalkyrieAttestis atconsensus/poe.ts:351;:326is a docstring line abovevalkyriePayload.aegis.ts:24still citesconsensus/poe.ts:304and was never corrected.docs/SECURITY.md:274(the surface table row, previously:240) still cites:304.docs/book/CONSENSUS.md:1009citespoe.ts:304forvalkyriePayloaditself, which is now atconsensus/poe.ts:329.
The claim is true in all four places and every citation is wrong, which is exactly the failure mode
npm run citationswas added to catch and the reason its scored form is a symbol in backticks followed by asrc/path.ts:NNNrather than a bare path. This document owns none of those four files. Correct anchor for whoever does:valkyrieAttest(valkyrieAttestconsensus/poe.ts:367), signing at:351.
- The hybrid KEM row overstates its reach.
docs/SECURITY.md:184(was:182) lists "Key encapsulation — wNFT envelopes (Lethe), GodCypher-PQ" as hybrid, in a table whose other rows describe running surfaces. Both are libraries:GodCypherPQProviderhas no production caller, and Lethe'ssealEntryForRecipient/openEntryAsRecipientare called only fromtests/integration/lethe-wnft.integration.test.ts:544(was:487). On a running node the only KEM that executes is the bare ML-KEM-768 in Bifrost. §10 of that document does say GodCypher does not run (docs/SECURITY.md:643-652, was:586-595); the §3 table does not carry the qualifier, and the two read differently. Fixed 2026-09-06, and the fix overshot — re-fixed 2026-09-08. The 09-06 pass rewrote theSECURITY.md§3 row as "hybrid … available, not used: no production caller" and matched the §1 assumption row and the "Hybrid key encapsulation is not global" paragraph to it. That traded one wrong reach for another: operator key tooling callsencapsulateHybrid(src/ops/hofvarpnir.ts:149) anddecapsulateHybrid(src/ops/hofvarpnir-host.ts:142) from shipped commands. All three places inSECURITY.mdnow carry both halves — a production caller exists, and it never executes on a running node — because the second half is the one a threat model needs and the first is the one an operator does. §3.3 has the argument.
- The ZK13 row in the §3 table reads as a deployed surface — and is now WRONG AS STATED, not
merely unconditional.
docs/SECURITY.md:186(was:184) still reads "Zero-knowledge | ZK13 Schnorr NIZK over RFC 3526 MODP-14 | Uniform nonces; nullifier bound into the challenge", alongside rows that describe things the chain does.Re-checked at the line 2026-09-07, and this row got worse rather than staler. "Nullifier bound into the challenge" is a description of v1, and §7.3 is the record of why that construction detected nothing: binding stopped a third party rewriting the field and left the prover free to pick any 32 bytes. The proof system is now
zk13-schnorr-cp-modp14-v2(ZK13_REFERENCE_VERSIONsrc/crypto/zk13.providers.ts:10), where the nullifier is recomputed by the verifier from a Chaum–Pedersen-proved key image. So the row now names, as the property, the exact thing that was replaced for not being one.That document's §10 is fully current —
docs/SECURITY.md:653-687carries the reference- implementation framing, the three limits and both corrections — so the defect is confined to the table row, which carries no marker at all. The row is also still silent on §7.2: the statement is prover-chosen, so nullifier uniqueness is not a spend-once property even if a ledger existed. Suggested replacement for that Notes cell: "Reference implementation, on no path. Uniform nonces; the verifier recomputes the nullifier (v2). Prover-chosen statement, no anonymity set, no ledger — see §10." Not made here; this document does not own that file.
~0.12 ms verifyfor ed25519 is pre-cache.docs/SECURITY.md:182(was:180). Againstsigning.ts:114, 0.12 ms is 53 µs ofcreatePublicKeyplus 70 µs of verification — the uncached cost. With the key cache warm, measured here: ~14,800 verifications/s, about 68 µs. The document's figure is roughly double the steady-state one. Not a security claim, but it is the number a capacity estimate would be built on. Fixed 2026-09-06. The row now carries both numbers with the regime each belongs to, and a note under the table attributes 53 µs + 70 µs tosigning.ts:111-116as the pre-cache in-source figures and the ~68 µs to the measurement in §2.6 of this document.
aegis.ts:487claimed transactions were "PQ-capable from block zero and opt-in per account". They are not, and were not.ChainTransactionhas no PQ field andtransactionSigningPayload(src/core/transaction.ts:22-36) has no slot for one. §2.7. This is a disagreement betweenaegis.tsand the code rather than between the code andSECURITY.md, and it is the one overstatement in this layer's source comments that a reader could act on. Fixed 2026-09-06 by correcting the claim: the sentence went fromaegis.tsand was replaced by a paragraph naming the missing field and recording the S8 fix as unimplemented. Implemented 2026-09-10.ChainTransactionnow carriespqSuite,pqPublicKeyHexandpqSignatureHex;transactionSigningPayloadfolds the first two absent-when-absent, so a classical transaction's bytes and id are unchanged;validateTransactionStatelessrequires both halves throughverifyGeminiwhen they are present and refuses a partial or unaccepted composite outright. Opt-in per account is now true. The consequence the 2026-09-06 correction stated is also true and is not softened: adoptingrequiredchain-wide is a consensus change and needs a flag day. §2.7 carries the measured cost.
rangeProofHexis not a range proof. §7.2. The field is a SHA-256 binding tag —bindingTag(src/crypto/zk13.providers.ts:464), cited as:253when this row was written. NeitherSECURITY.mdnorspec/interfaces.tssaid so. Fixed 2026-09-06 by renaming the field tobindingTagHex. The blast radius was measured first and was three code sites —spec/interfaces.ts, andprove/verifyinzk13.providers.ts— with no test referencing it and no persisted or on-chain instance to migrate, since noBlockcarries aZK13Proof. Re-verified 2026-09-07 at the line and CONFIRMED:bindingTagissha256(version|binding|y|publicInput)over two values the prover already controls, and norangeProofHexidentifier survives anywhere in the tree.spec/interfaces.tsand thebindingTaghelper now both say in words that it never was a range proof. The prover-chosen-statement finding of §7.2 is also now stated in theReferenceSchnorrZK13Providerheader and besidenullifierFor, where a reader of the code meets it.
- The verify pool has no house name and no
docs/NAMING.mdentry, against the standing rule that a component gets both.docs/NAMING.mdhas rows for Aegis, Gemini, GodCypher, Lethe, ZK13, Gaia and Fafnir; there is no row forsrc/crypto/verify-pool.ts. Half-fixed 2026-09-06:docs/NAMING.mdnow has a "Components awaiting a name" section carrying the pool as an open debt. It is still unnamed — naming it is not this document's to do, and was not done.
- The
685,217-verification figure and "two audits" for the verify pool are not in this repository. The two internal audit documents present, both dated 2026-08-30, do not mention the pool. §4.5 reproduces an equivalent measurement (700,416 verifications, zero false valids) so the property has evidence in this tree, but the provenance of the cited figure is unverified from here.
- "A key custody policy for validator, genesis and treasury keys is still owed."
docs/SECURITY.md:610-612. Added 2026-09-07. The substance is still true and the sentence is now imprecise, which is a different defect and is worth separating. Since commit9220195the code carries a custody scheme whose public half §9 describes — proof of possession, and a bundle format the genesis builder cannot be handed a secret through. Asgard's keys were produced on 2026-09-24 and the chain launched on 2026-10-05; how those keys are held is operational practice and is not described in this book. The same bullet's first two sentences — "Fafnir covers node identity only. The dev genesis keypairs and.owner-identity.local.jsonare untouched" — are unchanged and still exactly right. Open, and it is a governance item rather than a code one.
Items 1, 3, 8 and 9 are recorded for governance rather than resolved: this document owns none of the files that would have to change, and item 8's provenance cannot be established from inside this repository at all. Items 2, 4, 5, 6 and 7 were corrections to text and to one field name, and were made — none of them changed what the code does.
12. What is sound, what is a library, and what is a claim#
Read this section alone and you know what to trust.
Every entry re-walked at the line on 2026-09-07 against commit 9220195. No entry was
deleted; two gained a line, one gained an entry (key custody, §9), and eleven citations had drifted and
were re-pointed — the old number is given wherever the drift is more than a few lines, because a
reader holding an older copy needs to know which of the two they have.
Sound — running code, enforced on a live path, with the property tested#
- Hybrid signature verification is a true AND.
verifyGemini(aegis.ts:236) requires both halves, matches the suite exactly with no fallback, checks the surface against what the caller expected, recomputes the address from both public keys, and bounds every length before it hands bytes to a verifier. A valid classical half with a forged PQ half fails, and the reverse. There is no downgrade path and no policy value that can introduce one. Live atpraeco.ts:178,287andbifrost.ts:361,399,476,521— cited as:185,223,291,336, then:194,232,300,345, then these; see §2.8 on why the line is the wrong thing to cite here. - An unknown suite is rejected, never downgraded to.
aegis.ts:244;suiteAccepted(src/crypto/aegis.ts:586, was cited:535) is an exact-match allowlist with no wildcards, and since 2026-09-10 it has a production caller:aegisAdmits(aegis.ts:929) checks it before any requirement, so an unrecognised suite fails identically underoptionalandrequiredrather than being read as "no post-quantum material" by the lenient one. - The hybrid address commits to both public keys (
aegis.ts:156), and both production verifiers pass the address, so the binding is checked rather than merely available. - The composite representative is modelled on the IETF composite-signature draft and carries
its label and OID,
MLDSA65-Ed25519-SHA512,1.3.6.1.5.5.7.6.48(aegis.ts:194-196), for reference only: it is not byte-compatible with the draft and the wire carries the house suite string (§2.2; this bullet read "the registered standard construction" until 2026-11-16). - The FIPS 204 sizes are measured, not copied from a page still publishing round-3 figures
(
aegis.ts:44-56). - Parallel signature verification answers exactly what serial verification answers. Structurally (§4.5, points 1–5) and by measurement: 700,416 verifications under deliberate preemption, zero false valids, zero false invalids. Every one of seven fallback conditions returns the serial answer; none returns a partial result.
- The verify pool's degradation is temporary and reportable, with a backing-off cooldown and
verifyPoolState()read by three surfaces. Only genuinely permanent conditions are permanent. - Fafnir seals node keys correctly when a passphrase is set. scrypt at the OWASP floor
(measured here: 128.1 MiB, 254 ms per derivation), AES-256-GCM, KDF parameters as AAD,
parameters from disk bounded before use, fresh random 96-bit IV per write, atomic 0600 write
with
sync()beforerename. - Fafnir never falls back to a new identity. Exactly one condition returns null — the file does not exist. Every other outcome is a typed refusal that says nothing was loaded and nothing was written.
- Fafnir refuses a plaintext file when a passphrase is set, because it is indistinguishable from an attacker's plant and adopting it would have the node report the substituted keys as encrypted at rest.
- Lethe's commitments are hiding as well as binding — salted HMAC-SHA-256, fresh opening per version, so equal payloads never produce equal commitments on a public ledger.
- Lethe's envelopes are welded to one chain record by their AAD, and the entry name is deliberately kept out of the AAD and inside the authenticated plaintext.
- Lethe's vault rotation is 32 bytes. No re-encrypt, no chain transaction, no commitment invalidated.
- The ed25519 key caches are pure and bounded, so a peer cannot grow one without limit and a cache miss costs a rebuild rather than a wrong answer.
- Accretion's AAD binds a chunk to exactly one place. Added 2026-09-10, §13.1. Suite,
spaceId,epoch,indexandchunkCountare all in the additional data and in the per-chunk key derivation, so a chunk of one space cannot be served as a chunk of another, a chunk from before a rotation cannot be served after it, a document cannot be silently reordered, and a set cannot be re-framed as a shorter set. Four substitutions, four fields, one test each. - Accretion's Merkle root pins the leaf list AND the leaf count, is domain-separated between leaf and internal hashes, promotes an odd node rather than duplicating it, and refuses a proof that is short or carries leftover elements. Verification takes no key, so a relaying peer that may not read a hostless space can still refuse to pass on a corrupted chunk. §13.1.
- Accretion's plaintext length is authenticated under the space key. Added 2026-09-10. It
travels inside the sealed bytes rather than in the manifest, so a peer cannot resize the
document a reader reassembles, and rather than in the chunk header, so a seeder does not learn
the exact content length. This closed a live defect; see §13.1 and
docs/SECURITY.md§7b.3. - Occultation's epoch key reaches a participant through the hybrid KEM, ML-KEM-768 and X25519, with the thread, the epoch, the participant and the KEM ciphertext all welded into the key derivation and the GCM AAD — so a wrap cannot be moved into another thread, forward into another epoch, or onto another member. An unknown suite is refused by name, never attempted. §13.2.
- Occultation's message key depends on the whole thread history.
prevHexis in the derivation, so a message cannot be re-encrypted into a different position: a different position is a different key. §13.2. - Occultation's post commitment is hiding, and its wrap commitment is deliberately not — and the asymmetry is argued rather than assumed. §13.2.
A library — correct, tested, and called by nothing on a production path#
Each of these is a real capability available to something that embeds this code. None is a property of the chain.
GodCypherWebCryptoProviderandGodCypherPQProvider. Three-way encryption, both providers, no production caller. No block or network path carries aGodCypherPayload. Amended 2026-10-30:GodCypherPQProviderhas left this list for the timestamp path — it seals each GodCypher timestamp's raw evidence once three parties are configured (§14). The classical provider is still here, and the sentence about blocks still holds for both.GodCypherWebCryptoProvider(src/crypto/godcypher.webcrypto.ts:50, was cited:30),GodCypherPQProvider(src/crypto/godcypher.pq.ts:77, was cited:41),src/index.ts:10-16.encapsulateHybrid/decapsulateHybrid, and the whole KitchenSink hybrid KEM — on the node only. Both of its callers in the chain are still absent: a library (GodCypher-PQ) and an untaken code path (Lethe's recipient envelope). It is not unused in the tree: operator key tooling calls both from shipped commands, which is production, off the node rather than in a node process. §3.3.sealEntryForRecipient/openEntryAsRecipient— Lethe's hybrid-KEM envelope. Called only fromlethe-wnft.integration.test.ts:544and below (was cited:487).ReferenceSchnorrZK13Provider. A genuine proof of knowledge — Schnorr plus Chaum–Pedersen — with uniform nonces and a nullifier the verifier recomputes. Explicitly a reference implementation, and since 2026-09-07 the type system says so:ZK13ProviderandZK13Proofboth carry what atruefromverifydoes and does not mean. It has no anonymity set and its statement is prover-chosen, so it is a library in the strict sense — a correct construction, not a privacy primitive. No proof is produced or verified on any block, transaction or network path. §7.6.StrictProductionZK13Provider. A correctly-shaped gate — it refuses onverify, not only onprove— constructed nowhere outside a test. Undermode: 'production'the composition refuses every proof, not only one declaring the reference version, because the reference verifier's own first line rejects any other version (§7.7).BUILD_STATUS.mdrecords the corresponding gate as "met, vacuously", which is the honest phrasing: it holds because the feature is absent.signAegis/verifyAegis. Bare ML-DSA-65. No production caller of any kind. They exist so the primitive is reachable on its own, which is how the sizes above were measured.AEGIS_CONTEXTSper-surface domain separation. The mechanism is correct and suffix-free and ML-DSA enforces it — and every signature this software produces takes'generic'.AEGIS_POLICY_STRICT/AEGIS_POLICY_LAUNCH,requiresHybrid,suiteAccepted. Declared targets. Nothing constructs, reads or enforces them; swapping one for the other changes no behaviour anywhere.- Key custody's public half,
src/ops/fulla-public.ts. Added 2026-09-07, reduced 2026-11-09. A source-reading test fails if it ever acquires a private-key operation (§9.1).buildCustodyGenesisis reached by operator scripts and tests, not by a node: building a genesis is not launching a network, andfulla-public.ts:64-70says so at the end of its own module docstring — moving the realm record is a code change a person makes in a release. §9.
A claim — a sentence, a target, or a property that depends on something absent#
- "Post-quantum key encapsulation" as a property of this system. This entry MOVED on
2026-09-12 and its old text is kept because the list it sat in is the point. It read: "the only
KEM on a running node is bare ML-KEM-768, in the SLNN session key … no classical fallback,
against an unaudited implementation that does not claim constant time. This is the largest
harvest-now-decrypt-later exposure in the repository and the fix is mechanical but is a handshake
version bump." The bump was taken —
slnn-handshake-2.0.0, §3.2 — so the session key is hybrid and this entry no longer belongs under "a claim that depends on something absent". What is absent now is narrower and is stated in §3.2 rather than here: forward secrecy, because the session KEM key is long-lived and derived from the node's identity keystore, so a disk read still recovers every recorded session the node dialled.generateAegisKemKeypairinhestia.tsis also still bare, and it is one of the two inputs the hybrid seed is derived from rather than a leftover. Since9220195the cost of answering that handshake is also its own rate-limit class —GLEIPNIR_HANDSHAKE_PER_SECOND(src/network/ratatoskr.ts:381) — becausecrossBifrostnever verifies the challenge it answers, so one assembled frame buys an ML-KEM-768 encapsulation plus a hybrid signature from every socket an address opens. That is a network fact anddocs/book/NETWORK.mdowns it; it changes nothing in §2 or §3, whose figures are per-operation verification cost and per-transaction bytes. - "Attestations and governance are hybrid." They are not.
valkyrieAttest(consensus/poe.ts:341) signs at:351(was cited:326) andsrc/governance/odin.ts:1383,1393(was cited:1377,1387) sign with plain ed25519. These are the long-lived, never-rotated keys the hybrid policy's own reasoning is about, so this is the gap that matters most. - Transactions being post-quantum by default. They are not, and this row used to say
something stronger — that they were not post-quantum in any sense — which stopped being
true on 2026-09-10. What is true now: a transaction from a Gemini account is hybrid, and
both halves are required; a transaction from an ordinary ed25519 account is ed25519 and is
accepted, because
AEGIS_POLICY_LAUNCHsets thetransactionsurface tooptional. The cost decision of §2.7 is decided —optional, on a measured 18–23× block-capacity argument — andrequiredremains a hard fork rather than a setting. Two limits stand: a Gemini account cannot obtain a STR.domain after genesis, and no wallet or CLI surface signs one. Both are named in §2.7. - "Domain separation between surfaces." A property of
contextBytes, pinned by a test. Not a property of any signature on the wire. - "Nullifier uniqueness / ZK13 replay protection." Meaningless today. The statement is
prover-chosen (§7.2): nothing constrains which commitment a prover picks, so fresh nullifiers
are free. And there is no ledger —
NullifierRegistrywas deleted because a heapSetcould never have settled a double spend between two nodes. Reuse is detectable by anyone who keeps a record; nothing here keeps one. Until 2026-09-07 even "detectable" was overstated: the nullifier was a value the prover wrote and the verifier never recomputed, so one secret could mint unlimited distinct nullifiers and determinism was an honest prover's habit rather than a checked property (§7.3). That half is now fixed; the prover-chosen statement is not, and cannot be from insidesrc/crypto/. - ZK13 being zero-knowledge in any useful sense. The Fiat-Shamir transcript is
honest-verifier zero-knowledge, and that is not the claim a reader takes from the name.
commitmentHexisg^x, a function of the secret alone, so it is a stable pseudonym across every context — there is no anonymity set and two proofs from one secret are linked by a string comparison. §7.2, pinned by a test. - A range proof. There is none. The field that carried the name is now
bindingTagHex(renamed 2026-09-06 fromrangeProofHex): a SHA-256 tag over the statement and the public input, both of which the prover already controls. Nothing about any payload's magnitude is proved anywhere in this repository. - "Keys are encrypted at rest." Only if
SOURCELESS_KEY_PASSPHRASEis set, which it is not in any default path, and no release gate consumeskeysEncryptedAtRest(docs/SECURITY.md:692-694, was cited:612-614). Fafnir works; nothing turns it on. - The passphrase's own protection. It arrives in an environment variable — readable by the
same user, by
/proc/<pid>/environ, by any child process, and by a core dump. No keyring, TPM, HSM, systemd credential or start-up prompt. - 0600 on Windows. Node maps
chmodonto the read-only attribute only; the real protection is the inherited NTFS ACL, which this code does not set and does not claim to —SECRET_FILE_MODE(src/node/keystore.ts:110) and the paragraph above it at:104-108(was cited:82-90). - The plaintext-migration flag being one-shot. It is one-shot by convention only, and
since 2026-09-06
keystore.tssays so in those words rather than calling it one-shot flatly. Nothing clears, expires, counts or re-warns onSOURCELESS_KEYSTORE_ADOPT_PLAINTEXT; left set it fully re-opens the substitution attack, and only an operator's discipline closes it. Enforcement was considered and not attempted, for a reason recorded at the constant: a durable "already used" marker would have to live in the directory the adversary is defined by write access to, and a per-process cap forbids nothing, because the attack completes in one adoption in one process. Real enforcement has to come from a caller — theKeystoreReadOptions.allowLegacyPlaintextargument, which is scoped to one call — or from a supervisor that unsets the variable. @noble/post-quantumbeing safe to run on secrets. Unaudited, does not claim constant time. The only mitigation claimed anywhere is that every post-quantum signature is paired with a classical one — which does not cover the KEM, where there is no pairing on the one surface that runs.- A 160-bit address body being sufficient forever. 2^80 collision work. Second preimage is 2^160 and is fine. Whether a collision is exploitable against this chain's specific flows is unmeasured.
- The verify pool being visible when it degrades. The state is pollable and correct; nothing alerts on it, nothing escalates, and whether any deployed surface makes it noticeable is unmeasured.
- "The verify pool was confirmed by two audits." Repeated into this document and not verifiable from this repository. §4.5 supplies an independent measurement instead.
- Any statement about how mainnet keys are held. This book does not describe it and no test here can observe it. Treasury movements require several independent signers; that is the extent of what is published. §9.4.
- "An Occultation rekey removes a participant." Added 2026-09-10. It removes them from the
chain's answer and from every node's willingness to carry a post under a stale epoch, and it
cannot make the opener use a new key. Nothing on chain distinguishes a fresh 32 bytes from
the previous epoch's re-wrapped, so a removed participant who kept the epoch-N thread key reads
epoch N+1 too if the opener reuses it. Removal is a property of an honest opener. §13.2, and
docs/SECURITY.md§7b.5. - "A wrap commitment proves a participant was given a usable key." It proves nobody SUBSTITUTED the wrap after the opener signed for it. An opener who committed to a wrap encapsulated to their own key produces a commitment that verifies, and the named participant learns only that they cannot decrypt. §13.2.
- "An Oort space id is derived and cannot be squatted." Added 2026-09-10. Derivation is a
convention.
OortSpacecarries no name and no salt, so no verifier holds the preimage and only the 40-hex shape is checked. The condition that appeared to enforce derivation compared an id to a hash of itself and was inert; it now reads as the shape check it always was.docs/SECURITY.md§7b.2. - A
WrappedSpaceKeybeing attributable to the granter. It is confidential to the grantee and carries no sender authentication: anyone holding the grantee's published KEM public key can mint one. A successfulunwrapSpaceKeyis not evidence of who sent it.docs/SECURITY.md§7b.3. - Any of these having been fuzzed or red-teamed. The Accretion, Occultation and Arecibo
decoders all take input from strangers and none has a fuzz harness.
docs/HARDENING_AND_PERFORMANCE.mdS9 has recorded this as owed since it was written, and it is still owed.
13. Accretion and Occultation — the two ciphers added on 2026-09-10#
Appended rather than inserted, so that every section number an older copy of this document
carries still means what it meant. This section was written on 2026-09-10 by reading
src/hostless/accretion.ts and src/messaging/occultation.ts line by line; the entries it adds
to §12's three lists are written into §12 in place, because that section is meant to be read
alone.
Both modules are new construction and neither is covered by any earlier pass in this document.
They matter here for one reason above the others: encapsulateHybrid finally has production
callers inside the chain. §3.3 recorded the finding that the hybrid KEM ran only in operator
tooling and never in a node process. When these modules were written that was still true of a node's own traffic; since
slnn-handshake-2.0.0 (2026-09-12) the SLNN session key is hybrid too, ML-KEM-768 + X25519 (§3.2,
src/network/bifrost.ts:59-69). The two new callers are exactly the surface §3.3 said the hybrid
was for.
13.1 Accretion — a per-chunk key, four AAD fields, and one thing the root did not cover#
ACCRETION_SUITE (src/hostless/accretion.ts:77) is accretion-aes256gcm-sha256-v2. The
construction:
| Element | Choice | Why, in one line |
|---|---|---|
| Content cipher | AES-256-GCM, 96-bit random IV, 128-bit tag | Same primitive as Lethe and Fafnir; one construction rather than three |
| Key schedule | chunkKey (src/hostless/accretion.ts:270), HMAC-SHA-256 over the space key and the chunk's binding | The space key never touches a cipher, so one leaked derived key costs one chunk |
| AAD | chunkBinding (src/hostless/accretion.ts:250): suite, spaceId, epoch, index, chunkCount | Four substitutions, four fields — see below |
| Commitment | merkleRootOf (src/hostless/accretion.ts:333) over per-chunk digests, bound to space, epoch and count | Anchored in OortSpace.manifestRootHex, so no peer can restate it |
| Key delivery | wrapSpaceKey (src/hostless/accretion.ts:929), hybrid ML-KEM-768 + X25519, AAD binding space and epoch | A wrap cannot be replayed past a rotation |
The four AAD fields, and what each closes. spaceId stops a chunk of one space being served
as a chunk of another. epoch stops a chunk from before a rotation being served after it, which
is the whole of what makes a rotation retire content rather than relabel it. index stops a
silent reorder. chunkCount stops a set being re-framed as a shorter set. Each has a test in
tests/integration/accretion.integration.test.ts that fails when its field leaves the binding.
The Merkle construction, reviewed rather than accepted. The module says the odd node is promoted rather than duplicated and cites CVE-2012-2459. That is correct as far as it goes and is not the half doing the work:
- Promotion removes the
[a,b,c]/[a,b,c,c]pair. So does binding the leaf count into the root, whichmerkleRootOfalso does. The tests are honest about which is which: the CVE-shaped test still passes with the tree switched to duplicate, and the odd-count acceptance test does not. Both defences are kept because they fail differently. chunkDigest(src/hostless/accretion.ts:312) prefixesaccretion-leaf-v1and the internal fold prefixesaccretion-node-v1. Without that domain separation, promotion would hand an attacker an internal node presentable as a leaf at every odd level.verifyChunkAgainstRoot(src/hostless/accretion.ts:396) reconstructs the tree shape fromchunkCountrather than from the proof's length, so a short proof is refused and a proof with leftover elements is refused. The second refusal is the one implementations usually skip, and without it two different proofs verify one chunk.- The verifier takes no key, which is what lets a seeder that may not read a hostless space still refuse to relay a corrupted chunk. That is why the chunk's own header is compared against the position it is offered at: the AEAD check that would have caught a re-framing never runs.
Corrected 2026-09-10
Withdrawn: The manifest is pinned by the root the chain anchors. CLOSED, 2026-09-10. It was not.
AccretionManifest.totalBytes — the plaintext length — is not covered by the root and arrives
from whichever peer served the chunks, so a hostile seeder serving the real chunks with that one
field lowered handed a reader a truncated document while verifyManifest
(verifyManifest src/hostless/accretion.ts:768) accepted, every per-chunk proof verified, and every GCM tag
verified. The length now travels as an eight-byte big-endian header inside the sealed plaintext —
ACCRETION_LENGTH_HEADER_BYTES (src/hostless/accretion.ts:93) — where GCM authenticates it under
the space key that no seeder holds and the root commits to it through the ciphertext.
reassemble (src/hostless/accretion.ts:719) reads the length from there and refuses when the
manifest disagrees, and verifyManifest requires chunkCount to be the exact function of
totalBytes, which is chunkCountFor (src/hostless/accretion.ts:545). Four regression tests,
proven by mutation. MEASURED.
The header is in the plaintext and not in the chunk, and that placement is a control rather than
a convenience: a chunk header reaches every seeder, and a seeder that learned the exact content
length would learn the one thing the tail padding buys. docs/SECURITY.md §7b.3 carries the full
leak list.
13.2 Occultation — HKDF twice, and the RangeError that shaped both#
Two derivations, deliberately the same shape. wrapKey (src/messaging/occultation.ts:767)
derives the AES key that seals an epoch key to one participant; messageKey
(messageKey src/messaging/occultation.ts:920) derives the key one message is encrypted under. Both are
HKDF-SHA-256 with a labelled salt and a digest of the binding as info.
The digest is not tidiness. Node caps HKDF's info at 1024 bytes and a wrap binding is larger
than that on its own — the hybrid KEM ciphertext alone is 1120 bytes — so the first version of
that file threw RangeError: "info" is out of range on every wrap it tried to make. Hashing is
the fix and truncating is not: every field still reaches the derivation, so a change anywhere in
the binding still changes the key, and the full binding is separately the GCM AAD where there
is no such limit. The message binding is comfortably inside the cap and is hashed anyway, so that
the two derivations cannot drift over the limit independently — which is how one of them would go
unnoticed.
What each binding welds. wrapBinding (src/messaging/occultation.ts:747) carries the suite,
the thread id, the epoch, the participant and the KEM ciphertext, so a wrap cannot be moved into
another thread, forward into the next epoch, or onto another member. envelopeBinding
(envelopeBinding src/messaging/occultation.ts:897) carries the suite, thread, epoch, sender and prevHex — and
prevHex in the derivation means the message key depends on the entire history of the thread up
to that point, so a message cannot be re-encrypted into a different position because a different
position is a different key.
Two commitments, one salted and one deliberately not. postCommitment
(postCommitment src/messaging/occultation.ts:933) takes a fresh 256-bit opening, because without it anyone
holding a ciphertext off chain could hash it and find the matching record — linking a body they
hold to a thread, a sender and a height. wrapCommitment (src/messaging/occultation.ts:852) is
plain SHA-256 with no opening, and the argument for the asymmetry is sound: a wrap is a hybrid KEM
ciphertext over a uniformly random key, so it is its own entropy, there is no dictionary for a
salt to defeat, and a salt would add a second secret the opener must keep in order to prove
anything. What the unsalted commitment buys is that a participant served a substituted wrap can
prove it, because the wrap they hold does not hash to the one the opener signed.
The hybrid KEM, and why it is the right surface for it. wrapThreadKey
(wrapThreadKey src/messaging/occultation.ts:775) calls encapsulateHybrid, not the bare encapsulate; so,
since 2026-09-12, does src/network/bifrost.ts for the SLNN session key. The argument on AegisHybridKemKeypair applies here more
strongly than anywhere in this tree: a recorded conversation is exactly what a
harvest-now-decrypt-later adversary collects, and a flaw in ML-KEM alone would be a total loss
with no classical fallback. unwrapThreadKey (src/messaging/occultation.ts:808) refuses an
unknown suite by name rather than attempting it, which is the same no-downgrade rule §2.1 records
for signatures. MEASURED by tests/integration/occultation.integration.test.ts.
What the cryptography cannot reach, and this is the important paragraph. Occultation's
confidentiality rests on two things a cipher cannot enforce, both stated in docs/SECURITY.md
§7b.5 and repeated here because a reader of this document will not necessarily read that one:
- A rekey is only as good as the opener's
newThreadKeycall (src/messaging/occultation.ts:641). Nothing on chain can distinguish a fresh 32 bytes from the previous epoch's 32 bytes re-wrapped — the commitments differ either way, because the epoch is inside the binding. A removed participant who kept the epoch-N thread key reads epoch N+1 too if the opener reuses it. Removal is a property of an honest opener, not of the protocol. - A wrap commitment does not prove deliverability. An opener can commit to a wrap encapsulated to their own key. The recipient learns only that they cannot decrypt.
Neither is fixable from inside src/messaging/, and neither is a defect in the construction. They
are the boundary of what a commitment on a public ledger can say about a secret that is not on it.
14. GodCypher timestamps — src/entropy/jord*.ts, src/crypto/godcypher.countersign.timestamp.ts#
Written 2026-10-30. A GodCypher timestamp is one earthquake fixed in time from several
independent directions: two or more observatories, the national time laboratories, Roughtime, the
Urdarbrunn counter-validator over a USGS window, and a three-party envelope over the raw evidence.
It is a timestamp anyone can re-check; it is not a legal instrument and claims no legal standing.
The product doc is docs/GODCYPHER_TIMESTAMPS.md; this section is the cryptography.
14.1 The layers, and which side of the time each one bounds#
| Layer | Primitive | Bounds |
|---|---|---|
| Digest | SHA-256 over a domain-separated canonical record | — (identity of the bytes) |
| Observatories | two or more independent FDSN location solutions | no earlier than the earthquake |
| Atomic watch | SNTP against national laboratories, unsigned | how far madeAtMs can be from UTC |
| Seal | Aegis Gemini, Ed25519 + ML-DSA-65, over the digest | who made exactly this record |
| Signed time | Roughtime, nonce derived from the digest | no later than the signed time |
| Countersign | Urdarbrunn: Gemini over digest ‖ USGS window digest | no earlier than the eighth-newest earthquake in the window |
| Sealed evidence | GodCypherPQProvider, three parties | — (confidentiality of the raw evidence) |
| Anchor | PoE transaction carrying the digest, not submitted | no later than the block, once it exists |
The countersign, the sealed evidence, the signed time and the anchor are outside the digest,
because each is over it. A record made before 2026-10-30 has no godcypher field, its digest is
unchanged, and the verifier reports both GodCypher layers as absent.
14.2 The envelope, as the timestamps use it#
The printer sits in the sender slot, the archive in the receiver slot, the witness in the witness
slot; the archive and witness keys are held privately. Everything in §6.1 applies unchanged: three
hybrid ML-KEM-768 + X25519 encapsulations, HKDF-SHA-256 over all three shared secrets with an info
commitment over the version, the suite, every id, every public key and every ciphertext, and
AES-256-GCM with the version and the ids as additional data. Opening needs all three secret keys;
tests/integration/godcypher-timestamps.integration.test.ts replaces each one in turn with a key
that is not the party's and asserts the envelope does not open.
What is sealed is the bundle the public record was concluded from: every observatory's whole
answer, every SNTP exchange as it came off the wire (captured by readAtomicWatchWithSamples
beside, never inside, the digested readings), every Roughtime response, and the countersign's mix
salt. Sealing the salt is §6 of the countersign design applied: the mix is auditable only once the
salt is revealed, and revealing it takes all three parties. verifyRevealedTimestampSalt checks a
revealed salt against the published entropy.
Why the hybrid envelope here. A recorded ciphertext can be decrypted the day a large quantum computer exists. A signature only has to hold until it is checked; a sealed secret has to hold for as long as it is kept, and raw evidence is kept.
The bound. GODCYPHER_PQ_MAX_CIPHERTEXT_BYTES is 256 KiB and a bundle is held to 192 KiB of
plaintext, dropping the largest observatory bodies first, by name, when over. Measured 2026-10-30
on the recorded fixture hour: 6,713 bytes of plaintext with no signed time and 6,729 of ciphertext;
10,043 bytes with the three recorded Roughtime responses. A busy six-hour window is unmeasured.
Unconfigured is a reason, never a default. No parties file, and the record reads
not sealed: GodCypher parties not configured. Nothing is encrypted to a built-in key and nothing
is written in the clear in its place.
14.3 The counter-validator over a timestamp#
countersignTimestamp signs, with the printer's Gemini key under the generic context and its own
domain prefix, the canonical encoding of: the version, the subject (godcypher-timestamp and the
record digest), the beacon reference shared with the block proof (beaconRefOf), the mix entropy,
the salt commitment, the attestor's own clock and the attestor identity. The beacon is a SHA-256
over one USGS feed window: its address, the time USGS stamps on it and every earthquake in it at a
fixed rounding. The window is the hour feed when it holds this earthquake's USGS event and clears the
32-bit entropy floor, otherwise the day feed; it refuses to countersign a window under the floor.
What it proves is a lower bound: no earlier than the eighth-newest earthquake in the window, once a re-fetch confirms it (the eight-newest rule below). A digest that commits to an earthquake cannot be computed before it happens, and resting the bound on eight means it cannot be moved by one guess. Not the window's publication: the feeds roll, so almost every earthquake in a window was public in the one before it, and what is new is a few events and the millisecond USGS stamps on the window, about sixteen bits; a printer could precompute for upcoming windows. The publication is reported as "published by", never as a bound. (Corrected 2026-10-30 after review; the first text claimed it.) It is not an upper bound: that is the Roughtime signed time, the laboratories' judgement of the printer clock, and the chain anchor once submitted. Stated in the verifier's output every time it confirms, so a green check is never read as more than it is.
The independent re-fetch has two routes, because the live feed keeps no archive. While the feed
still serves the same window, the verifier recomputes it and confirms the eighth-newest earthquake's
origin as the feed reports it. After that, Stele reads every earthquake from the permanent USGS
catalogue, and the countersign route judges that reading itself, more strictly than Stele does for
its other callers: only earthquakes held with the hashed values inside GAIA_REVISION_TOLERANCE
count, never a withdrawn one; any one beyond the tolerance means nothing is confirmed, rather
than being dropped; a repeated event id is refused; and the bound is the catalogue's origin of the
oldest of the newest eight matched (URDARBRUNN_CATALOGUE_BOUND_EVENTS, the count that clears the
32-bit floor alone) less the time tolerance, never a time the proof carries. Corrected again on 2026-10-30: the first catalogue rule dropped out-of-tolerance earthquakes and took the newest match, so many guesses at the next earthquake cost nothing and one hit set the bound.
Real catalogue ids with forged times were confirmed before this rule, with a bound the forger chose.
No date in a proof may be later than the verifier's clock, and a window may not claim publication
before its own newest earthquake.
The eight-newest rule. Both routes use the same rule: the bound is the oldest of the eight newest earthquakes in the window (on the catalogue route, of the eight newest matched, less the five-second tolerance), so it never rests on one earthquake and moving it later would take eight guessed at once. That makes an honest bound looser by design than the newest earthquake, typically by tens of minutes in a busy day window. A catalogue reading that the per-event cap cut short confirms nothing.
The binding. The printer signs the record digest together with both GodCypher layers
(godcypherBindingMessage), so a countersign, an envelope commitment or a whole sealed layer cannot
be swapped for another one; and a jord-v2 record commits to carrying the layers, so stripping them
is reported, not passed.
| Outcome | When |
|---|---|
| confirmed | signature, subject, window digest, and an independent re-fetch (live or catalogue) all agree |
| refuted | a forged signature; another printer's key; another digest; a window digest that does not recompute from its own earthquakes; a re-fetch of the same window that disagrees; an earthquake the catalogue positively never held; or dates that contradict each other or the verifier's clock (this catches only a self-contradicting proof) |
| unverifiable | nothing re-fetched; neither the feed nor the catalogue reachable; a window too thin to be unpredictable, or too few of its earthquakes matching the catalogue; an unknown version; a window too large or too long to re-check |
The verifier layer maps these to pass, fail and unverifiable, and to skipped when the
offline checks pass and the caller did not ask for a re-fetch. An unreachable feed is never a pass.
14.4 What runs today, and what is a library#
| Part | Today |
|---|---|
| Countersign on each timestamp | runs, on every timestamp the poller makes, whenever a USGS window can be read |
| Sealed evidence | runs once the three parties are configured; otherwise reported as not sealed |
| Opening sealed evidence | a command (node scripts/jord.mjs open-evidence), all three keystores required |
| Re-fetching a countersign window | runs when a verifier asks (verify --refetch) |
| Urdarbrunn over a block | a command (strblk countersign); no block carries a proof |
GodCypherWebCryptoProvider | a library; nothing calls it |
| The chain anchor | built, not submitted |
| Consensus | reads none of it |