Expand description
Agent Mail 1.0: signed cards and letters, HPKE packets, and explicit local state.
Relays never receive decryption keys. A verified letter is untrusted content,
not authorization to execute a task. State helpers are in-memory models;
applications must persist snapshots atomically before acknowledging delivery.
Relay paths are fixed at {route}/v1/mailboxes.
Structs§
- Delivery
Result - Anonymous delivery result. It never carries the mailbox
seq. - Mail
Address - A parsed mailbox address (Mail Section 3.3).
routesis empty for the stable form. - Mail
Card Cache - Sender-side pins: the greatest-nonce card seen per (owner, mailbox),
including closed or expired cards. Save
snapshot()after every observation, even one that returns an error for an unusable new pin. - Mail
Encryption Key - Independent X25519 secret. Debug output and implicit serialization are absent.
export_secretis explicit and returns a buffer zeroized on drop. - Mail
Inbox - Cross-route letter deduplication. The application stores accepted letters;
persist the inbox snapshot with them before deleting relay copies or acting.
acceptnever executes content or sends replies. - Mail
Keyring - Retained verified cards and their secrets, by card hash, through
receive_until. - Mail
Part - Mail
Relay Store - Framework-neutral in-memory relay model, NOT a hosted or durable service. All outputs are owned copies. Save/restore snapshots atomically in a real service; enforce admission limits and serialized access outside this model. The short-lived Identity nonce cache is not part of the snapshot.
- Mailbox
Card Payload - Message
Payload - Packet
- Packet
Header - Packet
Record
Enums§
Constants§
Functions§
- canonical_
bytes - decode_
bytes - decrypt_
packet - Stateless authenticated opening of a historical packet. This verifies shape,
cryptography and future skew; callers must enforce new-acceptance expiry and
durable deduplication (
MailInboximplements those state transitions). - encode_
bytes - encrypt_
letter - Production encryption: fresh system randomness, one HPKE context per packet.
Caller should observe the card with
CardCachebefore using it. - format_
mail_ address - Format the stable address, or a contact address when routes are given.
- frame_
bytes - Exact framing, also useful for boundary conformance tests. Inputs are bounded.
- hash_
bytes - packet_
id - parse_
card - parse_
letter - parse_
mail_ address - Parse
did:agent:<key>/mail/<mailbox_id>[?route=<origin>...](Mail Section 3.3). - parse_
packet - random_
id - sign_
card - sign_
message - validate_
card - Historical verification: checks intrinsic validity, not live-write freshness.
- validate_
card_ for_ sending - validate_
discovery - Informational discovery document; it never supplies delivery paths.
- validate_
letter - Verify a letter as a historical object. Freshness/deduplication is performed
by
MailInbox, so a delayed low-nonce letter is never rejected here. - validate_
mail_ schema - Validate a named structural definition; signatures and semantics are separate.
- validate_
packet - validate_
reply - Bind a reply to a known parent: participants, parent letter ID, and thread.
- verify_
owner_ jwt - Identity request JWT for this relay origin whose subject is the mailbox owner.