Seedelf-Wallet

Seedelf Messaging: the one-to-one protocol (draft)

The draft for review: conversations, forward secrecy and post-compromise security, built on the v1 envelope of construction.md. The envelope is built, and so is the session layer of §3 to §6, in this crate’s session module (chunk 54’s 54a). §16 fixes every byte and rule the build decided. The relay is built too, in the data layer (54c), and §17 fixes what it takes and gives. A first message now carries a stamp and a proof that its base comes from the handle it names, and every envelope is bound to its conversation (calls 12 and 13, 2026-11-21), so no writer can learn whether two Seedelfs are one wallet’s (§2). The wallet’s worker is built too (54e), and §18 fixes what a message’s plaintext holds. The screens (54f) add the verified reveal: the side that wrote first may show the other one of its Seedelfs, by a proof only the reader can check, while the writer’s random source was sound when it made it (§19; call 15, 2026-11-21; §7 has the condition). The protocol is modelled in Tamarin (model/, 54b), and the design is refined as it’s built.

Two keys (chunk 55, the owner, 2026-11-26; built in 55b): Messages has a key of its own, x_m, one per network, bound to each Seedelf by a certificate the Seedelf key x signs, so a flaw in Messages’ cryptography can’t spend funds. §21 specifies the key, a Seedelf’s messaging register and the certificate, and what such a flaw still gives a thief (§21.1). Where §2 to §20 write a side’s key, x_A or x_B, it’s that side’s x_m. x appears in Messages only in the certificate.

Notation is construction.md’s: additive G1 of BLS12-381, [k]P for scalar multiplication, registers (g, v) with v = [x]g.

0. Decided (the owner, 2026-11-20)

Area Decision
Key encapsulation ECIES on re-randomized registers: the v1 envelope.
Long-term key Messages’ own key x_m, one per network, from the wallet’s recovery phrase beside the Seedelf key x (§21.2), and bound to each Seedelf by a certificate x signs (§21.4). A Seedelf is the handle: “message me at ⟨Seedelf⟩”. Until chunk 55 (the owner, 2026-11-26) the long-term key was x itself, which spends.
Identities The sender of a first message makes both conversation identities.
First message Protected by the recipient’s long-term key alone until they reply. No prekeys, so the relay holds no key material. A review asked for prekeys; declined for now, to revisit with users.
Relay Keeps envelopes 36 hours, then deletes them, even though a reader must unlock within that time to receive (§13). Proof of work against spam. Senders’ IP addresses are seen, as the data layer already sees them. The wallet uses one relay, which prices each address’s posts by its recent traffic, and says so (§10).
Local state Conversations live in the browser. Deleting the wallet’s data loses them.
Proving who you are The side that wrote first may show one of its Seedelfs once the other side has replied, by a proof that convinces only the reader, as long as the writer’s random source was sound when it made it (§7, §19; call 15, 2026-11-21). A proof the reader could show others stays undecided until users ask for it (§7).
First-contact stamp A first message to a new conversation carries proof of work over its first-contact block, 2²⁴ attempts, which the reader checks before computing any key (§3; call 12, 2026-11-21).
Unlinkable handles A first message proves its base re-randomizes the handle it names, and every envelope goes to its conversation identity re-randomized by a scalar from the message key, which the reader checks (§2; call 13, 2026-11-21). Since call 16, every other point the reader’s key meets is bound too, and no envelope holds a register of anyone’s key (§2, §3).
Groups Later, on top of one-to-one sessions.
Post-quantum Later.

The first review (2026-11-20) added:

36 hours stands, despite the unlock trade it raised (§13).

Building the session layer (54a) decided what the reviews left open, each marked [choice] in §16, and found one thing the wallet must handle: a first message is refused once its t is 48 hours old, so a conversation nobody has read within 48 hours of its start can never begin, however many first messages follow (§16.4, “A first message’s life”). The vectors were reproduced by an implementation written from §16 alone, before call 16 changed them, and again as they are now, from the spec and the files alone (2026-11-23 and 2026-11-24; §16.6 says what wasn’t).

Modelling the protocol (54b), in Tamarin (model/), states as lemmas what §1.1 says of each long-term key, each side’s state and one message key, §3’s hold on R_A, agreement both ways, out of order included, §5’s rule on a cid, §6’s continuations and §19’s verified reveal. Every lemma was proved before call 16 (2026-11-22, the model’s README); call 16 and the gate changed the models, and check.sh proved them again (2026-11-23, 2026-11-24) but for heal_keys_secret, which holds by a run on the model without two actions it doesn’t read, and four traces and answers_alike with its two controls, argued, not checked (the model’s README). Its review added to this spec: what a stolen x_B allows before Bob’s first reply, key-compromise impersonation (§1.1, §7), and why w₀ must stay in the associated data (§3). Its follow-up models the outer envelope. Before call 16 its lemmas watched only the envelope’s p, so they never showed that the outer scalar’s check was enough (the model README). Since call 16 they state that the reader’s checks of the outer scalar and of the envelope’s ephemeral point (§4.1), and of F’s keys and base proofs (§3), are each needed, each with a control that drops it, and that together, within the model’s assumptions, they make the reader take no first message or reply in which any point its key touched is aimed at another of its registers, unless the reader’s own key was stolen first (2026-11-23). That its reactions so tell no writer that two handles are one wallet’s, and no responder who wrote, is argued, not checked: the model’s pair for it, answers_alike, has no result. That key makes both proofs’ designated-verifier branches, and tests the link with no reaction. Continuations are argued from first contact, not checked. Its lemmas also state that Bob’s replies open to x_A alone, and that one kept message key writes nothing on the wire, where AES-GCM’s tag can be redone with the key; and its pairs, that the bare envelope, with a tag of w in its header, is unlinkable, by observational equivalence. Before call 16 those three were proved for the envelope as it was, with w in its header and a drawn r, and with call 16’s they were proved again (2026-11-23).

Since chunk 55’s 55g the models have both keys (2026-11-28). The lemmas above are the one-key model’s, and still hold with x_m as its key: Tamarin reads those configurations as before. Two configurations add x and §21’s certificate. In them, no rule gives x away even with every messaging key stolen; a writer writes to a Seedelf only at its owner’s x_m unless its x was stolen first; and the reveal’s excuses name each key (the model’s README, Two keys). Their lemmas were run one at a time; the whole run with two keys is still to do.

The second review (2026-11-20), recorded in protocol-review.md, changed:

The 1.10.0 gate review (call 16, 2026-11-23) changed, before any of this shipped, what a stranger could still learn or cause:

1. Layers

Every message is three layers deep:

  1. Discovery. The envelope’s register (p, w) is a fresh re-randomization of one of the recipient’s registers, and the envelope carries p and a tag of w, never w (§16.1). The recipient computes [x_m]p and compares its tag (matches_envelope), one test per envelope however many conversations they have.
  2. The outer envelope: v1 as built. ECIES to (p, w), opened with [x_m]c. Every envelope has this one format, so the relay can’t tell a first message from a reply by its layout. It also hides everything inside from everyone without x_m. Its key is static, so it gives no forward secrecy.
  3. The inner message: the Double Ratchet (§4), whose keys give forward secrecy and recover after a compromise, as §1.1 says.

1.1 What each compromise reveals

Alice wrote first; Bob was written to. x_A and x_B are their messaging keys (§21.2), and x a side’s Seedelf key.

Compromised Reveals Doesn’t reveal
Bob’s x_B Which envelopes are Bob’s, and their outer layers: cids, ratchet headers, first-contact blocks. The content of every message Alice sent before she received Bob’s first reply. Stolen before that reply reaches her, the power to forge it and take the conversation over from her side. Anything Bob sent: his replies are sealed to R_A, which x_B doesn’t open. Anything Alice sent after receiving Bob’s first reply.
Alice’s x_A Which envelopes are Alice’s, and their outer layers. Any content: the session secret also needs e_A or x_B (§3).
Either side’s x_m The power to pose as that side in new conversations and in continuations (§6). The power to pose to that side as anyone: any R_A; a continuation of any of its conversations, which it would label “Continues”; and a reveal of any Seedelf with a good certificate, proved on the reader’s own branch, which it would label “Verified ⟨N⟩” (§19.5). That’s key-compromise impersonation, as in X3DH. A false “Verified” could mislead that side into a payment. The content of existing conversations’ later messages. Any funds: x_m spends nothing (§21.6).
Either side’s x The Seedelf’s funds. The power to certify a messaging register of the thief’s choosing for that side’s Seedelfs (§21.4). Later first messages from writers who read that list then go to the thief, or, beside the real certificate, to no one (§21.5). Any message sealed to x_m, which isn’t derived from x. But first messages written after the thief’s certificate is the one good one are the thief’s.
One message key That message. Any other.
A conversation’s current state (the device) Its stored history and skipped keys, and its messages until a ratchet round trip the attacker only watches. Messages after that round trip. Nothing protects against an attacker who uses the stolen state to step into the conversation.
An old copy of the state Messages sent after the copy was taken, until the next ratchet step. Messages before the copy.
The browser’s data at rest Without the wallet’s password: that Messages is on for a network (a setting), that it was used, how many conversations each network has and roughly how long each is (its record’s padded size), roughly how much a read found for it that isn’t taken in yet, and how much strangers’ requests and the messages waiting to be posted hold (the padded sizes of the records that hold them), and, once a step’s WebAssembly has trapped and locked the wallet, which step it was, the scan or the take (a mark that isn’t sealed). Records are sealed under a key that exists only while unlocked, and each conversation’s is named by an ID of its own. While unlocked, everything stored, history included. Without the password, anything in a record.
The relay §11’s metadata, the certificate list’s among them. It can also withhold, delay, reorder and replay envelopes (§5, §6), and withhold or drop certificates, so that writers can’t reach a Seedelf (§21.7). Content, or a message it could forge. Whom an envelope is for, from its bytes: only timing can test that (§11). No envelope holds a register of its reader’s key, or of any key a wallet holds, so neither the relay nor anyone reading the pool can pay one and watch the chain for who spends it (§2).

Forward secrecy covers everything Bob sends from his first message on, and everything Alice sends once she has received his first reply. Recovery after a compromise needs a full ratchet round trip after it, and an attacker who only watches.

2. Identities

3. The first message (Alice → Bob)

Alice holds Bob’s messaging register M_S = (h_S, m_S), the one m_S that the certificates good for his Seedelf N name (§21.5, §21.8).

  1. Identities and keys. Alice makes:
    • a random 16-byte conversation ID, cid;
    • R_B and R_A (§2), with R_B = ([b]h_S, [b]m_S). b isn’t drawn: it’s an HMAC under Alice’s key x_A of the handle, the start of F and 32 random bytes (§16.2). So it stays secret even when her random source fails, and it’s new for each handle and each start of F: cid, time, name and replaces. It blinds A = [x_A][b]h_S. Whoever learned it would get [x_A]h_S: x_A on a hashed point nobody chose, so not the static-DH answer it was when the base was the Seedelf’s own generator (joint-security.md, rule 1m), but still Alice’s key on Bob’s base;
    • a session ephemeral e_A, with E_A = [e_A]p₀;
    • a ratchet key s_A, with S_A = [s_A]p₀.
  2. The first-contact block:

    F = cid (16) | t (8) | to (1 + 0–32) | replaces (1 + 0 or 16) | p₀ (48) | A (48) | E_A (48) | base proof (0 or 128) | keys proof (192 or 96)
    
    • t: when Alice started the conversation, in Unix seconds, big-endian.
    • to: a length byte, then the handle’s asset name. Empty only in a continuation (§6).
    • replaces: a length byte, then the cid of a conversation this one continues (§6), or nothing. Required when to is empty.
    • The base proof: present exactly when to is, 128 bytes. A proof that Alice knows b with p₀ = [b]h_S for the messaging register (h_S, m_S) of the handle named in to, OR knows that register’s key, x_B with m_S = [x_B]h_S, with the rest of F in its challenge and its nonce derived from b and everything the challenge covers (§16.2). It’s an OR-proof (Cramer, Damgård and Schoenmakers), designated-verifier: Alice proves the first branch and simulates the second.
      • Anyone but Bob has only the first branch, so only a writer who re-randomized that one handle can make it: it makes to verified, and keeps p₀ off the sum of two handles (§2).
      • Bob holds the second, so he could have made one for any p₀ himself: it shows no one else who wrote, while Alice’s random source was sound when she made it (§7).
    • The keys proof: that Alice knows the keys, on p₀, of E_A and of her first ratchet key S_A (every message’s header key, step 6), and, from a handle, of A OR of w₀, Bob’s value. 192 bytes from a handle; 96 in a continuation, which proves E_A’s and S_A’s alone, since its A and w₀ are values both sides already hold (§6). Its challenge covers p₀, A, w₀, E_A, S_A and F before it, and each of its three nonces is derived from its key and everything the challenge covers (§16.2).
      • So every point Bob’s key meets in a first message is one whose key the writer has shown it knows: a point built on another register’s generator, which would authenticate exactly when that register is Bob’s, can’t be in one (§2).
      • It’s designated-verifier the same way: w₀’s branch is Bob’s own key, so Bob could have made it for any A. It shows no one else who wrote on the same condition (§7).
      • It’s made only from a handle with A’s key (joint-security.md, use 10): Alice’s wallet computes A = [x_A]p₀ itself, and refuses to prove any other A.
    • w₀ isn’t sent: Bob computes it as [x_B]p₀.
  3. The stamp. Alice finds an 8-byte nonce such that SHA-256 of F’s digest and the nonce has at least 24 leading zero bits (§16.2, §16.4): about 7 seconds of a browser’s time on average.
    • It prices a stranger’s first message to one reader, which the relay’s price can’t target: the relay can’t tell first messages from replies.
    • F holds the reader’s base and its proofs, and is bound into SK, so the work can’t be moved to another reader or another conversation.
    • Replies and later messages pay nothing more.
  4. The session secret comes from F, not from any one envelope:

    SK = HKDF-SHA256(salt = "Seedelf-Messaging|v1|session|salt",
                     ikm  = [e_A]w₀ ‖ [x_A]w₀,
                     info = "Seedelf-Messaging|v1|session|SK" ‖ F)
    

    Bob computes the same input as [x_B]E_A ‖ [x_B]A.

    • The second half is a static DH between R_A and R_B, as X3DH’s DH1 is. Only the holder of A’s key can compute it.
    • So a first message Bob can read was written by whoever controls R_A. A writer naming a register they don’t control can’t start a session, so Bob’s replies can’t be sent to a third party’s mailbox.
    • It’s implicit, as X3DH’s DH1 is: SK, not a signature, shows who controls R_A, and F’s keys proof adds only that its writer knows A’s key or w₀’s. F’s two proofs are designated-verifier, so nothing in a first message is something Bob could show anyone else, while Alice’s random source was sound when she made them: he could have made all of it, SK included, himself (§7).
  5. Starting the ratchet, as the Double Ratchet’s RatchetInitAlice (§4.1). R_B stands in for a signed prekey: Bob’s initial ratchet key pair is (x_B, w₀) on the base p₀, which is the “long-term key only” decision. Alice computes (RK, CKs) = KDF_RK(SK, [s_A]w₀).
  6. Every message until Alice receives Bob’s first reply is a first-contact message:

    0x01 | F | stamp (8) | ratchet header (56) | ratchet ciphertext
    
    • The ratchet header is S_A ‖ PN ‖ N: a 48-byte point and two big-endian u32 counters. Every first-contact message carries the same S_A, the one the keys proof covers.
    • The associated data is cid ‖ R_A ‖ R_B ‖ ratchet header, with R_A = p₀ ‖ A and R_B = p₀ ‖ w₀. It binds both identities to every message, as X3DH’s associated data does.
    • w₀ in it is load-bearing, beside the base proof. A writer can choose A, E_A and S_A as multiples of the handle’s base and so compute SK on any p₀ without w₀. Three things tie a first message to a base its writer can use: the base proof (step 2), whose maker knows b, or Bob’s key, and so w₀ (= [b]m_S); the keys proof, whose simulated branch needs w₀ = [x_B]p₀; and the AES-GCM tag, which needs it too. With none of them, a reader would accept any p₀, and its continuation (§6) would publish [x_B]p₀ for a p₀ of the attacker’s choosing: a static-DH oracle on the reader’s key (on the spending key, before chunk 55). Each closes it alone; keep all three. Found while modelling (54b), before the proofs existed.
    • Sending: the message is padded (§9) and sealed in an outer envelope to R_B re-randomized by the message’s outer scalar (§4.1).
    • F, the stamp, E_A and S_A stay the same in each. Alice switches to 0x02 once a reply from Bob decrypts.

Bob’s side, for a 0x01 whose cid he doesn’t know. Every point was checked, canonical, in G1 and not O, when the envelope was opened. Then, in order, each check before anything costlier, and each binding a point before the next step raises it to Bob’s key:

  1. Refuse it if t is more than 48 hours old or more than an hour ahead (§5).
  2. Refuse it if the stamp shows less than 24 bits of work. Nothing about F is computed before this.
  3. With a to: refuse it unless to names one of Bob’s handles and the base proof verifies against that handle’s messaging register M_S (§21.8). Without one: refuse it unless it’s a verified continuation of one of Bob’s conversations (§6). Either way p₀ is now bound.
  4. Refuse it unless every message of the request carries the first’s header key. Compute w₀ = [x_B]p₀, and refuse it unless the keys proof verifies for w₀ and that header key: E_A, A and S_A are now bound too.
  5. Compute SK from [x_B]E_A ‖ [x_B]A. Run RatchetInitBob(SK, (x_B, w₀)) and decrypt, on a copy of the state (§4.2). Check the envelope went to R_B re-randomized by the message’s outer scalar (§4.1), and that its c is [r]p (§16.2).
  6. If it authenticates, it’s a request (§3.1). If anything fails, nothing is kept, and nothing tells the writer (§2).

3.1 Requests

A conversation someone else started is a request until the reader replies.

4. Session messages

4.1 The ratchet’s choices

The Double Ratchet is specified in Signal’s The Double Ratchet Algorithm, revision 4 (2025-11-04), by Trevor Perrin (editor), Moxie Marlinspike and Rolfe Schmidt (revision 3+). The crate follows its §3, without the header encryption of its §4 or the post-quantum ratchets of its §5 and §6. Its names are used as it defines them: RatchetInitAlice, RatchetInitBob, RatchetEncrypt, RatchetDecrypt, TrySkippedMessageKeys, SkipMessageKeys and DHRatchet; GENERATE_DH, DH, KDF_RK, KDF_CK, HEADER, CONCAT and ENCRYPT; its state RK, CKs, CKr, DHs, DHr, Ns, Nr and PN; and MAX_SKIP. Where this document says otherwise, this document holds. The crate runs it with these choices:

Piece Choice
DH G1, on the conversation’s base p₀: a key pair is (s, [s]p₀), and DH(s, P) = [s]P, compressed. A received point must be canonical, in G1 and not O.
GENERATE_DH A scalar uniform in [1, q − 1] and its point on p₀ (§16.1): s_A at the start, and a new one in each DHRatchet (§16.3).
HEADER DHs (48) \| PN (4) \| N (4), the counters big-endian u32 (§16.1).
AD and CONCAT AD is cid ‖ R_A ‖ R_B, 208 bytes, the same both ways. CONCAT(AD, header) is the two side by side, with no lengths, since each part’s length is fixed: §16.1’s 264-byte associated data, which is ENCRYPT’s ad.
Bob’s first key pair (x_B, w₀): his long-term key on p₀ stands in for the signed prekey (§3). Only a scratch state holds it (§16.2).
KDF_RK(rk, dh) HKDF-SHA256(salt = rk, ikm = dh, info = “Seedelf-Messaging|v1|ratchet|root”), 64 bytes: the new root key, then a chain key, as Signal’s §7.2 recommends.
KDF_CK(ck) HMAC-SHA256(ck, 0x01) is the message key; HMAC-SHA256(ck, 0x02) is the next chain key, as Signal’s §7.2 recommends.
ENCRYPT(mk, m, ad) A fresh random 16-byte salt; key ‖ nonce = HKDF-SHA256(salt = salt, ikm = mk, info = “Seedelf-Messaging|v1|ratchet|message”), 44 bytes; the output is salt ‖ AES-256-GCM(key, nonce, ad, m). Signal’s §7.2 recommends AES-256-CBC with HMAC instead, its keys and IV from HKDF under a zero salt: here the salt is drawn and sent, and also derives the envelope’s o and r (§16.2).
Header encryption None: the outer layer already hides the header from everyone without the reader’s key.
The envelope’s register The other side’s conversation identity re-randomized by the message’s outer scalar o, derived from the message key and the ratchet salt (§16.2), not a random b; the envelope’s ephemeral point is [r]p, its r derived the same way, not drawn. The reader checks p = [o]p₀ and c = [r]p once the message decrypts. It binds every envelope to its conversation, so none can be aimed at another register of the reader’s (§2).
MAX_SKIP 1,000 keys skipped by one message in all, across the chain it ends and the chain it starts, not per chain as Signal’s SkipMessageKeys bounds them (§16.4); each stored key deleted 48 hours after it was stored, and at most 2,000 stored. No message makes the reader store more. One past the bound is refused, and said to be too far ahead only if it authenticates, which the reader learns by stepping its chain on a copy, at most 4,096 keys, storing none (§6, §16.4).

Inside the outer layer, a session message is:

0x02 | cid (16) | ratchet header (56) | ratchet ciphertext

The associated data is cid ‖ R_A ‖ R_B ‖ ratchet header, as in §3. It goes to the recipient’s conversation identity re-randomized by its outer scalar.

The recipient:

  1. Scans.
  2. Opens the outer layer with [x_m]c.
  3. Looks up the cid.
  4. Runs the ratchet, then checks the envelope’s p and c against the message’s outer scalar and its envelope scalar.

4.2 The state machine

Reusing a message key is the one mistake the ratchet can’t survive. In an extension it’s easy to make: two screens sending at once, or a worker stopped mid-send.

Sending:

  1. In the queue: advance the sending chain, build the envelope, and write the record with the new state and the envelope in the outbox, marked pending. A first-contact message past the request’s share (§3.1) is refused before the chain moves, and nothing is written.
  2. Out of the queue: solve the proof of work and post the stored bytes.
  3. In the queue: mark it posted once the relay takes it or says it already has it.

After a restart, every pending envelope is posted again, the same bytes. A message key is never used for anything else.

Receiving:

  1. Outside the queue: read the relay’s pages from the saved cursor, and scan them. Once the read and that sync’s posts end, the new cursor is saved, in a record of its own; then what the scan found is saved to the take’s own record, and taken from it between syncs, never during one (the wallet’s architecture.md, Seedelf Messaging).
  2. In the queue: decrypt against a copy of the state. Skipped keys, ratchet steps and counters change only the copy. The copy is kept only if the message authenticates, as the Double Ratchet requires (§4.1).
  3. Write the record with the new state and the message. Once a read’s envelopes are all taken, they go from the take’s record.

A restart asks no page again: the next read goes on from the saved cursor, and the take from its record. A restart between 3 and the take record’s write decrypts the envelope again: its key is gone, so it’s dropped as a duplicate (§5). What a stop catches before it’s in the take’s record is lost, and counted.

What the salt does and doesn’t do. Even a message key used twice gives two unrelated AES-GCM keys and nonces, unless the random source failed too. That protects confidentiality, not correctness: the reader still takes one message per key, and the second is lost. It’s a net under the state machine, not a substitute for it.

Restoring old storage (a copied browser profile) rolls a conversation back. Its next messages reuse counters the other side has already used, and they’re dropped. The salt keeps that from becoming a leak, and the conversation may need starting again (§6). It keeps it only while the random source is sound: the salt is drawn, so storage rolled back together with a source that repeats seals another text under a key and nonce already used (§13).

5. Duplicates and replays

  1. A 0x01 for a cid the reader has, as a conversation or a request, counts only if its F is the stored F. Then it’s a ratchet message of that conversation. Otherwise it’s dropped. It never starts the conversation again.
  2. A 0x01 for an unknown cid is refused if its t is more than 48 hours old or more than an hour ahead of the reader’s clock, if its stamp shows too little work, or if, with a to, its proof doesn’t show its base re-randomizes that handle of the reader’s, or, without one, it isn’t a verified continuation of one of the reader’s conversations (§3). A to whose proof fails isn’t saved by replaces.
  3. Deleting a conversation or request keeps its cid as a tombstone, which refuses the cid whatever the reader’s clock says, until an expiry past t + 48 hours and 7 days, with t from its F.
    • Rule 2 refuses its 0x01s after t + 48 hours, by a clock that’s right. The 7 days are a margin [choice], 24 bytes a deletion: a clock that ran ahead by less than that for an expiry, then was set right, can’t delete a tombstone rule 2 still needs, and reopen the cid. Before call 16 a tombstone held only while now ≤ t + 48 hours, so one expiry by a clock a day ahead did.
    • Timed from t, not from the deletion: a tombstone timed from the deletion could expire up to an hour early, when t ran ahead of the reader’s clock.
  4. A ratchet message whose key was used or deleted is dropped. A replayed session message does nothing.
  5. The relay drops an envelope whose exact bytes it holds. A re-post after its 36 hours, with new proof of work, meets rules 1–4. Only a holder of the reader’s x could re-wrap an inner message in new bytes.
  6. Both sides writing first at once makes two conversations. Each is valid.
  7. No separate envelope ID is needed. The cid with F, and the ratchet’s counters, identify every message.

The reader’s clock judges rule 2, and when rule 3’s tombstones go. A clock set far wrong moves the window with it. One set back can’t reopen a deleted cid: only an expiry by a clock more than 7 days ahead, while the window would still take the cid’s first messages, deletes a tombstone early.

6. Lost messages and lost conversations

7. Who a sender is

What the wallet says about the other side:

Label When What it means
⟨handle⟩ The reader wrote first, to that handle The other side holds that handle’s key, as the chain read gave it. Only that key opens the first message.
Unknown sender The reader was written to The other side controls this conversation’s R_A (§3), and nothing more.
Says they’re ⟨handle⟩ (unverified) A message names a handle Nothing: a claim. No message’s content changes a label, and the wallet never shows one: it would be a tool for phishing.
Continues ⟨conversation⟩ §6’s match The same keys as the old conversation.
Says it continues ⟨conversation⟩ (unverified) A replaces without §6’s match, in a first message from a handle Nothing.
Verified ⟨handle⟩ The reader was written to and replied, and the other side then showed that handle with §19’s proof, for the register the chain gives it now The other side holds that handle’s key, as a fresh read of the chain gave it when the reveal was checked. It convinces the reader alone, on the condition below.

to shows which of the reader’s handles a first message was written to: verified by its base proof (§3), not claimed. Verified to the reader: anyone else must know b to make the proof, but the reader could have made it with its own key.

Every label assumes the reader’s own x_m is safe. With it, anyone can pose to the reader as any R_A, as a continuation of any of its conversations (§1.1), and as any handle in a reveal, whose proof the reader’s key can make (§19), as it can make F’s two proofs (§3).

8. What each message costs

Measured on the same machine as the README: an Intel Core i5-12400F, one thread. The WebAssembly figures come from a scratch harness built the way the wallet builds its module (wasm-bindgen 0.2.128, clang 21, the wasm-release profile) and run in Node 24, whose V8 is Chrome’s engine. The wallet’s size-optimized profile measured the same as -O3.

Step Native WebAssembly
Scan an envelope (matches_envelope) 0.18 ms 1.02 ms
Full parse 0.16 ms 0.88 ms
Open a match (full parse, then decrypt) 0.31 ms 1.77 ms
Encrypt an envelope 0.31 ms 2.2 ms

These were measured before call 16, when the scan checked p and w and the full parse three points. The scan now checks p alone and hashes [x_m]p, one subgroup check fewer and one SHA-256 more; the full parse checks two points. The multiplication, the cost that matters, is unchanged.

In the wallet’s own module (54d), through its bindings and called as the worker will call them: messagingScan takes 200 envelopes a call as JSON of hex, with a turn of the event loop between calls. Measured with node scale.mjs messaging (seedelf-wasm’s README) on the same machine, 2026-11-21, and in a module worker in headless Chrome 157, the engine the extension’s service worker runs, with a scratch harness running the same steps:

Step Node 24 Chrome 157, a worker
Scan an envelope 0.97 ms 1.09 ms
Scan 15,000 envelopes 14.6 s 16.3 s
Open a match (messagingOpen) 1.9 ms 2.1 ms
Receive a message that takes a ratchet step, with its record 5.7 ms 6.1 ms

The bindings’ JSON and hex cost nothing measurable beside the scalar multiplication: the scan matches the scratch harness’s 1.02 ms.

Scale:

Per matched envelope, a conversation’s ratchet adds:

A conversation’s first message:

A message past MAX_SKIP costs a held conversation at most 4,097 chain steps (KDF_CK, two HMAC-SHA256 each) and the tag, one multiplication more on a new header key, and the envelope’s two if it authenticates; nothing is stored (§16.4). A forgery whose header is further ahead costs nothing.

9. Size and padding

10. The relay

§17 fixes the details as built (54c); the protocol needs only this:

What 36 hours means:

11. What the relay and others learn

From the cryptography: an envelope’s bytes say nothing of whom it’s for (DDH in G1), and nothing of what’s inside without the reader’s x_m. None holds a register of anyone’s key, so no one can pay one and watch the chain for its spend (§2).

From the network, which no cryptography here hides, the relay and anyone watching learn:

From the certificate list (§21.7):

What the relay can also do: withhold, delay, reorder or replay envelopes (§5, §6), and withhold or drop certificates (§21.7). It can’t read, address or forge either.

What’s claimed and what isn’t: no envelope names its recipient or sender, and no writer can learn from a reader’s replies whether two Seedelfs are one wallet’s (§2). That’s about replies: a payment is another question, below, and so is the timing above. Nor is it claimed that the timing of a wallet’s requests is hidden from the relay or the server it reads the chain through (the owner, 2026-11-24): they see when a wallet asks and how often, what the wallet does about it is what it does, not a guarantee, and timing that depends on the key isn’t part of that. There’s no claim of anonymity against an observer who watches the whole network.

What the wallet and the privacy policy say: the relay can’t read messages, or tell from a message whom it’s for. It sees the IP address that reads and posts and when, the cursor a wallet returns with, and counts each address’s posts and reads, in memory, against floods.

The other side of a conversation learns:

A holder of the reader’s x_m learns §1.1’s first two rows. A holder of its x learns neither (§1.1’s x row).

12. Local state

Per conversation:

Kept apart from conversations:

Versions. Each record starts with its version (§16.5). One of a version this build doesn’t read is refused at that byte, never misread, so the wallet can tell an older record from a newer: the records development builds wrote before call 16 are version 1, which 1.10.0 refuses. A conversation whose record a later version wrote is kept as it is and never opened: its messages are passed over as they come.

Storage and loss:

13. Open, to settle as we build

Unlocking versus the expiry: decided, 36 hours (the owner, 2026-11-20). Discovery needs x_m, which the wallet derives at unlock and holds as it holds x, so only while it’s unlocked. So a message reaches its reader only if they unlock within 36 hours, and the wallet says so. The alternatives stay on record, to revisit with users:

Open:

14. Against Signal

  Signal Here
What the server knows Each message’s recipient, and partly its sender The IP address that posted each envelope, and when; never whom it’s for (§11)
First message Forward-secret through prekeys Long-term key alone until Alice receives the first reply (§1.1)
Later messages Double Ratchet Double Ratchet: forward secrecy and recovery as §1.1 says
Authentication at the start X3DH’s DHs, with signed prekeys Implicit, by the static DH in SK, with F’s keys proof that the writer knows each key Bob’s meets (§3); Bob learns a conversation identity, not a person
Ratchet header Plain, or encrypted in the header-encryption variant Inside the outer layer
Identity A phone number or username, with safety numbers A Seedelf handle. The sender is anonymous unless they reveal one (§19).
Deniability Yes Yes, while the writer’s random source was sound when it made them: F’s two proofs and a reveal each convince only their reader, who could have made them (§3, §19). A source that had failed can leave them plain proofs anyone checks; what was said stays deniable (§7)
Message lifetime on the server Until delivered, with a limit 36 hours, delivered or not
Groups Sender Keys Later
Post-quantum Yes (PQXDH and the ratchet’s additions) Later
Multi-device Yes No

15. Phases

Phase What
1 Done: the v1 envelope, and its scan.
2 The relay: storage, the 36-hour expiry, proof of work, duplicates, the cursor. Built (§17), in the data layer (54c), with a day’s reading per address and an off switch since the 1.10.0 gate.
3 Sessions: §3 to §6 in this crate, with vectors, property tests and the protocol model. Built (§16), with vectors independently reproduced before call 16 re-recorded them and again since (§16.6 says what wasn’t), and modelled in Tamarin (model/, 54b): every lemma proved before call 16, and again with call 16’s rules but for those the model’s README names and argues for.
4 The wallet: WebAssembly bindings, the worker’s queue, chunked scanning, encrypted local state, requests, a Messages screen, sender labels, “message me at ⟨Seedelf⟩”, and the verified reveal (§19). Built (54d to 54f′), and in the 1.10.0 gate’s review (54g), with call 16.
Later A proof of who you are that others can check, groups, post-quantum, delivery receipts, prekeys if users want them.

16. The session layer as built (54a)

§3 to §6 are built in this crate’s session module, as plain Rust with no network, no storage and no clock: the caller passes now, by the reader’s clock, and stores the bytes each state gives. This section fixes every byte and every rule the build had to decide, so another implementation needs nothing else. Choices made while building, not in the reviews, are marked [choice].

16.1 Encodings

16.2 The key schedule

x_A and x_B are each side’s messaging key, x_m (§21.2), and the handle’s register is its messaging register M_S = (h_S, m_S) (§21.3).

Step Definition
SK HKDF-SHA256(salt = Seedelf-Messaging\|v1\|session\|salt, ikm = [e_A]w₀ ‖ [x_A]w₀, info = Seedelf-Messaging\|v1\|session\|SK ‖ F), 32 bytes. The responder’s ikm is [x_B]E_A ‖ [x_B]A.
RatchetInitAlice DHs = (s_A, S_A), DHr = w₀, (RK, CKs) = KDF_RK(SK, [s_A]w₀), Ns = Nr = PN = 0.
RatchetInitBob DHs = (x_B, w₀), RK = SK. A scratch state only: the first message’s ratchet step replaces DHs, so no stored state ever holds x_B.
DH(s, P) [s]P, compressed. Key pairs are (s, [s]p₀).
KDF_RK(rk, dh) HKDF-SHA256(salt = rk, ikm = dh, info = Seedelf-Messaging\|v1\|ratchet\|root), 64 bytes: RK′ then CK.
KDF_CK(ck) mk = HMAC-SHA256(key = ck, message = the one byte 0x01); ck′ = HMAC-SHA256(key = ck, message = 0x02).
ENCRYPT(mk, m, ad) key ‖ nonce = HKDF-SHA256(salt = a fresh 16-byte salt, ikm = mk, info = Seedelf-Messaging\|v1\|ratchet\|message), 44 bytes; the output is salt ‖ AES-256-GCM(key, nonce, ad, m).
The outer scalar o HKDF-SHA256(salt = ENCRYPT’s salt, ikm = mk, info = Seedelf-Messaging\|v1\|ratchet\|outer), 64 bytes, as a big-endian integer mod q. The envelope goes to ([o]p₀, [o]V), V the recipient’s public value on p₀. An o of 0 (probability about 2⁻²⁵⁵) sends nothing, and a retry draws a new salt.
The envelope’s r HKDF-SHA256(salt = ENCRYPT’s salt, ikm = mk, info = Seedelf-Messaging\|v1\|ratchet\|envelope-ephemeral), 64 bytes, as a big-endian integer mod q. The envelope’s ephemeral point is c = r. An r of 0 sends nothing, as an o of 0 doesn’t. The reader checks c with p (§16.4).
The ratchet §4.1’s RatchetEncrypt and RatchetDecrypt, with TrySkippedMessageKeys, SkipMessageKeys and DHRatchet, run as The ratchet, as run below says.
b For the handle’s (h_S, m_S): HMAC-SHA-512(key = x_A as 32 big-endian bytes, message = Seedelf-Messaging\|v1\|session\|base-scalar ‖ h_S ‖ m_S ‖ F’s head ‖ aux_b), the points compressed and aux_b 32 drawn bytes; its 64 bytes as a big-endian integer, reduced mod q. A b of 0 (probability about 2⁻²⁵⁵) draws aux_b again. Then p₀ = [b]h_S and w₀ = [b]m_S.
The base proof For the handle’s (h_S, m_S) and p₀ = [b]h_S, an OR-proof: b with p₀ = [b]h_S, or the handle’s key y with m_S = [y]h_S. The writer draws c₂, then z₂ (each uniform in [1, q − 1]), then aux_k, 32 bytes; T₂ = [z₂]h_S − [c₂]m_S; k = HMAC-SHA-512(key = b as 32 big-endian bytes, message = Seedelf-Messaging\|v1\|session\|base-nonce ‖ h_S ‖ m_S ‖ p₀ ‖ F′ ‖ c₂ ‖ z₂ ‖ aux_k), reduced mod q as b is, a k of 0 drawing c₂, z₂ and aux_k again; T₁ = [k]h_S; c = SHA-256(Seedelf-Messaging\|v1\|session\|base ‖ h_S ‖ m_S ‖ p₀ ‖ T₁ ‖ T₂ ‖ F′) mod q, the points compressed; c₁ = c − c₂; z₁ = k + c₁·b. The reader, from public values only, computes T₁′ = [z₁]h_S − [c₁]p₀ and T₂′ = [z₂]h_S − [c₂]m_S and accepts if the same hash over them, mod q, is c₁ + c₂, compared in F_q, never as raw bytes. Any commitment may be O, hashed as O’s compressed encoding, 0xc0 then 47 zero bytes: T₁′ is O for a proof with k = 0, which only b’s holder can make and which gives b away, and the proof verifies. The reader’s own proof, b’s branch simulated and the second proved with y, verifies too.
The keys proof, from a handle With M = p₀ ‖ A ‖ w₀ ‖ E_A ‖ S_A ‖ F″, the points compressed and S_A the first ratchet key, every first-contact message’s header key: a proof of log_{p₀} E_A AND log_{p₀} S_A AND (log_{p₀} A OR log_{p₀} w₀). The writer computes A = [x_A]p₀ itself and proves no other A. It draws c₂, then z₂ (each uniform in [1, q − 1]), then aux, 32 bytes; T₂ = [z₂]p₀ − [c₂]w₀; k_e = HMAC-SHA-512(key = e_A, message = Seedelf-Messaging\|v1\|session\|keys-nonce\|e ‖ M ‖ c₂ ‖ z₂ ‖ aux) and k_s = HMAC-SHA-512(key = s_A, message = Seedelf-Messaging\|v1\|session\|keys-nonce\|s ‖ M ‖ c₂ ‖ z₂ ‖ aux), each reduced mod q; T_e = [k_e]p₀, T_s = [k_s]p₀; k₁ = HMAC-SHA-512(key = x_A, message = Seedelf-Messaging\|v1\|session\|keys-nonce\|a ‖ M ‖ T_e ‖ T_s ‖ c₂ ‖ z₂ ‖ aux) mod q, T₁ = [k₁]p₀; c = SHA-256(Seedelf-Messaging\|v1\|session\|keys\|handle ‖ M ‖ T_e ‖ T_s ‖ T₁ ‖ T₂) mod q; c₁ = c − c₂, z₁ = k₁ + c₁·x_A, z_e = k_e + c·e_A, z_s = k_s + c·s_A. Every key is its 32 big-endian bytes. Any of the three nonces 0 draws c₂, z₂ and aux again and derives all three again. The reader, with w₀ = [x_B]p₀ and the message’s header key as S_A, computes T_e′ = [z_e]p₀ − [c]E_A, T_s′ = [z_s]p₀ − [c]S_A, T₁′ = [z₁]p₀ − [c₁]A and T₂′ = [z₂]p₀ − [c₂]w₀ with c = c₁ + c₂, and accepts if the same hash over them, mod q, is c₁ + c₂, compared in F_q. A commitment at O is hashed as 0xc0 then 47 zero bytes.
The keys proof, in a continuation The same M, with A and w₀ the two values both sides hold (§16.3): a proof of log_{p₀} E_A AND log_{p₀} S_A, which uses neither side’s key. The writer draws aux, 32 bytes; k_e = HMAC-SHA-512(key = e_A, message = …\|keys-nonce\|e ‖ M ‖ aux) and k_s = HMAC-SHA-512(key = s_A, message = …\|keys-nonce\|s ‖ M ‖ aux), each mod q, a 0 drawing aux again for both; c = SHA-256(Seedelf-Messaging\|v1\|session\|keys\|continuation ‖ M ‖ T_e ‖ T_s) mod q; z_e = k_e + c·e_A, z_s = k_s + c·s_A. The reader accepts if the same hash over T_e′ = [z_e]p₀ − [c]E_A and T_s′ = [z_s]p₀ − [c]S_A, mod q, is c.
The stamp digest = SHA-256(Seedelf-Messaging\|v1\|session\|stamp ‖ F); its work is the leading zero bits of SHA-256(digest ‖ nonce (8, big-endian)), counted from the most significant bit of the first byte, as the relay’s stamp’s are (§17.3).

Every label is its ASCII bytes, with no length or terminator. In the table, \| is Markdown’s escape for |; the labels are:

Seedelf-Messaging|v1|session|salt          SK's salt
Seedelf-Messaging|v1|session|SK            SK's info, before F
Seedelf-Messaging|v1|session|base-scalar   b's HMAC
Seedelf-Messaging|v1|session|base-nonce    the base proof's k's HMAC
Seedelf-Messaging|v1|session|base          the base proof's challenge
Seedelf-Messaging|v1|session|keys-nonce|e  the keys proof's k_e's HMAC
Seedelf-Messaging|v1|session|keys-nonce|s  the keys proof's k_s's HMAC
Seedelf-Messaging|v1|session|keys-nonce|a  the keys proof's k₁'s HMAC, keyed by x_A
Seedelf-Messaging|v1|session|keys|handle   the keys proof's challenge, from a handle
Seedelf-Messaging|v1|session|keys|continuation   the keys proof's challenge, in a continuation
Seedelf-Messaging|v1|session|stamp         the stamp's digest
Seedelf-Messaging|v1|ratchet|root          KDF_RK's info
Seedelf-Messaging|v1|ratchet|message       ENCRYPT's info
Seedelf-Messaging|v1|ratchet|outer         the outer scalar's info
Seedelf-Messaging|v1|ratchet|envelope-ephemeral   the envelope's r's info

The three infos HKDF takes under one key (ENCRYPT’s salt and mk) are none of them a prefix of another, and within each of raw SHA-256 and HMAC-SHA-512 no label is a prefix of another (joint-security.md, rule 3). The envelope’s tag label, Seedelf-Messaging|v1|envelope|tag, is the v1 envelope’s (construction.md §4.1).

The ratchet, as run. §4.1’s algorithm, with this document’s rules in its steps.

Why o and r are derived, not drawn. Each binds one of the envelope’s points to the conversation: p = [o]p₀ to its identity, and c = [r]p to the envelope’s own generator. A writer who drew c could build it on any register, [r′]g′, and seal under [r′]v′: the envelope would open exactly when (g′, v′) is a register of the reader’s key, and a reply would say so (§2). Derived from mk, both are the writer’s to compute and the reader’s to check, once the message decrypts.

Why b and the proofs’ nonces are derived, not drawn (joint-security.md, rule 2). All are hedged as the reveal’s nonce is (§19.2), so a random source that fails, repeats or is predictable costs nothing here.

Why the keys proof. Bob raises E_A, A and S_A to his key: [x_B]E_A and [x_B]A into SK, [x_B]S_A into the first ratchet step. Without a proof, a writer could put one of them on another register’s generator, (g′, v′), and derive its half from v′: the first message would authenticate exactly when (g′, v′) is a register of Bob’s key, and Bob’s reply would say so (§2). With it, each is a point whose key the writer knows, so its Diffie–Hellman value is one the writer could compute anyway. It’s checked before any of them meets Bob’s key: only w₀ = [x_B]p₀ comes first, on a p₀ the base proof or a held base binds. Every message of a request must carry the first’s header key, since the scratch state’s ratchet key is x_B until one message authenticates (§3, Bob’s side, step 4): a request read from storage is held to it when its record is read, and again when it’s replayed.

16.3 Random draws

Every random value comes from the operating system. To make vectors, each operation draws in a fixed order. The vectors name each draw, so the order is this crate’s generator’s, not something another implementation must follow or the file can pin:

Starting a continuation, from the writer’s side (§6). The writer becomes the new conversation’s initiator, whichever side it was:

16.4 The rules, exactly

16.5 The stored state

The wallet’s private format, versioned by its first byte; another implementation needn’t read it. Every record is parsed in full and checked: points, the ratchet key’s two halves, counts, flags and trailing bytes. A record of a version this build doesn’t read is refused at its first byte (UnsupportedStateVersion, with the version), so an older record is told from a newer one: the conversations and requests development builds wrote before call 16 are version 1.

16.6 Vectors

tests/vectors/messaging_session_v1.json has four conversations with every intermediate value: F with its two proofs and its stamp, both DHs and SK, each init, every chain and message key, ENCRYPT’s key and nonce, each outer scalar and envelope scalar, each ratchet step, each inner message, and each envelope. It was re-recorded for call 16, again in the 1.10.0 gate for §9’s padding (nine session sends went from 512 bytes to 2,048, and only their envelope_size and envelope changed), and again for chunk 55’s two keys (55b): every secret key is a messaging key, and a session from a handle writes to its Seedelf’s messaging register.

  1. A first contact to a Seedelf’s handle under its full 32-byte name, replies both ways, and a pair delivered out of order. Both first messages are 2 KiB, and so is every reply.
  2. The responder continuing that conversation with its identities, which the reader’s rules call verified. Nothing of session 1’s ratchet or messages enters it: a continuation is a new conversation (§16.3), which takes from the old one only its cid, as replaces, its p₀, as base, and its two public values, the writer’s as A and the other side’s as w₀. Session 1’s responder writes it, so its initiator_public and responder_public are session 1’s responder_public and initiator_public, and its two secret keys are session 1’s, swapped. Each can be checked against session 1.
  3. The smallest first contact (a Seedelf under a 1-byte to whose datum register is a root register, (G, [x]G) of its Seedelf key, no replaces, F of 491 bytes): three first-contact messages of 1,314 bytes of plaintext (the most a 2 KiB envelope holds), 1,315 (8 KiB) and none (2 KiB), read last first. No first-contact message fits 512 bytes, and no message is padded to it (§9).
  4. A fresh start from a handle under its full name with a replaces (F at its largest, 538 bytes), whose base proof’s and keys proof’s challenge hashes are both at least q, so a reader that compared either unreduced would refuse it; an 8 KiB message; and a ratchet step that skips the rest of the old receiving chain (PN − Nr = 1), whose skipped message is read last. Its draws come from the first label that gives both hashes at least q.

Encodings. Every byte string is lowercase hex, to included: the hex of its raw bytes. t, at, delivers, envelope_size and the stamp’s bits, nonce and work are JSON numbers. An absent value (handle, seedelf, replaces, base_scalar, base_proof, ratchet_step) is null; continues is present only in a continuation. A Seedelf’s network is a JSON number.

The fields. Each session gives:

The file also has version (1), description, envelope_sizes, first_contact_stamp_bits, and labels: handle_base_dst (§21.3’s DST), session_salt, session_info, base_scalar_label, base_nonce_label, base_label, keys_handle_label, keys_continuation_label, keys_nonce_e_label, keys_nonce_s_label, keys_nonce_a_label, stamp_label, root_info, message_info, outer_info and envelope_ephemeral_info, §16.2’s strings.

Then events, in order:

base_proof_checks: fourteen cases of how a reader takes F and its base proof for a handle (§16.1, §16.2). Each gives its name, the handle it’s checked against (a messaging register (h_S, m_S), always a valid one), first_contact (F) and the result.

What the file doesn’t pin. It has no other refusals. These are pinned only by §3, §6 and §16.4’s text, and held by the crate’s unit tests (session/tests/), not by these bytes:

A checks list for them, as the reveal’s file has (§19.6), is still to do.

Checked independently (2026-11-20): a script written from this section, protocol.md and construction.md alone, without reading the Rust, reproduced every value in all three sessions with noble-curves 2.0.1 for G1 and Node 24’s WebCrypto for HKDF-SHA256, HMAC-SHA256 and AES-256-GCM: 281 session values, the labels and sizes, and v1’s 40. Where it had to guess, this section now says what it found.

Checked again (2026-11-21, after calls 12 and 13), the same way, by a new script that read no Rust: every value in all four sessions, 451 session values and v1’s 42 with the labels, and each stamp’s nonce found as the first from 0 with 24 bits. Its first pass, over three sessions, showed what the bytes didn’t pin: a challenge stored reduced, a step that ignored PN, F with both to and replaces, and an 8 KiB envelope. Session 4 was added for them, and each wrong reading now changes values. Its notes on the file’s fields are folded in above.

Checked again (2026-11-22, after b and k were hedged, joint-security.md §9): a new script, written from §3, §16 and construction.md without reading the Rust, reproduced every value of the re-recorded file on its first run: b’s and k’s messages, HMACs and scalars, and everything that follows from them in all four sessions, each stamp’s nonce found as the first from 0 with 24 bits.

Since call 16 the file has been re-recorded: F with its designated-verifier base proof and its keys proof, each envelope’s derived r, the envelope’s tag of w, and session 3 re-planned. Every independent check above was of a file before it. The ones below are of later files, the last of them, after chunk 55, of the files as they are now. The mutation passes over §3 to §6’s rules (security.md, The session layer) predate call 16 too. Of call 16’s rules, the envelope’s c check and the keys proof’s nonces have had mutants run against the tests (joint-security.md §10), and so have its rules in §16.4 and §16.5 (2026-11-23): too far ahead, the request’s share at both ends, the runs, the tombstones’ margin and the versions, 26 mutants, 25 killed. The survivor drops a stored request’s bound of 16 messages, which the rule that each N is its own already enforces, since N is below 16; the bound only spares the parse the work. A third pass (2026-11-23, the gate’s spec review) ran 30 mutants over call 16’s checks, the keys proof’s and the base proof’s verifiers included: 27 were killed; a join’s bound of 16 messages is equivalent, since past the header rules no message reaches it; and p = [o]p₀ and a stored request’s header-key rule held only once their tests were added (session/tests/linking.rs, far.rs and keys_proof.rs). The rule that a base proof counts only against a register of the reader’s key came after it, with a test that fails without it (keys_proof.rs). What holds the file to §16.2 meanwhile is the crate’s own tests, which rebuild from the file alone, without the crate’s builders, b and the proofs’ nonces with their messages and HMACs, the proofs’ commitments, and each envelope’s o, r, p and c.

Checked again, after call 16 (2026-11-23): another model, given only protocol.md, construction.md and the four vector files, without the Rust, wrote a harness that reproduced them: 924 comparisons, no mismatch. And after §9’s padding (2026-11-24): that harness, changed from that day’s spec alone, reproduced the files as they are now: 1,283 comparisons, no mismatch. Neither reproduced:

Checked again, after chunk 55 (55b): a clean-room implementation, written from the spec alone, without the Rust, reproduced every value in this file, the reveal file and the certificate file: 1,042 of 1,042. What it found the text left out is folded in: t taken as given (§16.1), this section’s handle and seedelf, the reveal’s formulas, bytes and chain (§19), and the certificate’s refusals by their codes (§21.4).

What the spec still leaves unpinned, as that check found, to settle before §20’s freeze starts:

The crate’s tests:

17. The relay as built (54c)

The relay is a part of the data layer, seedelf-data’s api/src/messaging/, on the same server, behind the same edge and deploys, with buckets and a monthly traffic ceiling of its own (chunk 54’s call 1, the owner, 2026-11-21). The data layer’s README is its reference for operators. This section fixes every byte a wallet sends it and reads from it for envelopes, so a wallet needs nothing else. Since chunk 55 each pool also keeps a list of certificates, with routes, a stamp and checks of its own, which §21.7 fixes. Choices made while building are marked [choice].

17.1 Pools

17.2 Posting

POST /messaging/v1/{pool}/envelopes, Content-Type: application/octet-stream, the body:

nonce (8, big-endian) | envelope

At most 8 + 32,768 bytes. The checks run cheapest first, and the first that fails answers:

Order Check Answer when it fails
1 The body holds a nonce: at least 8 bytes 400
2 The shape: version 1, and exactly 512, 2,048, 8,192 or 32,768 bytes (§9, §16.1) 400
3 Already held, by the stamp’s digest (§17.3): the same bytes in the same pool 200 already, whatever the stamp
4 The price (§17.4) is within its ceiling, and the post fits the address’s window (§17.4) 429, with Retry-After: too many posts from this address for now when the address’s own posts took the price past its ceiling, too many posts to this pool for now when the floor alone did, and this address's share of the pool is full for now for the window
5 The stamp shows at least the price 402, {"error": …, "price": <bits>}
6 Room in the pool 503 the pool is full, with Retry-After: when the oldest envelope expires, rounded up to 10 minutes, so 600, 1,200 and so on to 3,600
7 The points: p (bytes 1 to 48) and c (81 to 128) each canonical, in G1 and not O (construction.md §4.4), so no reader ever parses garbage (call 3). The tag between them (49 to 80) is any 32 bytes: only its reader can judge it 400, counted against the address’s own price (§17.4)

Kept, the answer is 200 {"kept": "new", "expires": <Unix seconds>}, the relay’s now and 36 hours, exactly; already carries the held copy’s expires, rounded down to 10 minutes [choice]. The relay’s own refusals carry {"error": "<words>"}. One more: a 503 busy, with Retry-After, from an address new to the relay while its prices or its windows already count 200,000 addresses (§17.4).

17.3 The stamp

digest = SHA-256("Seedelf-Messaging|v1|stamp|" ‖ len(pool) (1) ‖ pool ‖ envelope)
work   = the leading zero bits of SHA-256(digest ‖ nonce (8, big-endian))

17.4 The price

What’s counted is units, by a table of the price’s own (the owner, 2026-11-23):

Envelope Units
512 or 2,048 bytes 1
8,192 bytes 16
32,768 bytes 64

So a short message padded to 2 KiB (§9) costs what a 512-byte one does, and a long one what it did. The window below keeps its own units, 512 bytes each. Each sending address has a count of its recent units, an IPv4 address whole and an IPv6 address by its /56, so the /64s of one allocation are one address [choice] (a /56 is usually one customer’s, though some networks give several customers one), and everyone together has one. Both halve every 10 minutes. A post’s price, its own units u counted:

bits = base + ⌊(mine + u) / 32⌋ + floor
floor = 0 when all + u < quiet, else ⌊log₂((all + u) / quiet)⌋ + 1
Pool base quiet ceiling per bit half-life
mainnet 18 bits 1,000 units 24 bits 32 units 10 minutes
preprod 16 bits 200 units 24 bits 32 units 10 minutes

All [choice], to tune with real use.

The window (2026-11-21). The price slows a sender; the window bounds what one address makes every reader download and scan. For each address, keyed as the price’s count is, the relay counts the posts the pool kept from it, as envelopes and as units of 512 bytes, whatever the price counts, hour by hour. Each hour’s counts are kept until 36 hours after the hour ends, when everything posted in it has expired. A post that would take the address past either limit is refused:

Pool envelopes units
mainnet 1,000 4,096 (2 MiB)
preprod 1,000 4,096 (2 MiB)

The owner’s [choice], to tune with real use; the same on both pools, so a wallet meets the same limits on preprod.

17.5 Reading

GET /messaging/v1/{pool}/envelopes, for the first page, then ?after=<cursor> with the last page’s cursor: a decimal u64 with no sign. Any other query is a 400. The answer is application/octet-stream, not compressed, with its true Content-Length:

version (1) = 1 | flags (1) | cursor (8) | prices (4) | count (2) | count × (length (4) | envelope)

17.6 Kept and lost

17.7 Vectors

tests/vectors/messaging_relay_v1.json, written by this crate’s relay module:

18. The wallet’s messages (54e)

What a message’s plaintext holds, above the session layer, which takes it as bytes (§16). [choice]

kind (1) | body

19. The verified reveal (54f)

The side that wrote first may show the other which Seedelf it holds (call 15, the owner, 2026-11-21: “allow alice to reveal but only in the rachet part so its not in the first message”). It’s a message of its own kind (§18) carrying a designated-verifier proof bound to the conversation, built in this crate’s session module (Conversation::reveal, Conversation::verify_reveal, Reveal). Choices made while building are marked [choice].

19.1 Who and when

19.2 The proof

The conversation gives cid, p₀, A = [x_A]p₀ (the initiator’s identity) and w₀ = [x_B]p₀ (the responder’s), x_A and x_B being the two sides’ messaging keys. The Seedelf gives:

Whose chain. The writer computes h_S under its own pool’s network byte and the Seedelf policy of the contract variant it reads. The reader computes it again under its own, never from the reveal, which carries no h_S. So a reveal read under another network or policy doesn’t verify (§19.6’s checks).

The statement’s bytes, which the challenge and both nonces cover, with every point compressed (48 bytes):

statement = cid (16) ‖ p₀ ‖ A ‖ w₀ ‖ len(N) (1) ‖ N ‖ g_S ‖ u_S ‖ h_S ‖ m_S

353 + len(N) bytes, 354 to 385. h_S is in it though the reader computes it, so the challenge binds the reader’s chain. Without it, the reader’s own reveal with c₁ = z₁ = 0, whose T₁′ is O on any base, verified under every chain (found by 55b’s mutation pass).

The statement is an OR of two: log_{h_S} m_S = log_{p₀} A (a Chaum–Pedersen proof that the Seedelf’s messaging register and A share a key), or the prover knows log_{p₀} w₀ (a Schnorr proof of the reader’s own key). It’s a Fiat–Shamir OR-proof (Cramer, Damgård and Schoenmakers, 1994). The writer proves the first and simulates the second.

The challenge is SHA-256 over, in order:

label ‖ statement ‖ T₁ ‖ T₁′ ‖ T₂

with label the ASCII bytes of Seedelf-Messaging|v1|session|reveal, with no length or terminator. c is that hash as a big-endian integer, reduced mod q (§16.1). A commitment the reader computes may be O (z₁ = c₁ = 0 makes T₁ and T₁′ O, and such a proof is valid): it’s hashed as O’s compressed encoding, 0xc0 then 47 zero bytes, the only place in a reveal a point may be O (F’s two proofs’ commitments may be too, §16.2).

The writer (branch 1 real, branch 2 simulated):

  1. Refuses unless A = [x_A]p₀, m_S = [x_A]h_S and the Seedelf’s certificate is good (§21.5). A proof of a statement that isn’t true would hand out x_A times a point (joint-security.md, rule 1m).
  2. Draws c₂, then z₂, each uniform in [1, q − 1], then 32 bytes aux [choice: the order, for the vectors]. c₂ and z₂ are drawn alone, not derived: the key doesn’t rest on them, and deniability does (§19.5).
  3. The nonce, hedged: k₁ = HMAC-SHA-512(key = x_A as 32 big-endian bytes, message = nonce label ‖ 0x01 ‖ statement ‖ c₂ ‖ z₂ ‖ aux), its 64 bytes a big-endian integer reduced mod q. The nonce label is the ASCII bytes of Seedelf-Messaging|v1|session|reveal-nonce, with no length or terminator, and 0x01 says branch 1 is the one proved. c₂ and z₂ are 32 bytes big-endian. A k₁ of 0 (probability about 2⁻²⁵⁵) draws aux again.
    • Why hedged: the message holds everything the challenge covers (the statement, and T₂ through c₂ and z₂; T₁ and T₁′ follow from k₁). So a random source that fails or repeats gives the same proof again, never one k₁ under two challenges, which would give x_A away: z₁ − z₁′ = (c₁ − c₁′)·x_A. joint-security.md, rule 2m.
  4. T₁ = [k₁]p₀, T₁′ = [k₁]h_S, T₂ = [z₂]p₀ − [c₂]w₀.
  5. c from the challenge; c₁ = c − c₂ mod q; z₁ = k₁ + c₁·x_A mod q.

The reader:

  1. Computes h_S under its own chain (§21.3), then T₁ = [z₁]p₀ − [c₁]A, T₁′ = [z₁]h_S − [c₁]m_S, T₂ = [z₂]p₀ − [c₂]w₀.
  2. Accepts if c₁ + c₂ ≡ c (mod q), c computed over the statement and these.

The reader’s own reveal. The responder can make one for any Seedelf, simulating branch 1 and proving branch 2 with x_B:

It verifies like the writer’s. That’s what keeps a conversation deniable: shown to anyone else, a reveal proves nothing, since the reader could have made it. It holds while the writer’s c₂ and z₂ came from a sound random source: the reader’s own c₂ is what the hash leaves, so it can’t copy a relation a failed source printed in the writer’s (§19.5). The wallet never makes one; the vectors do (§19.6).

19.3 The bytes

plaintext = 0x02 | reveal                                         (§18)
reveal    = len (1) | N (len) | g_S (48) | u_S (48) | m_S (48) | c₁ (32) | c₂ (32) | z₁ (32) | z₂ (32)

19.4 The reader’s checks, in order

  1. A session message of a conversation in which the reader is the responder (§19.1). The wallet checks the inner type; the crate parses before it checks the side, so a reveal that doesn’t parse is refused as §19.3 says whichever side checks it. It checks the side before the proof: at the writer’s side the proof is never checked, and any reveal that parses is reveal_not_allowed.
  2. It parses (§19.3).
  3. The proof verifies for the conversation’s cid, p₀, A and w₀, with h_S computed under the reader’s own chain: its pool’s network byte and the Seedelf policy of the variant it reads (§19.2, §21.3).
  4. The register is the Seedelf’s now, and its certificate is good [choice]: the wallet reads the contract fresh, whole, as Send’s pay-by-name reads it, and looks the name up in it, never in a view kept from before the reveal came, which a Seedelf’s move would leave behind.
    • Its datum’s register must be (g_S, u_S). A register the Seedelf no longer holds fails: a Seedelf can move to another owner. The writer can reveal again.
    • The list must hold a certificate good for N that names this m_S, and none good that names another (§21.5’s conflict rule).
  5. Then the other side is labelled “Verified ⟨Seedelf⟩” (§7). Of several, the latest to come that verified names it.

Steps 1 to 3 run as the message is received, in the worker’s queue (§4.2), with no request. Step 4 runs only when the user asks, from the thread [choice]: a read of the chain right after a reveal came would tell the server whom it was for. It’s one read of the whole contract, and of the list from the wallet’s cursor to its end (§21.7), out of the queue, for every reveal of that conversation still waiting; one that fails leaves them waiting for the user to ask again. The read comes from the reader’s IP address, as Send’s does, and made soon after a reveal arrived, it hints to the server that one did. A failure at any step says only that a Seedelf was shown and couldn’t be verified, never its name: a name shown unverified would be a tool for phishing.

19.5 What it proves, and what it doesn’t

19.6 Vectors

tests/vectors/messaging_reveal_v1.json, written by this crate’s session module from fixed draws, and re-recorded for chunk 55’s two keys (55b):

Checked independently (2026-11-22): a script written from this section, §16.1 and construction.md alone, without reading the Rust, reproduced every value with noble-curves 2.0.1 and Node 24’s SHA-256: both conversations’ identities, each reveal’s commitments, challenge, proof, bytes and plaintext, every check’s result, and q, 76 comparisons in all, and again after the checks were added (78). Where it had to guess (which code each refusal is, the order parsing reads in, how O is hashed, the draws’ order), this section now says, and the checks of a commitment at O and of the parsing order were added for it.

Checked again (2026-11-22, after the hedged nonce, joint-security.md §9): a new script, written from §19, §18, §16.1 and construction.md without reading the Rust, reproduced every value of the re-recorded file on its first run, each nonce’s message, HMAC and scalar included. It then changed one rule at a time to see which the file pins, and found five it didn’t: the side checked before parsing, the scalars read before the points, leftover bytes read before the points, O’s flags with a stray bit taken as O, and x ≥ p. It also found gaps in the text: the statement’s bytes weren’t defined once, nor N’s encoding, x_B’s encoding or a zero k₂. This section now says each, and the eight checks after the first 23 were added for them. On the final file it matches 84 of 84: 53 values and 31 checks. Re-recorded the same day for §16.2’s derived b, which changes both conversations: the same script matches 84 of 84 again, and every check gives the result it gave.

Checked again, since call 16, with the other three vector files (2026-11-23 and 2026-11-24): §16.6 says how, and what of this file wasn’t reproduced.

Checked again, after chunk 55 (55b): a clean-room implementation, written from the spec alone, reproduced every value of this file, the session file and the certificate file, 1,042 of 1,042 (§16.6). Where its text fell short (T₁′ on h_S, m_S in the parse and the sizes, whose chain h_S is computed under, this section’s fields and the checks’ count), this section now says.

20. What 1.10.0 freezes

The freeze starts when Messages opens on mainnet (the owner, 2026-11-24). The Seedelf Wallet opens Messages on preprod only for now, so what this section freezes is frozen by the release that opens Messages on mainnet. It names 1.10.0 because that’s the version it describes today. Until then a later release may still change a format, or what the relay’s v1 routes take and answer, where a review finds a flaw, and preprod’s conversations and its pool may then be reset.

No message says which version wrote it, and a writer writing first can’t learn which version its reader runs. 1.10.0 stays in use after later versions ship. So toward a side that may run 1.10.0, every later writer sends only what 1.10.0 accepts, within its bounds, and every later reader accepts at least what 1.10.0 writes (call 16). A later reader may accept more than 1.10.0 does, and a later writer may send more to a side that has said it reads it: what two later versions agree between them is theirs. And every relay keeps, on /messaging/v1/, what 1.10.0 asks of it and reads from it.

Formats:

The relay (§17). 1.10.0 has the relay’s origin built in, one for both pools, and reaches it with no host permission of its own, through CORS. Its content security policy lets it reach the relay at that origin and nowhere else, so a redirect elsewhere fails: the relay answers there, both pools, for as long as a 1.10.0 wallet may ask, and a pool or a route that’s retired answers 410 there for good. Where Chrome’s access to sites, which the dApp connector asks for, is granted, CORS doesn’t apply, and 1.10.0 reads the answers of whatever is in front of the relay too.

Time. Every first-contact rule runs on the two device clocks: t is the writer’s (1.10.0 rounds it down to 10 minutes), and now is the reader’s. The relay’s clock decides only how long it keeps an envelope. 1.10.0 measures its own clock against a fresh answer’s expires, and only says how far off it is: nothing runs on the relay’s time.

21. Messages’ own key and its certificate (chunk 55)

Built in 55b. Chunk 55 (the owner, 2026-11-26) gives Messages a key of its own, x_m, and binds it to each Seedelf by a certificate the Seedelf key x signs. Nothing of Messages had shipped, so it was built in place, as call 16 was (§0): §2 to §20 describe the two keys as built, and the vector files are 55b’s (§16.6, §19.6, and the certificate file below). §21.9 records what changed where. Choices made here are marked [choice].

21.1 Why

21.2 The messaging key

okm_m = HKDF-SHA-256(ikm  = the BIP39 seed v1 uses,
                     salt = "seedelf-messaging-v1",
                     info = "seedelf-messaging-key" ‖ u32_be(account) ‖ network ‖ generation,
                     L    = 64)
x_m   = int_be(okm_m) mod q

21.3 A Seedelf’s messaging register

For a Seedelf whose asset name is N (1 to 32 raw bytes) under the Seedelf policy policy (its 28-byte hash: the policy of the contract variant the wallet reads, variant 1’s today), and whose datum register is (g_S, u_S):

h_S = hash_to_G1(msg = network (1) ‖ policy (28) ‖ len(N) (1) ‖ N ‖ g_S ‖ u_S,
                 DST = "Seedelf-Messaging|v1|handle-base|BLS12381G1_XMD:SHA-256_SSWU_RO_")
m_S = [x_m]h_S
M_S = (h_S, m_S)

hash_to_G1 is RFC 9380’s BLS12381G1_XMD:SHA-256_SSWU_RO_, its DST ending in that suite’s ID as RFC 9380 §3.1 recommends, the points compressed (§16.1), and an h_S that’s O is refused.

21.4 The certificate

certificate = version (1) ‖ network (1) ‖ generation (1) ‖ policy (28) ‖ len(N) (1) ‖ N ‖ g_S ‖ u_S ‖ m_S ‖ c (32) ‖ z_x (32) ‖ z_m (32)

What it proves: knowledge of x with u_S = [x]g_S AND of x_m with m_S = [x_m]h_S, under one Fiat–Shamir challenge: two Schnorr proofs, ANDed. x’s half binds M_S to the Seedelf’s register. x_m’s half is the back-signature: no one can bind someone else’s messaging register to their own Seedelf.

The wallet, making one:

  1. Refuses unless g_S and u_S are canonical, in G1 and not O, the checks the verifier’s step 2 makes, before x meets them: x on a point outside G1 would answer questions about x modulo the cofactor’s small primes (joint-security.md, rule 5). Then refuses unless u_S = [x]g_S and m_S = [x_m]h_S. A proof for a register that isn’t x’s hands out [x]g_S, as create_proof refuses for a spend (joint-security.md, rule 1).
  2. Draws aux, 32 bytes.
  3. k_m = HMAC-SHA-512(key = x_m as 32 big-endian bytes, message = Seedelf-Messaging|v1|certificate-nonce|m ‖ statement ‖ aux) mod q, its 64 bytes a big-endian integer. T_m = [k_m]h_S.
  4. k_x = HMAC-SHA-512(key = x as 32 big-endian bytes, message = Seedelf-Messaging|v1|certificate-nonce|x ‖ statement ‖ T_m ‖ aux) mod q. T_x = [k_x]g_S.
  5. c = SHA-256(Seedelf-Messaging|v1|certificate ‖ statement ‖ T_x ‖ T_m), a big-endian integer, mod q.
  6. z_x = k_x + c·x and z_m = k_m + c·x_m, mod q.

A k_m or k_x of 0 (about 2⁻²⁵⁵) draws aux again and derives both again. The labels are ASCII, with no length or terminator.

Why the nonces are derived this way:

Anyone, checking one (the relay and every writer), each refusal by its code, the crate’s error in snake case as seedelf-wasm names it:

  1. In this order: a length outside 273 to 304 (invalid_certificate); a version other than 0x01 (unsupported_version); a network that isn’t the pool’s, a generation other than 0x00 or a policy other than the variant’s the reader reads (invalid_certificate); then a len(N) outside 1 to 32, or a length other than 272 + len(N) (invalid_certificate).
  2. g_S, then u_S, then m_S, each canonical, in G1 and not O (§16.1, construction.md §4.4): invalid_encoding, not_in_subgroup or identity_point, as §19.3 says for a point. Then c, z_x and z_m, each below q, else invalid_certificate. c below q is load-bearing: c and c + q would otherwise be two encodings of one certificate.
  3. Compute h_S (§21.3); an h_S that’s O is identity_point.
  4. T_x = [z_x]g_S − [c]u_S and T_m = [z_m]h_S − [c]m_S. Either may be O: it’s hashed as O’s compressed encoding, 0xc0 then 47 zero bytes, as in §19.2.
  5. Good if c = SHA-256(label ‖ statement ‖ T_x ‖ T_m) mod q; else invalid_certificate.

It proves whoever made it knew both keys. It doesn’t prove (g_S, u_S) is N’s register now: §21.5 does that.

Vectors: tests/vectors/messaging_certificate_v1.json, new in 55b and recorded by RECORD_MESSAGING_CERTIFICATE_VECTORS=1: four good certificates with every value (the statement, both nonces’ HMACs, T_x, T_m, the challenge, and each one’s listing digest, §21.7), and 69 refusals, each read under its network and policy with its code. The relay’s copy of these checks is held to the same file.

Never a spending proof. A spend’s challenge is blake2b-224 over the raw bytes of g ‖ T ‖ u ‖ vkh (joint-security.md §3), a hash no reduction programs. A certificate’s (T_x, z_x) can be mauled into a pair for any challenge t, T′ = T_x + [c − t]u_S, but T′ is then fixed by t, so a spend needs blake2b-224(g_S ‖ T′ ‖ u_S ‖ vkh) = t: a chance of about 2⁻²²⁴ a try, what a forger has with no certificate at all. A certificate is simulatable without x (joint-security.md §7.2), so it gives a forger nothing. A test holds it, as the reveal’s does: the spending verifiers refuse every certificate’s (T_x, z_x).

The labels: …|certificate (raw SHA-256) is a prefix of …|certificate-nonce|m and …|certificate-nonce|x (HMAC-SHA-512), which is another function, so they’re apart (joint-security.md, rule 3). Within each function, no label of §16 to §21 is a prefix of another.

21.5 Good for a Seedelf

A certificate is good for N when it checks (§21.4) and (g_S, u_S) is the datum register of the contract UTxO that holds N, in the reader’s own read of the contract, the one §2 reads a handle by, and as fresh as that read.

21.6 Which key does what

21.7 The list on the relay

Posting: POST /messaging/v1/{pool}/certificates, Content-Type: application/octet-stream, the body:

nonce (8, big-endian) | certificate

At most 8 + 304 bytes. The stamp is §17.3’s with a label of its own:

digest = SHA-256("Seedelf-Messaging|v1|listing-stamp|" ‖ len(pool) (1) ‖ pool ‖ certificate)
work   = the leading zero bits of SHA-256(digest ‖ nonce (8, big-endian))

digest is also the certificate’s listing digest, by which a removal names it. Each good certificate in the certificate file gives its own (§21.4’s vectors). Neither …|listing-stamp| nor …|certificate is a prefix of the other, or of §17.3’s …|stamp| (joint-security.md, rule 3).

The checks run cheapest first, and the first that fails answers:

Order Check Answer when it fails
1 The body holds a nonce, and no more than the longest certificate: 8 to 8 + 304 bytes 400 for a shorter one; a longer one is refused at the edge, unread, 413 the body is larger than this route takes
2 The shape (§21.4’s check 1): 273 to 304 bytes, matching its name’s length; version 1; the pool’s network byte; generation 0; the policy of the pool’s network 400
3 Already held: a certificate for the same (N, register, m_S) 200 {"kept": "already", "digest": <hex>}, whatever the stamp: the held certificate’s listing digest, since the poster’s bytes may be another posting’s
3′ Not withdrawn: its listing digest isn’t one a withdrawal took down for its (N, register), as the relay keeps them: by their first 8 bytes (below) 409 withdrawn
3″ Not withdrawn too often: fewer than 128 withdrawn digests and listed certificates together for its (N, register) [choice], so every one listed could be withdrawn and its withdrawn never pass 128: at 127 withdrawn, one more is listed and a second isn’t 409 this Seedelf was withdrawn too often at this register: move it to list it again
4 The price is within its ceiling, and the post fits the address’s window: a certificate is priced and counted as a 512-byte envelope from the same address (§17.4) [choice] 429, as §17.2’s
5 The stamp shows at least the price 402, {"error": …, "price": <bits>}
6 Room: fewer than two m_S held for its (N, register), and the list under its cap [choice: 64 MiB on mainnet, 8 MiB on preprod] 409 two certificates for this Seedelf already; 503 the list is full. A kept certificate is never pushed out
7 The points and the proof (§21.4’s checks 2 to 5) 400
8 The chain (chunk 55’s call 6, the owner, 2026-11-26): (g_S, u_S) is the datum register of the contract UTxO that holds N, on mainnet in the data layer’s own view, on preprod in Koios’s, asked at post time 409 not this Seedelf's register now; 503 can't check the chain now when the relay can’t read the chain, its Retry-After 60, or on preprod however long Koios’s day’s budget, the address’s share of it or its back-off has to run (below); on preprod, row 4’s 429 when the ask would take the address past its window (below). A certificate is never kept unchecked

Every post that reaches check 7 is counted against its address’s own price, whatever comes after: a 400 from the proof, a 409 or a 503 from the chain, a request whose client hangs up while the chain is read, or a kept certificate (counted as kept). So one solved stamp can’t be posted again and again for proofs and reads of the chain. On preprod a post whose check 8 asks Koios is counted in its address’s window too, as a kept certificate is, as the ask is made, whatever comes after (round 3’s R-A): one the window refuses then is row 4’s 429, Koios not asked. A post whose answer Koios gave within its minute asks nothing, and is counted there only if it’s listed.

Kept, the answer is 200 {"kept": "new", "digest": <hex>}. Every refusal, the 409s among them, carries {"error": "<words>"}, as §17.2’s do. A certificate’s proof is checked after its price and room for §17.2’s reason: it’s the costly check, about five scalar multiplications and a hash to the curve.

Reading: GET /messaging/v1/{pool}/certificates, for the first page, then ?after=<cursor>, as §17.5’s. The answer is application/octet-stream:

version (1) = 1 | flags (1) | cursor (8) | price (1) | count (2) | count × (kind (1) | length (2) | entry)

What the relay keeps and shows:

A withdrawal takes one certificate off the list. It’s signed by x_m, never x, on the certificate’s own messaging register:

withdrawal = version (1) = 0x01 ‖ network (1) ‖ digest (32) ‖ c (32) ‖ z (32)     98 bytes
statement  = version ‖ network ‖ digest

Posting one: POST /messaging/v1/{pool}/withdrawals, Content-Type: application/octet-stream, the body nonce (8, big-endian) ‖ withdrawal, exactly 106 bytes. The stamp is §17.3’s over SHA-256("Seedelf-Messaging|v1|unlisting-stamp|" ‖ len(pool) ‖ pool ‖ withdrawal). Among raw SHA-256’s labels none is a prefix of another: …|withdrawal (the challenge), …|unlisting-stamp|, …|listing-stamp|, …|certificate and §17.3’s …|stamp| (joint-security.md, rule 3); …|withdrawal-nonce is HMAC-SHA-512’s. The checks, cheapest first:

Order Check Answer when it fails
1 The body is 106 bytes 400 for a shorter one; a longer one is refused at the edge, unread, 413 the body is larger than this route takes
2 The shape: version 1, the pool’s network byte, c and z below q 400
3 The digest names a certificate the list holds, or one a withdrawal took that no save holds yet: that one is checked as the first post was, against the certificate taken, and answered as its save says, never 404 404 no such certificate
4 The price and window, as a 512-byte envelope from the same address 429, as §17.2’s
5 The stamp shows at least the price 402, {"error": …, "price": <bits>}
6 The proof, against the held certificate’s (h_S, m_S) 400, counted against the address’s own price, as every post that reaches this check is, whatever comes after

Taken, the certificate goes, a removal entry for its digest takes its place in the list, the list is saved (written to a file beside it and synced, renamed into place, and its folder synced, so a power loss can’t undo it either: round 3’s R-F), and the answer is 200 {"withdrawn": true}, and every refusal carries {"error": "<words>"}. 404 tells a poster only what the list already shows, whether a digest is held. A save that fails puts the certificate back, listed again after its removal, so a reader who read the removal reads it again and its digest isn’t kept, and the answer is 503 can't save now, Retry-After: 60: a 200 is only ever given for a withdrawal a crash can’t undo. The save puts it back itself, so a post whose client hung up meanwhile (a wallet’s own timeout) loses nothing; and a post of the same withdrawal while that save is under way, the wallet’s retry or another browser’s, waits for it and is answered as it says, 200 or that 503, never the 404 a wallet takes for done (round 3’s R-C).

The wallet withdraws at a network’s switch off, at a Seedelf’s turn-off, and when it removes a Seedelf of its own, for each of its own certificates its copy of the list holds, several apart, as it posts them.

21.8 When a wallet makes and uses one

21.9 What changed where (55b)

§0 to §20 were changed in place for the two keys: