Dromas server v0.6.11current client v0.6.12

The Dromas Protocol, version 1

Status: draft. Nothing here is final until version 1 is declared stable. The open issues of this repository and of dromas-server must be settled first.

1. Introduction

Dromas carries end-to-end encrypted, sender-authenticated messages between programs, through a store-and-forward server.

The keys, and the objects that each key signs (Sections 4 to 6, 10):

flowchart LR
    ID["identity key<br/>the address is the SHA-384<br/>of its identity document"]
    WK["working key"]
    SPM["prekey statements,<br/>passes, messages"]
    REV["revocations"]
    PK["prekey<br/>an age recipient"]
    SND["a sender"]
    ID -->|certifies| WK
    ID -->|signs| SPM
    WK -->|signs, under its certificate| SPM
    ID -->|signs| REV
    SPM -->|a prekey statement names| PK
    SND -->|encrypts to| PK

The life of one message (Sections 11.8, 11.10 to 11.13, 12.2, 12.3):

sequenceDiagram
    participant S as Sender
    participant V as Server
    participant R as Recipient
    S->>V: look up the recipient
    V-->>S: identity, prekey statement, revocations
    Note over S: check them, then date, sign and seal the envelope
    S->>V: send the sealed file
    Note over V: stores the ciphertext
    V-->>S: receipt
    R->>V: list
    V-->>R: ids and sizes
    R->>V: fetch each message
    V-->>R: ciphertext
    Note over R: checks 1 to 9: decryption, layout, JSON, identity, signature, envelope, revocation, replay, duplicate
    R->>V: ack

The server is not trusted for confidentiality or for authenticity. Clients make every check that protects a message. Section 15 states what a hostile server can and cannot do.

This document specifies the formats, the meaning of each HTTP operation, and the checks that a client and a server make. Alongside this document:

A reviewer of the cryptography needs Sections 2.2, 3 to 6, 8 to 10, 12.1, 12.3, 12.4, and 15. The other sections give the sender key types (Section 7), the HTTP API (Section 11), a client's other behavior (the rest of Section 12), what a server stores (Section 13), and compatibility (Section 14).

2. Conventions

2.1. Requirements language

The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in BCP 14 [RFC 2119] [RFC 8174] when, and only when, they appear in all capitals, as shown here.

2.2. Notation

2.3. Terms

Where this document uses a term below as a defined term, the term has the sense given here.

Mailboxes and people

Keys

Signers and statements

Revocations

Operations

Messages

Clients

Time

3. Primitives

3.1. Algorithms

Name Role Specification
age v1 encryption to a prekey: mlkem768x25519, the hybrid ML-KEM-768 + X25519 recipient C2SP age v1.1.0, read 2026-11-02, whose KEM is MLKEM768-X25519 from draft-ietf-hpke-pq-03
Ed25519 the identity key of types ssh-ed25519 and sk-ssh-ed25519@openssh.com; a working key of type ssh-ed25519 RFC 8032
ECDSA P-256 the identity key of types ecdsa-sha2-nistp256 and sk-ecdsa-sha2-nistp256@openssh.com; a working key of type ecdsa-sha2-nistp256 FIPS 186-5, RFC 5656
OpenSSH security key the identity key of types sk-ecdsa-sha2-nistp256@openssh.com and sk-ssh-ed25519@openssh.com: the key's wire form, and what its signature covers OpenSSH PROTOCOL.u2f, read 2026-11-23
SSHSIG every signature other than a certificate's own: the signer's signature over SHA-512 of the message, in a namespace OpenSSH 10.6p1 PROTOCOL.sshsig
SSH public key text <key type> <base64 of the wire key> RFC 4253 §6.6, RFC 8709, RFC 5656
OpenSSH certificate the certificate of a working key, with the certificate's own signature draft-ietf-sshm-cert-03
SHA-384 the address FIPS 180-4
SHA-256 a message id; the hash of a prekey statement that a send names (Section 11.10); in what a security key signs, the hash of the application and of the signed bytes FIPS 180-4
UUID an envelope's msg_id RFC 9562

The draft that the table names for age's KEM, draft-ietf-hpke-pq-03, is the version that C2SP age v1.1.0 cites. The conformance vectors and C2SP age v1.1.0 fix the KEM's bytes for this protocol (Section 16), whatever a later draft says.

Outside age, the protocol defines no keyed function. The protocol applies plain SHA-384 and SHA-256 only to public inputs: the identity document, a prekey statement, the ciphertext, and what a security key signs.

3.2. Signatures

Every signature other than a certificate's own signature is an SSHSIG (PROTOCOL.sshsig) in one form: the bytes that ssh-keygen -Y sign writes. A certificate's own signature is an OpenSSH certificate signature (Section 5.2). In an SSHSIG, the signing key signs these bytes:

"SSHSIG" ‖ str(namespace) ‖ str("") ‖ str("sha512") ‖ str(SHA-512(message))

The signature is this blob:

"SSHSIG" ‖ u32(1) ‖ str(signing key) ‖ str(namespace) ‖ str("") ‖ str("sha512") ‖ str(signature)

The blob is armoured as ssh-signature: the blob's base64 (Section 2.2) in lines of 70 characters, with a last line of 1 to 70 characters, between a BEGIN line and an END line.

ssh-signature    = %s"-----BEGIN SSH SIGNATURE-----" LF
                   signature-text
                   %s"-----END SSH SIGNATURE-----" LF
signature-text   = *( 2signature-line ) ( signature-even / signature-odd )
                   ; two lines of 70 hold 35 groups of 4
signature-line   = 70base64-char LF
signature-even   = signature-groups LF
signature-odd    = 68base64-char
                   ( 2base64-char LF 2base64-char [ signature-groups ]
                   / 2base64-char LF base64-char-by-4 "="
                   / base64-char base64-char-by-16 LF "==" ) LF
                   ; a group of 4 split across the last two lines
signature-groups = *16( 4base64-char ) ( 4base64-char / base64-final )

3.3. JSON

A server and a client read every JSON text that the protocol carries by the rules below. These texts are a request body, an answer, an envelope (Section 9.1) with the body inside the envelope, a revocation record (Section 10.3), and what a client keeps of one. A reader refuses a text whole if the text fails a rule:

Text Refused as
a request 400 invalid_request
an answer no answer
an envelope invalid_envelope

3.4. Clocks

Every check of a time is exact at the clock of the party that makes the check. The check itself adds no time for clocks that differ. Instead, the maker of a time-limited object leaves the skew allowance, one hour, for clocks that differ. Each object's section states how the object's maker leaves the allowance:

A pass leaves 5 minutes for clocks that differ, in place of the skew allowance (Section 8).

4. Identity and address

4.1. The identity document

The identity document D is two lines of ASCII: the tag, then one SSH public key written as <key type> <base64 of the wire key>, with no comment. For example:

dromas-v1
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI<43 characters>

A key of a type this section defines MUST be in that type's one encoding, and MUST meet that type's key checks. A reader that does not verify a key type that a later version defines refuses that type as unsupported_key_type, not as malformed. The key's one encoding is the wire key that OpenSSH writes back after reading the key. Parsed as the type that line 2 names and written again, the key gives the same bytes. So one key has one document, and one address.

Key type Document What fixes its one encoding Key checks Working key
ssh-ed25519 91 bytes the key's length, 32 (RFC 8709 §4) a canonical point, not of small order ssh-ed25519, ecdsa-sha2-nistp256
ecdsa-sha2-nistp256 171 bytes the curve's name, nistp256, and an uncompressed point: on the curve, not the point at infinity, each coordinate below the field's size none ssh-ed25519, ecdsa-sha2-nistp256
sk-ecdsa-sha2-nistp256@openssh.com 218 bytes the ecdsa-sha2-nistp256 row's, then the application, exactly ssh: none ssh-ed25519, ecdsa-sha2-nistp256
sk-ssh-ed25519@openssh.com 138 bytes the ssh-ed25519 row's, then the application, exactly ssh: a canonical point, not of small order ssh-ed25519, ecdsa-sha2-nistp256

4.2. The address

The address is the SHA-384 of D, written in 66 characters: the name of the address's form, d, then _, then the 48 bytes of the hash in base64url (RFC 4648 §5) without padding. For example, with OpenSSL: printf d_; openssl dgst -sha384 -binary < identity.doc | openssl base64 -A | tr '+/' '-_'. Base64url of 48 bytes needs no padding and leaves no unused bit, so each address has one text form:

address      = address-form "_" 64base64url-char
address-form = %s"d"   ; the one form this version defines

An address is shared as the link https://<server>/to/<address>.

5. Signers

Every prekey statement, pass and message that a mailbox signs has an SSHSIG (Section 3.2). The SSHSIG's signing key is the signer of that prekey statement, pass, or message. A signer has one of two forms:

Signer Rank
The identity key, the key of the identity document's line 2, byte for byte 0
A certificate the identity made of a working key (Section 5.2) the certificate's certificate serial, 1 to 2^53 − 1

5.1. What a verifier accepts

5.2. Certificates

A certificate is an OpenSSH user certificate. A verifier MUST check every row of this table:

Field Rule
Type a user certificate
Certified key the working key: of a type that Section 4.1's table gives for the identity's type, in that type's one encoding and meeting its key checks, and never the identity key
Serial the certificate serial, a serial (Section 2.2)
Key id exactly dromas-cert-v1
Principals exactly one: the mailbox's address
Validity valid after ≤ now < valid before, at the verifier's clock, in whole seconds; each at or before 9999-12-31T23:59:59Z; and valid before less valid after at most the protocol's maximum
Critical options none. A verifier MUST refuse a certificate with any critical option (draft-ietf-sshm-cert-03 §2.1.1)
Extensions none. A verifier MUST refuse a certificate with any extension
Reserved empty
Nonce exactly 32 bytes
Signed by the identity key, byte for byte as the key appears in the identity document, with the signature in the one form of the key's type, a security key's with user presence (Section 3.2)

5.3. Order

5.4. Verifying a signature

To verify the signature on a prekey statement, a pass or a message, a verifier MUST apply the following steps. The inputs are the armoured signature, the signed bytes, the namespace, the identity document of the mailbox that signed, and the verifier's clock. If any step fails, the verifier refuses the signature. A verifier MAY check in another order only where each signature gets the same result, and a refused signature the same reason.

  1. Check that the signature is no longer than the bound (Section 3.2).
  2. Parse the armour and the blob, and check that the signature is in the one form (Section 3.2).
  3. Read the signing key from the blob. If the signing key is the identity key, byte for byte as on line 2 of the identity document, the signer is the identity. Skip to step 5.
  4. Otherwise the signing key MUST be a certificate, so a bare working key fails. The signer is the certificate. Check the certificate by every rule of Section 5.2, including the identity's signature on the certificate. Of those rules, check valid after ≤ now < valid before last.
  5. Verify the SSHSIG over the signed bytes, in the namespace, under the identity key or the certified working key (PROTOCOL.sshsig, Section 3.2). A security key's signature without user presence fails this step (Section 3.2).

The result is the signer, whose rank Section 5 gives. Each party applies revocations to the signer afterwards (Section 5.1).

6. The prekey statement

A prekey statement has the form prekey-statement. The mailbox's signer (Section 5) signs the prekey statement in the namespace dromas-prekey-v1:<A>, prekey-namespace:

prekey-statement = %s"dromas-prekey-v1" LF address LF rank LF serial LF
                   age-recipient LF time LF
prekey-namespace = %s"dromas-prekey-v1:" address
rank             = "0" / serial
age-recipient    = %s"age" *bech32-hrp-char "1" 6*bech32-char
bech32-hrp-char  = %x21-40 / %x5B-7E   ; printable ASCII but A-Z
bech32-char      = "0" / %x32-39 / %x61 / %x63-68 / %x6A-6E / %x70-7A
                   ; BIP 173's alphabet: no 1, b, i or o

7. Sender key types

A mailbox declares the optional identity key types its client verifies (Section 4.1), so that a sender of an optional type writes only to a mailbox that can read that sender's messages. Every mailbox accepts senders of every type that Section 4.1 defines.

8. The pass

A mailbox proves itself to its server with a pass that the mailbox signs for itself, on every call that the mailbox makes as itself. The server issues nothing for the pass, and stores nothing.

The pass has the form pass-statement. The mailbox's signer (Section 5) signs the pass in the namespace dromas-pass-v1:<A>, pass-namespace:

pass-statement = %s"dromas-pass-v1" LF address LF server-name LF time LF
pass-namespace = %s"dromas-pass-v1:" address
server-name    = server-host [ ":" server-port ]
server-host    = dns-name / "[" IPv6address "]"   ; in lowercase
dns-name       = dns-label *( "." dns-label )   ; at most 253 characters
dns-label      = dns-char [ *61( dns-char / "-" ) dns-char ]
dns-char       = %x61-7A / DIGIT
server-port    = %x31-39 *4DIGIT   ; no leading zero, at most 65535,
                                   ; and neither 80 nor 443

Refusals. Each refusal below is a 401. certificate_revoked comes first, and otherwise this table gives the code:

Code When
certificate_revoked the call accepts a pass by the current certificate, the identity has revoked that certificate, and the pass does not name the identity's key (Section 11.4, rule 1); or the call brings a prekey statement under a certificate that the identity revoked
pass_expired at the server's clock, the pass has ended or ends more than 15 minutes ahead, or the pass's certificate has not begun or has ended
certificate_superseded the pass is by any key other than the identity's and the certificate that the call accepts a pass by, or the certificate that the server keeps for the mailbox does not verify
invalid_pass there is no pass, or the pass is not this mailbox's, or the pass is not for this server, or the pass does not verify

A certificate_superseded answer names, in certificate_serial, the certificate that the call should have used:

Call certificate_serial
any call but a registration or a renewal the current certificate's
a registration or a renewal, refused for its pass the serial of the certificate under the prekey statement that the call brings
a renewal whose prekey statement is signed by a signer of lower rank, or by another certificate with the current certificate's serial (Section 11.9) the certificate serial that the renewal's prekey statement must be above

The answer omits the member where the signer in question is the identity.

9. Messages

9.1. The envelope

The envelope is one line of compact JSON, including the LF that ends the line. The sender signs the envelope. The server never sees the envelope.

Member Presence Value
v required the integer 1
from required the sender's address
to required the recipient's address
sent_at required a time: when the sender posted this copy (Section 12.2)
msg_id required a UUID of any version, written as RFC 9562 §4 writes one, in lowercase: msg-id. A client makes a random UUID (version 4) once for each message, and keeps that UUID on every copy
identity required the sender's identity document, in base64. from is the hash of the identity document
body required the message's content: any JSON value, carried as that value. A null body is a value
subject optional a string
in_reply_to optional a string: the msg_id of the message this message replies to
supersedes optional a string: a msg_id from the same sender, naming a message that this message replaces. A stored message is never altered. The recipient decides
group optional an array of addresses: every member of the group that the message is sent to, from and to among them. A message to one mailbox has no group
msg-id    = 8lowhexdig "-" 4lowhexdig "-" 4lowhexdig "-" 4lowhexdig "-"
            12lowhexdig   ; the UUID of [RFC 9562], Section 4, in lowercase
lowhexdig = DIGIT / %x61-66   ; HEXDIG in lowercase

9.2. The plaintext: envelope, signature, and padding

The sender signs the envelope with its signer (Section 5), in the namespace dromas-msg-v1:<recipient>. For example, a sender that signs with its identity can run this command:

ssh-keygen -q -Y sign -n "dromas-msg-v1:$B" -f identity < P > P.sig

A sender that signs with its working key, under the working key's certificate, uses -f work-cert.pub instead.

The plaintext is, in order:

{"v":1,"from":"…","to":"…","sent_at":"…","msg_id":"…","identity":"…","body":"…"}
-----BEGIN SSH SIGNATURE-----
U1NIU0lH…
-----END SSH SIGNATURE-----
................
  1. Line 1 is the envelope. The sender signs the bytes of line 1, LF included.
  2. Then the signature. The signature is as ssh-keygen writes it, up to and including its END line.
  3. Then padding. The padding runs to the end of the plaintext (Section 9.3).

A sender writes the plaintext as plaintext, and signs in the namespace msg-namespace:

plaintext     = envelope-line ssh-signature padding
envelope-line = 1*( %x00-09 / %x0B-FF ) LF   ; the envelope (Section 9.1)
padding       = *"."   ; Section 9.3
msg-namespace = %s"dromas-msg-v1:" address

A reader MUST separate the parts by these rules:

  1. The reader verifies the signature over line 1 exactly as decrypted. The reader reads the envelope's members from those same bytes, never from anything rebuilt.
  2. Each part has one place, and nothing is searched for.
    • Line 2 MUST be the signature's BEGIN line, ending in LF.
    • The block ends at the first END line, which MUST be followed by LF.
    • If the byte right after the first END line is any byte other than LF, or there is no byte after that END line, the reader refuses the message. The reader does not look for a later END line.
    • The bytes after the LF that follows the first END line are never parsed or shown.
  3. One signature, one identity. The reader verifies the signature against the identity that the envelope carries. The verdict is the result of that verification alone.

The namespace binds the signature to the message's recipient. A message signed for one mailbox does not verify in another mailbox's namespace.

9.3. Padding

A sender pads every message so that the message's ciphertext is a whole number of blocks.

9.4. Encryption

The sender encrypts the plaintext to the recipient's prekey with age (C2SP age), in the binary format, not armoured. As a shell command: { cat P P.sig; padding; } | age -r <recipient> > m.age. The age file has one mlkem768x25519 stanza. A sender adds no other stanza, apart from a stanza that a server ignores (Section 11.10, step 7).

10. Revocation

10.1. Revocation of the address

A mailbox's identity can revoke the mailbox's address permanently. Only the identity can revoke the address.

10.2. Revocation of certificates

The identity revokes every certificate it made through a revocation serial, including that serial, and keeps its address.

10.3. The revocation record

A revocation record carries an identity's revocations, and the record proves itself. Anyone who has the address can check the record with nothing else.

{"type":"revocation_record","identity":"<base64 of D>","revocation_signature":"<base64>","revoked_certificates":"<base64>","revoked_certificates_signature":"<base64>"}

11. The HTTP API

api/openapi.yaml gives the shape of every operation below. This section gives the meaning of each operation, and the checks that a server makes.

11.1. Transport

11.2. Requests and answers

11.3. Errors

This table gives each code's meaning, and how a client acts on the code:

Status Code Meaning
400 invalid_request a request body that is not a JSON text Section 3.3 accepts; a member or query parameter, named in param, that is missing, unknown, repeated, or has a value the call does not accept, including a byte member that is not base64 in base64's one encoding (Section 2.2); a send's body whose age header does not parse (Section 11.10, step 4)
400 invalid_address a first path segment under /v1/ that begins with an ASCII letter and _, and is not an address (Sections 4.2, 11.2)
400 identity_mismatch an identity document that does not hash to the address, or that does not have the form Section 4.1 gives
400 unsupported_key_type an identity key type that this protocol does not define, or that this server does not register; key_types lists the types the server registers
400 invalid_key an identity key that fails its type's key checks; a prekey statement or certificate that is malformed or badly signed
400 invalid_validity_period at the server's clock, a certificate that has not yet begun or has ended, or a prekey statement that has ended or ends more than 8 days and an hour ahead. The cause is nearly always the client's clock
400 certificate_lifetime_too_long a certificate that runs longer than the server's maximum (Section 11.7, step 6); max_certificate_lifetime_seconds gives the maximum
400 invalid_recipients a send's age file that does not have exactly one native stanza of the current prekey's type, or that has anything beside that stanza and the grease stanzas that the server ignores (Section 11.10, step 7)
400 invalid_revocation a revocation whose signature is not the identity's signature over the revocation's revocation statement (Section 11.15)
401 invalid_pass, pass_expired, certificate_superseded, certificate_revoked the server refuses the pass; Section 8's table gives when the server answers each code. On certificate_superseded, certificate_serial names the certificate concerned (Section 8)
403 sender_not_registered the mailbox that a send's pass names is not registered
403 sender_revoked the sending mailbox is revoked
403 sender_not_allowed the recipient's ACL does not admit the sender (Section 11.14). The refusal is final for the message
403 unsupported_sender_key_type the recipient's client does not verify the sender's identity key type (Section 7); key_type names that type
403 invalid_adopt_key an adopt key that this server did not make, or that is spent, expired or revoked (Section 11.16)
404 mailbox_not_found the mailbox was never registered, or is forgotten
404 message_not_found the message is gone: acked or expired
404 revocation_not_found the server keeps no revocation of the address (Section 11.15)
408 request_timeout the body did not arrive in time: send the request again
409 mailbox_already_exists the address is registered with another prekey statement: a registration that is not an identical retry
409 serial_too_low the server keeps a higher serial: a renewal by the current signer at a prekey serial that is not higher (prekey_serial names the prekey serial to exceed); a revocation of certificates through a lower revocation serial than the one the server keeps (revocation_serial names the kept revocation serial)
409 concurrent_modification the mailbox changed during the request, or a precondition that the request carried was no longer true when the request wrote: send the request again unchanged
409 prekey_superseded a newer prekey exists: look up the mailbox again and seal the same envelope
409 prekey_expired the recipient's current prekey has ended, or the recipient's current signer is revoked: the recipient's owner must renew (Section 11.10, step 7)
410 mailbox_revoked the address is revoked permanently; record carries the revocation record (Section 10.3), which a client checks (Section 12.5)
410 client_version_unsupported the server no longer accepts the request's version (Section 11.17); min_version, if the server sets a version floor, is the lowest version the server accepts
412 precondition_failed a precondition was false (Section 11.2)
413 content_too_large a body or ciphertext over its cap, or an ACL with more entries than the server accepts; limit gives the cap
429 rate_limited the call is past a limit (Section 11.5); the answer carries subject and quota_id, and quota_value for a number a day
429 fetch_rate_limited the server paces the mailbox's fetches (Section 11.12)
429 mailbox_full the mailbox stores as many messages as it may. The refusal says nothing of how many messages the mailbox stores
429 mailbox_rate_limited the mailbox has spent its intake budget for now
503 unavailable the server is not ready to answer

Every 429 carries Retry-After.

11.4. The order of refusals

A server chooses which refusal it answers first, except where this specification fixes the order. The two rules below fix the order for every call, and the section on an operation can fix more. Elsewhere, when a request fails several checks, the server answers the failure it finds first. The client acts on the refusal that arrives. The steps of Sections 11.7 and 11.10 are numbered so that other text can cite them. The numbers do not set the order of the checks.

  1. A retired version comes before everything (Section 11.17). The server answers a request whose version is retired with 410 client_version_unsupported. The server reads nothing else of the request, the pass included. The request counts only against the IP address's requests.

  2. A mailbox's state comes before any pass. Before the server judges any pass, the server answers with a mailbox's state:

    • a call gets the state of the mailbox whose pass the call carries;
    • a lookup gets the state of the mailbox it looks up.

    So a mailbox learns its own state, whatever pass its call carries.

    Call Answers before any pass
    A call with a mailbox's own pass, other than a registration (Section 11.7) 404 mailbox_not_found for an unknown mailbox; 410 mailbox_revoked for a revoked mailbox; 401 certificate_revoked where the call accepts a pass by the current certificate, the identity has revoked that certificate, and the pass does not name the identity's key
    A send, about its sender 403 sender_not_registered, 403 sender_revoked, 401 certificate_revoked
    A lookup 404 mailbox_not_found, or 410 mailbox_revoked with the address's revocation record
    Looking up revocations 404 revocation_not_found, or 200 with the revocation record

11.5. Limits

A server chooses what it limits and by how much. No limit's value is part of the protocol, and a server may add limits. A client meets a limit as a 429 answer (RFC 6585 §4) with Retry-After. The client waits for the Retry-After time and then retries, unless the code says otherwise. Every server keeps these promises:

Who a call is counted against. Here, an IP address is the IPv4 address or the IPv6 /64 that a call comes from. No caller is exempt.

Call Counted against
A call with a mailbox's pass that mailbox
A call with no pass the call's IP address; a server MAY also count by a wider range
A lookup, whatever it carries the call's IP address
A check that fails, or a call that names no mailbox the call's IP address

The subject column of the table below gives the exceptions. A registration is counted against the IP address, and a revocation of certificates through a higher revocation serial is counted against the mailbox.

How a refusal names its limit.

quota_id subject Counts
polls mailbox the mailbox's polls (Section 11.11), including polls answered 304 or 412
calls mailbox the mailbox's other calls that carry the mailbox's pass, including a send, a renewal by the current signer and an identical retry of the mailbox's registration or renewal
sends mailbox the mailbox's sends, a number a day, counted only for sends that carried the mailbox's pass
renewals mailbox the mailbox's renewals by the current signer, a number a day
certificates mailbox the mailbox's renewals by a signer of higher rank than the current signer, a number a day, except a renewal made while the current signer is revoked
certificate_revocations mailbox each revocation of certificates that the mailbox's identity publishes through a higher revocation serial, a number a day
registrations ip registrations from an IPv4 address or IPv6 /64, and each call that a server counts as a registration (Section 11.15)
registrations_range ip the same, from an IPv6 /48
misses ip calls whose lookup or read found no mailbox, or whose Authorization value or prekey statement cannot be read
misses_range ip the same, from an IPv6 /48
sends_before_pass ip sends, counted before the server reads their pass
sends_before_pass_range ip the same, from an IPv6 /48
requests ip the IP address's requests, which a server MAY leave uncounted when the request carries a pass that the server has already verified; registrations, renewals and requests that match no route are counted
requests_range ip the same, from an IPv6 /48

A quota counted against ip counts an IPv4 address by itself and an IPv6 address by its /64. Each quota ending in _range counts the same calls by their IPv6 /48 as well, beside the quota of the row above it; an IPv4 address has no /48 count. A call is refused when either count is spent, and the refusal names the count that sets its Retry-After.

A fetch and an ack of a message the mailbox holds spend no calls, and Section 11.12 gives a fetch's own budgets.

What a HEAD and a false precondition spend. A list's HEAD, and a list refused by a false precondition, spend polls. Any other HEAD that carries the mailbox's pass, and any other call with that pass refused by a false precondition, spend calls.

For a server's limit that is not one of these, the refusal has no quota_id.

11.6. Mailbox states

At a server, a mailbox is in one of three states:

This table gives the answer to each call in each state, for a call that the call's own section accepts. That section gives the call's other refusals.

Call unknown active revoked
Register, PUT /v1/<A> 201; the mailbox is now active an identical retry → 200; any other registration → 409 mailbox_already_exists 410 mailbox_revoked
Renew, PUT /v1/<A>/prekey 404 mailbox_not_found 200 410 mailbox_revoked
Any other call with the mailbox's own pass (list, fetch, ack, the ACL, joining or leaving an account: Sections 11.11 to 11.14, 11.16) 404 mailbox_not_found answered as the call's section says 410 mailbox_revoked
Publish a revocation of the address, PUT /v1/<A>/revocation 201; the server keeps the revocation, and the address is now revoked 201; the address is now revoked, and the server deletes the mailbox's messages 410 mailbox_revoked, with the revocation record
Publish a revocation of certificates, the same route 200; the server keeps the revocation, and the address stays unknown 200 410 mailbox_revoked, with the revocation record

11.7. Register

A registration, PUT /v1/<A>, carries identity, prekey and prekey_signature (the exact bytes of each, in base64). The registration also carries sender_key_types if the mailbox declares any. The registration carries a pass by the signer of that prekey statement. The mailbox is in use at once.

The server checks:

  1. The address in the path is an address (Section 4.2) → otherwise invalid_address.

  2. The body has exactly those members → otherwise invalid_request, naming the member.

  3. identity hashes to the address and has the form of an identity document (Section 4.1) → otherwise identity_mismatch.

  4. The key's type and the key:

    Check Otherwise
    the type is one this protocol defines unsupported_key_type
    the key is in its one encoding identity_mismatch
    the key meets its type's key checks invalid_key

    A server registers ssh-ed25519 and any other defined types that its operator chooses. The server answers every other type unsupported_key_type, with the list of types the server registers.

  5. A registration never changes a registered mailbox. When the server keeps the mailbox, the server answers the registration from the server's record of the mailbox, once steps 1 to 4 are met. The table below gives the answer. This answer comes ahead of every other refusal of this call. This answer also comes ahead of every count except the budgets that bound any call (Section 11.5).

    The server holds The request Answer
    an active mailbox an identical retry 200 {} once the request's pass (step 7) is verified and the request's preconditions are true (Section 11.2), or 401 certificate_revoked if the identity has revoked the certificate of that prekey statement
    an active mailbox anything else 409 mailbox_already_exists
    a revoked address, with a mailbox or none any 410 mailbox_revoked, with the address's revocation record

    The server counts any other registration against the registration's IP address (Section 11.5, registrations).

  6. The prekey statement and its signer. Each of these is true:

    • the prekey statement has the form of Section 6;
    • line 2 is the address;
    • line 3 is the rank of the signer;
    • line 5 is a valid age recipient of the prekey type, whose X25519 half is not of small order;
    • the signer is that identity, or a certificate of that identity that meets every rule of Section 5.2;
    • the namespace is dromas-prekey-v1:<A>;
    • the prekey statement's not_after is after now and at most 8 days and an hour after now.

    Otherwise the server answers invalid_key, or invalid_validity_period where the check that fails is the certificate's time or the prekey statement's not_after.

    The server also refuses:

    • a certificate that runs longer than the server's maximum (Section 11.18), measured as valid before less valid after, unless the certificate is the current certificate → 400 certificate_lifetime_too_long;
    • a certificate that the identity revoked, according to the revocations the server keeps for the address (Section 5.1) → 401 certificate_revoked.
  7. The pass. The pass (Section 8) is this mailbox's, is for this server, has not ended, and is by the identity or by the signer of step 6 → otherwise a 401 (Section 15.5).

  8. A new mailbox. The server stores the new mailbox as active → 201 {}. If another request has registered the mailbox meanwhile, the server answers this registration as step 5 does.

  9. The server keeps the prekey statement's signer as the current signer. That signer is the identity, or a certificate. For a certificate, the server keeps the certificate serial as well. Section 8 gives which passes the server then accepts, and Section 11.9 gives which later prekey statements the server accepts.

11.8. Look up a mailbox

A lookup, GET /v1/<A>, accepts no pass (Section 8). The lookup answers with the information a sender needs before posting, and with the information a mailbox checks about itself (Sections 12.4, 12.5).

11.9. Renew the prekey

A renewal, PUT /v1/<A>/prekey, carries prekey and prekey_signature, and sender_key_types if the mailbox declares any. The renewal carries a pass by the signer of that prekey statement or by the identity.

The server accepts a renewal because the renewal's prekey statement is later than the current statement, and is signed by the identity or by a working key that the identity certified. The renewal needs no pass by the current signer. So a mailbox that lost its working key comes back by renewing under a new certificate. A mailbox also moves to a new certificate, its first included, by renewing.

11.10. Send

A send, POST /v1/<B>/messages?prekey_sha256=<hash>, carries the sender's pass. The send's body is the age file's exact bytes (Content-Type: application/vnd.age, age's registered media type). The server answers the send 201 with id, received_at and expires_at, and Location: /v1/<B>/messages/<id>. The sender is the mailbox that the pass names.

prekey_sha256 is REQUIRED. prekey_sha256 names the prekey statement that the age file is sealed to, as statement-hash: the SHA-256 of the prekey statement's bytes as the lookup of B served them (Section 11.8). The hash covers the prekey statement alone, never the prekey statement's signature. Another encoding of the same signature (Section 3.2) does not change the hash.

statement-hash = 64lowhexdig

The server checks the steps below. Only step 9 stores anything.

  1. Who is sending. The server reads the pass (Section 8) for the mailbox that the pass names. The server checks, in this order:

    1. the IP address's sends_before_pass;
    2. the mailbox that the pass names: unknown → 403 sender_not_registered; revoked → 403 sender_revoked;
    3. the pass's own refusals, and the sender's calls (Section 11.5). Every send spends calls, including a send of a ciphertext that B already stores (step 6).
  2. The path and the query. <B> is an address → otherwise invalid_address. prekey_sha256 is given once, as statement-hash, and no other parameter is given → otherwise invalid_request, naming the parameter.

  3. The body's size. The body is at most the sender's cap → otherwise 413 content_too_large, with the cap in limit. The server refuses by the Content-Length before it reads anything, or while it reads.

  4. The age header. The body begins with an age header that parses (C2SP age) → otherwise invalid_request, with no param. An empty body gets the same refusal.

  5. B is active: unknown → 404 mailbox_not_found; revoked → 410 mailbox_revoked.

  6. Dedupe, while the message is live. The server evaluates the send's preconditions before this step (Section 11.2). The message id is the ciphertext's SHA-256. If B stores an unacked message with that message id, from any sender, the server answers 200 with the receipt it kept, whatever has changed at B since. This answer comes ahead of steps 7 to 9, and ahead of every count except the budgets that bound any call (Section 11.5). The server keeps nothing of a message once the message is gone. So the same bytes sent after that are a new message, which the server stores and counts as any send. A reader that accepted those bytes once skips or refuses them (Section 12.3, check 8).

  7. B accepts messages on this prekey, from this sender:

    Failure Answer
    B's current prekey is past its not_after, or the current signer is one B's identity has revoked 409 prekey_expired
    The sender's identity key is of an optional type (Section 4.1) that B did not declare (Section 7) 403 unsupported_sender_key_type
    prekey_sha256 is not the hash of B's current statement 409 prekey_superseded
    The age file does not have exactly one native stanza (mlkem768x25519) of the current prekey's type, or has anything beside that stanza and the grease stanzas that the server ignores invalid_recipients

    The server ignores a stanza whose type matches ^[!-~]{1,8}-grease$ and that has at most 4 arguments, as age has a reader ignore a stanza that the reader does not recognize. Only the message cap bounds the body of such a stanza. The server cannot check which key the file is sealed to.

  8. Quotas, counted only for sends that carried their sender's pass:

    Failure Answer
    B's ACL does not admit the sender 403 sender_not_allowed, with one code and one wording whether the sender is denied or only not allowed
    The sender has spent its sends 429 rate_limited
    B stores as many messages as its cap 429 mailbox_full, with a Retry-After of the poll interval
    B has spent its intake budget 429 mailbox_rate_limited, with a Retry-After of the time until B accepts another message

    A send of a ciphertext that B already stores (step 6) spends none of the intake budget.

  9. Store the message. The server stores the message (Section 13) → 201. If a concurrent send of the same ciphertext is stored first, the server answers this send as step 6 does. Any other failure → 503 unavailable. The sender then posts the message again from its outbox.

11.11. List

GET /v1/<B>/messages carries the mailbox's pass → 200 with total_count and messages, and Retry-After.

11.12. Fetch

GET /v1/<B>/messages/<id> carries the mailbox's pass → 200, application/vnd.age, the exact bytes of the ciphertext with a Content-Length, and nothing else. A message that is gone → 404 message_not_found.

11.13. Ack

DELETE /v1/<B>/messages/<id> carries the mailbox's pass → 204. The ack deletes the message. The server keeps nothing of the deleted message (Section 11.10, step 6). A message that is gone → 404 message_not_found. Reading a message does not delete the message.

11.14. ACL

A mailbox's ACL says from which senders the mailbox's server accepts messages to the mailbox.

11.15. Revocations

The two calls in this section accept no pass (Section 8).

11.16. Accounts

A mailbox may belong to one account at its server. The protocol fixes how a mailbox joins and leaves an account. The server decides what an account does, within the promises of Section 11.5. A server without accounts does not offer these routes.

11.17. Versions

11.18. The server's document

GET /v1/ accepts no pass. The server answers with its version policy and the capabilities it serves, the same to every caller:

A server lists at most 64 deprecations, 64 sunsets, and 64 capabilities. A client reads only the members it uses.

12. Clients

12.1. Keys and the clock

12.2. Sending

A sender looks up the recipient before every post, whether the message is new or has waited (Section 11.8). Before the sender seals anything, the sender MUST check the lookup's answer:

The outbox:

A message to a group:

12.3. Receiving

A client drains its mailbox: it lists (Section 11.11), fetches the message of each list entry (Section 11.12), but one that the verdict below lets it ack without a fetch, and, once it has acked the page, lists again while the list's total_count is more than the page held:

The checks, in this order. Each check but check 9 names the code it refuses with. A client MUST NOT accept a message that does not clear every check.

  1. Check 1, decryption. The reader decrypts the file, in age's binary format (Section 9.4), trying every retained prekey (decrypt_error). A reader MUST refuse a file without exactly one native stanza as decrypt_error, before any key agreement. No server accepts such a file as a send (Section 11.10, step 7).

  2. Check 2, layout. The plaintext has the layout of Section 9.2: the envelope on line 1, then a signature block from line 2 to the first END line, followed by LF (malformed_message).

  3. Check 3, JSON. The envelope is one JSON object, read by Section 3.3's rules for a JSON text, the rule on types aside, and the envelope's body meets the same rules (invalid_envelope). Check 6 reads the types of the envelope's members. The client passes the body on unchanged.

  4. Check 4, identity. The sender's identity document comes from the envelope's identity.

    • The document is base64, has the form of Section 4.1, and has a key in its type's one encoding that meets the key checks of the key's type (invalid_identity).
    • from MUST be the document's hash (sender_mismatch).
    • The reader refuses a well-formed document whose hash is from and whose key type the reader does not verify, as unsupported_key_type.
  5. Check 5, signature. The signature meets all of these (invalid_signature):

    • the signature is over line 1 exactly as decrypted;
    • the signature is in the namespace dromas-msg-v1:<this mailbox>;
    • the signature verifies by Section 5.4, with that identity's document as the input.
  6. Check 6, envelope. The reader checks the rest of the envelope, in this order:

    Order Rule Otherwise
    1 a body is present, every member is of its type, and from and to are addresses invalid_envelope
    2 v is the integer 1 invalid_envelope
    3 to is this mailbox recipient_mismatch
    4 msg_id is in its form, and sent_at is a time invalid_envelope
    5 sent_at is no older than the TTL message_expired
    6 sent_at is no more than the skew allowance ahead of this mailbox's clock message_not_yet_valid

    A from or to that is absent or null names no address: it is refused as a mismatch, sender_mismatch at check 4 or recipient_mismatch at row 3, not at row 1.

  7. Check 7, revocation. The reader follows three steps, in this order:

    1. What the reader keeps comes first, with no call. A kept revocation of the sender's address (Section 12.5) refuses the message as sender_revoked, now and for every later message from that address (Section 10.1). A kept revocation of the sender's certificates that covers the signer (Section 5.1) refuses the message as certificate_revoked.
    2. Otherwise the reader looks up the sender's revocations (Section 11.15), once in a drain for each sender, after that sender's signature has verified. The server serves them whether or not the server holds a mailbox for the sender. The reader accepts three answers: any 2xx answer whose body parses as a revocation record (Section 10.3); a 404 revocation_not_found; and a 410 mailbox_revoked whose revocation record verifies. A 2xx answer is the server's answer, so what verifies in the record is shown, and nothing else is. For example, 200 {} shows nothing revoked, as an unsigned 404 does. Anything else is no answer, a 410 whose record does not verify among them, so the drain stops and the message stays on the server.
    3. On an answer, the reader keeps each revocation that verifies, and applies step 1 again. If nothing refuses the message, the message passes this check. A revocation that does not verify counts as nothing shown, as Section 12.5 says. A later message from that sender in the drain makes no second call, and the reader applies step 1 to the later message by what the reader then keeps.
  8. Check 8, replay. The reader computes the SHA-256 of the ciphertext. That hash is not in the replay set (message_already_received).

    • The reader refuses a message whose listed id differs from that hash (id_mismatch).
    • The replay set keeps each message's hash and (from, msg_id) until the message's sent_at + 14 days and an hour.
    • A replay set that is lost, or put back from an older copy, lacks records that the mailbox made before the loss. Section 15.9 states what that costs.
  9. Check 9, duplicate. (from, msg_id) is not in the replay set. A match means the message is a copy of a message already delivered. The reader acks the copy and does not deliver the copy again.

A reader never asks the server who a sender is. The message carries the proof of who its sender is, and check 7 reads only the sender's revocations. The reader MUST NOT pin the sender's identity before the sender's signature verifies.

The verdict.

The drain.

12.4. Renewal and key deletion

12.5. Revocation at a client

12.6. The remedy for a stolen working key

The remedy is for a working key stolen without the identity that certified that working key. A stolen identity is answered instead by revoking the address (Section 10.1). The remedy runs where the identity is. The remedy's steps run in order: the remedy first revokes, then renews.

  1. Look up the mailbox. The client looks up the mailbox at the mailbox's own server. The client verifies any revocation of the mailbox's certificates that the lookup carries, and keeps each one that verifies. The remedy goes on even if the client cannot use the lookup's answer.

  2. Revoke every certificate below the certificate serial of the mailbox's next certificate. Section 5.2 gives that certificate serial. A certificate serial that the lookup served is below that certificate serial, so the revocation covers that certificate. The client signs one of these:

    • a new revocation of certificates through the serial one below that certificate serial;
    • a new signature on a revocation of certificates through a higher revocation serial that is already kept.

    The client publishes the signed revocation once (Section 11.15).

    • A 409 serial_too_low means the server keeps a revocation of certificates through a higher revocation serial. The client then looks up the mailbox again. If that revocation verifies, the client keeps that revocation and renews above that higher revocation serial.
    • If a serial_too_low shows no revocation that verifies and covers the certificates, the remedy stops there, and the client renews nothing.
  3. Then renew. The client renews under a new working key and a certificate whose certificate serial is one above the revocation serial. The client sends nothing that an earlier renewal left, because anyone who copied the mailbox while that renewal waited has that renewal's working key.

If the revocation of a mailbox's certificates covers the certificate that the mailbox uses, the mailbox renews at its next drain.

12.7. A mailbox whose identity is kept elsewhere

A mailbox whose identity is kept elsewhere signs under certificates. The identity holder makes the mailbox's certificates and revocations. The mailbox keeps its working keys, prekeys, and state.

13. What a server stores, and for how long

A server chooses how it stores things. A server promises a client the following:

14. Compatibility and versioning

Nothing is final until version 1 is declared stable. From that declaration on:

What version 1 fixes, and how each fixed part can grow inside version 1:

Fixed Grows by
The identity document and the signed statements, byte for byte (Sections 4.1, 6, 8, 10) a new format under a new tag; a new identity or prekey key type
A certificate's type, key id, principal and one form, with no critical option or extension; its validity, a window checked at the verifier, whose longest is each server's own (Sections 5.2, 11.18) a new certificate format under a new key id
The two signer forms, their ranks, and the order (c, p) (Section 5) nothing
The namespaces, dromas-<purpose>-v1:<address> a new purpose
A signature's form and its bound (Section 3.2) a new key type, which raises the bound if its signatures are longer
The plaintext: the envelope, the signature block, the padding (Section 9) the envelope's optional members; v changes only for a breaking change
JSON as Section 3.3 reads it; a byte member's one encoding; a message's ciphertext as a send's body nothing
The largest ciphertext, 16 MiB (Section 11.10) a new version of the protocol
The routes, methods, statuses, codes and members (api/openapi.yaml) a route; an optional member; a code, which a client that does not know the code reads by the answer's status
The pass's scheme and its three parameters (Section 8) a new scheme
An error's type (Section 11.3); the link (Section 4.3) a new code

15. Security considerations

This table gives each security property, the party that the property holds against, the condition under which the property holds, and the assumption that the property rests on. The sections it names give the detail.

Property Against whom Holds while Rests on
Confidentiality of a message's content a party that holds the ciphertext, the server included, and that party with a quantum computer later (Section 15.10) the prekey that the message is sealed to has not leaked (Section 15.5) the confidentiality and integrity of the age v1 file format [age] with one mlkem768x25519 stanza (Section 9.4), whose stanza is HPKE [RFC 9180] with the MLKEM768-X25519 KEM [draft-ietf-hpke-pq-03], the X-Wing construction [X-Wing]
Confidentiality against a substituted prekey an active attacker, the server included the address reached the sender intact (Section 15.1), the mailbox's signing keys are not stolen (Section 15.5), and no quantum computer can forge a signature (Section 15.10). EUF-CMA of the signer's key type under SSHSIG (Sections 3.2, 5, 6); second-preimage resistance of SHA-384 (Section 4.2)
Forward secrecy a party that steals the mailbox's keys later from the deletion of every prekey that the message could be encrypted to, which Section 15.3 bounds. a client's real deletion of prekeys (Sections 12.4, 15.3); the first row
Sender authentication any party without the signer's private key, the server and the recipient included the sender's signing keys are not stolen (Section 15.5), and no quantum computer can forge a signature (Section 15.10). EUF-CMA of Ed25519 [BCJZ] and of ECDSA P-256, under SSHSIG and in a certificate's own signature (Sections 3.1, 3.2, 5.2); collision resistance of SHA-512 (Section 3.2), and of SHA-256 for a security key's signature (Section 3.2); second-preimage resistance of SHA-384 (Section 4.2); sign-then-encrypt [ADR]
Recipient binding (no surreptitious forwarding) a recipient that forwards a signed message to a third mailbox as a message from the sender sender authentication holds the namespace and to, both inside the signature (Sections 9.2, 15.4; Section 12.3, checks 5 and 6) [Davis] [ADR]
Key-compromise impersonation resistance a party that holds the mailbox's stolen prekey sender authentication holds the signature, by a key apart from the prekey (Section 15.4) [ADR]
Replay and duplicates the server the mailbox runs in one place, and keeps its replay set (Section 15.9). checks 6, 8 and 9 (Section 12.3), with sent_at and msg_id inside the signature

Not provided:

15.1. Threat model

Dromas protects a message's content from everyone but the message's recipient. Dromas protects the sender's identity from forgery by anyone, the server included. Dromas does not hide from the server who writes to whom.

15.2. What a hostile server can and cannot do

15.3. Forward secrecy

15.4. Sender authentication

15.5. Stolen keys

15.6. Revocation's limits

15.7. Clocks

15.8. Metadata

15.9. Addresses, messages, and availability

15.10. Post-quantum

16. Test vectors

testdata/vectors/ has the conformance vectors: scenarios, each one file or the files that share one name, and the fixtures that scenarios share, such as mailboxes A, B, and C. testdata/vectors/README.md gives each scenario's expected outcome, describes the vectors' format, and says how each vector is checked. A conforming client meets every vector of the parts it implements. The crypto and container vectors are checked by age, head, sed, ssh-keygen, and openssl, which are tools written outside this project. The keys of the crypto and container vectors are published test keys. No stock tool signs as a security key without one, so this project's code makes the vectors of the two security-key types, and ssh-keygen checks them.

17. References

17.1. Normative References

17.2. Informative References

Appendix A. Where ssh-keygen differs (informative)

ssh-keygen -Y verify checks a signature, but does not define one. So a client built on the tool checks a signature against Section 3.2 itself. Acceptance by the stock tools is not sufficient: a message that age decrypts and whose signature ssh-keygen -Y verify accepts is not thereby a message that a reader accepts, because a reader makes every check of Sections 3.2 and 12.3. ssh-keygen -Y verify accepts these forms, which Section 3.2 refuses:

The tool's builds also differ from Sections 3.2 and 4.1:

Go's libraries also differ from Section 4.1:

Appendix B. Collected ABNF

Every rule of this document, in alphabetical order. A rule that this document borrows from another document is given as prose (Section 2.2). The core rules of RFC 5234 Appendix B are not repeated.

account-id                 = 1*32( %x61-7A / DIGIT / "-" )
acl-entry                  = "*" / address
address                    = address-form "_" 64base64url-char
address-form               = %s"d"   ; the one form this version defines
address-param              = "address" BWS "=" BWS ( address / DQUOTE address DQUOTE )
adopt-key                  = %s"dra1_" ( 1*254( 4base64url-char ) [ 2base64url-char / 3base64url-char ]
                                     / 2base64url-char / 3base64url-char )   ; at most 1,024 bytes
age-recipient              = %s"age" *bech32-hrp-char "1" 6*bech32-char
base64                     = *( 4base64-char ) [ base64-final ]
base64-char                = ALPHA / DIGIT / "+" / "/"
base64-char-by-16          = %s"A" / %s"Q" / %s"g" / %s"w"   ; its value a multiple of 16
base64-char-by-4           = %s"A" / %s"E" / %s"I" / %s"M" / %s"Q" / %s"U" / %s"Y"
                             / %s"c" / %s"g" / %s"k" / %s"o" / %s"s" / %s"w"
                             / "0" / "4" / "8"   ; its value a multiple of 4
base64-final               = 2base64-char base64-char-by-4 "="
                             / base64-char base64-char-by-16 "=="
base64-nonempty            = 1*( 4base64-char ) [ base64-final ] / base64-final
base64-token               = 1*( 4( ALPHA / DIGIT / "+" ) )   ; base64 that is a token
base64url-char             = ALPHA / DIGIT / "-" / "_"
bech32-char                = "0" / %x32-39 / %x61 / %x63-68 / %x6A-6E / %x70-7A
                             ; BIP 173's alphabet: no 1, b, i or o
bech32-hrp-char            = %x21-40 / %x5B-7E   ; printable ASCII but A-Z
BWS                        = <BWS, see [RFC 9110], Section 5.6.3>
capability-name            = %x61-7A *63( %x61-7A / DIGIT / "_" )
content-range-206          = "bytes" SP range-number "-" range-number "/" range-number
dns-char                   = %x61-7A / DIGIT
dns-label                  = dns-char [ *61( dns-char / "-" ) dns-char ]
dns-name                   = dns-label *( "." dns-label )   ; at most 253 characters
domain                     = domain-label 1*( "." domain-label )
domain-label               = ( ALPHA / DIGIT ) [ *61( ALPHA / DIGIT / "-" ) ( ALPHA / DIGIT ) ]
envelope-line              = 1*( %x00-09 / %x0B-FF ) LF   ; the envelope (Section 9.1)
full-date                  = <full-date, see [RFC 3339], Section 5.6>
identity-document          = %s"dromas-v1" LF key-type SP base64-nonempty LF
implementation-text        = 1*128%x21-7E
IPv6address                = <IPv6address, see [RFC 3986], Section 3.2.2>
key-name                   = 1*( %x21-2B / %x2D-3F / %x41-7E )   ; printable ASCII, no "," or "@"
key-type                   = key-name [ "@" domain ]   ; at most 64 characters
lowhexdig                  = DIGIT / %x61-66   ; HEXDIG in lowercase
message-id                 = 64lowhexdig
msg-id                     = 8lowhexdig "-" 4lowhexdig "-" 4lowhexdig "-" 4lowhexdig "-"
                             12lowhexdig   ; the UUID of [RFC 9562], Section 4, in lowercase
msg-namespace              = %s"dromas-msg-v1:" address
not-after-param            = "not_after" BWS "=" BWS DQUOTE time DQUOTE
OWS                        = <OWS, see [RFC 9110], Section 5.6.3>
padding                    = *"."   ; Section 9.3
pass-authorization         = %s"dromas-pass" SP
                             %s"address=" DQUOTE address DQUOTE "," SP
                             %s"not_after=" DQUOTE time DQUOTE "," SP
                             %s"signature=" DQUOTE base64-nonempty DQUOTE
pass-credentials           = pass-scheme 1*SP [ pass-gap ] pass-params [ pass-gap ]
pass-gap                   = 1*( OWS "," ) OWS   ; empty list elements skipped
pass-namespace             = %s"dromas-pass-v1:" address
pass-params                = address-param pass-gap not-after-param pass-gap signature-param
                             / address-param pass-gap signature-param pass-gap not-after-param
                             / not-after-param pass-gap address-param pass-gap signature-param
                             / not-after-param pass-gap signature-param pass-gap address-param
                             / signature-param pass-gap address-param pass-gap not-after-param
                             / signature-param pass-gap not-after-param pass-gap address-param
pass-scheme                = "dromas-pass"
pass-statement             = %s"dromas-pass-v1" LF address LF server-name LF time LF
plaintext                  = envelope-line ssh-signature padding
policy-version             = version-number "." version-number
prekey-namespace           = %s"dromas-prekey-v1:" address
prekey-statement           = %s"dromas-prekey-v1" LF address LF rank LF serial LF
                             age-recipient LF time LF
range-asked                = "bytes=" 1*DIGIT "-"
range-number               = "0" / %x31-39 *DIGIT   ; no leading zero
rank                       = "0" / serial
revocation-of-address      = %s"dromas-revoke-v1" LF address LF
revocation-of-certificates = %s"dromas-revoke-certs-v1" LF address LF serial LF
revoke-certs-namespace     = %s"dromas-revoke-certs-v1:" address
revoke-namespace           = %s"dromas-revoke-v1:" address
serial                     = %x31-39 *15DIGIT   ; no leading zero
server-host                = dns-name / "[" IPv6address "]"   ; in lowercase
server-name                = server-host [ ":" server-port ]
server-port                = %x31-39 *4DIGIT   ; no leading zero, at most 65535,
                                                 ; and neither 80 nor 443
signature-even             = signature-groups LF
signature-groups           = *16( 4base64-char ) ( 4base64-char / base64-final )
signature-line             = 70base64-char LF
signature-odd              = 68base64-char
                             ( 2base64-char LF 2base64-char [ signature-groups ]
                             / 2base64-char LF base64-char-by-4 "="
                             / base64-char base64-char-by-16 LF "==" ) LF
                             ; a group of 4 split across the last two lines
signature-param            = "signature" BWS "=" BWS
                             ( base64-token / DQUOTE base64-nonempty DQUOTE )
signature-text             = *( 2signature-line ) ( signature-even / signature-odd )
                             ; two lines of 70 hold 35 groups of 4
ssh-signature              = %s"-----BEGIN SSH SIGNATURE-----" LF
                             signature-text
                             %s"-----END SSH SIGNATURE-----" LF
statement-hash             = 64lowhexdig
time                       = full-date %s"T" time-hour ":" time-minute ":" time-sec %s"Z"
time-hour                  = <time-hour, see [RFC 3339], Section 5.6>
time-minute                = <time-minute, see [RFC 3339], Section 5.6>
time-sec                   = %x30-35 DIGIT   ; 00 to 59
version-number             = "0" / %x31-39 *DIGIT

This page is PROTOCOL.md in dromas-client at v0.6.12.