PROFILE-mail-v1: Sovereign Email Hosting and Delegated Mailbox Access
- Version:
1.0.0-draft.2 - Service Type:
mail(registry/service-types.json) - Status:
draft(normative profile rulesdecided) - Evidence / Maturity:
vectors(vectors/trace-01-mail-offline-revoke.json,vectors/refusal-coverage-matrix.json) - Requires:
SPEC-01,SPEC-02,SPEC-03,SPEC-06,SPEC-07 - Schemas:
schemas/profile-mail.schema.json
1. Purpose
This profile defines sovereign email hosting where the **holder owns her identity (id/alice), not the mail host**, binds one or more labeled mailboxes (personal, work, etc.) by pinned NamePin in seallink-manifest/1, switches providers without losing identity, and issues fine-grained UTXO-revocable grants (e.g., permitting an agent or accountant to read only "Invoices" while the issuer's devices remain offline).
2. Manifest Declarations, Discovery, and Transport Binding
2.1 User Provider Binding (SL-MAIL-001, decided)
A holder id/alice declares each hosted mailbox in seallink-manifest/1 providers[] using a full NamePin:
{
"label": "work",
"provider": {
"name": "id/mail-host-a",
"owner_policy": {"kind": "key", "pk": "02..."},
"registration": {"txid": "...", "vout": 0}
},
"service_type": "mail"
}
An actor MAY bind multiple mail providers under distinct label values (personal, work, archive).
2.2 Mail Provider Self-Declaration, External Discovery, and Mutual Auth (SL-MAIL-002, decided)
- A mail provider
id/mail-host-adeclares in its ownseallink-manifest/1service:service_type:"mail"actions: subset of["mail/list", "mail/read", "mail/send"]receipt_key: pinned BIP-340receiptkeyendpoint: HTTPS base URLtls_spki_sha256: SHA-256 of the server's DER-encoded SubjectPublicKeyInfo (alternatively pinned via a signedseallink-statement/1withstatement_kind = "transport-binding"andtransport = "https-tls-spki"in the provider'scertsset).
- Mutual authentication: Clients MUST verify the server's TLS certificate SPKI against
tls_spki_sha256(or the verifiedtransport-bindingstatement) AND verify everyseallink-receipt/1againstservice.receipt_key. - External sender mailbox discovery: An external sender targeting
id/aliceresolvesid/alice's confirmedseallink-manifest/1, selects theproviders[]entry for("mail", label)(defaultlabel = "primary"if unspecified, or advertised inseallink-card/1transports), resolves the pinnedproviderNamePin, and delivers to the provider'sservice.endpoint(or SMTP MX authenticated via the provider's manifest/card transport declaration).
3. Orthogonal Action Properties Table
| Action | Kind | external_mutation | discloses_data | quota_consuming | allows_executor_ref | requires_contract | require_seal | Risk Class |
|---|---|---|---|---|---|---|---|---|
mail/list | Mechanical effect | false | true | false (optional) | true *(iff no quotas)* | false | true | Class 2 (90m) |
mail/read | Mechanical effect | false | true | false (optional) | true *(iff no quotas)* | false | true | Class 2 (90m) |
mail/send | Mechanical effect | true | false | true (seallink/count) | false *(concrete executor MUST be pinned)* | false | true | Class 1 (60m) |
All three actions are mechanical effects and MUST refuse grants carrying terms_text (GRANT_TEXT_FORBIDDEN).
4. Target, Closed Argument/Result Schemas, and result_sha256 (SL-MAIL-003, decided)
- Target grammar:
mailbox:<owner_name>:<label>(e.g.,mailbox:id/alice:work). The provider MUST verify that<owner_name>'s confirmedseallink-manifest/1binds this provider's exactNamePinfor("mail", <label>)(SERVICE_PROVIDER_UNBOUNDotherwise) AND that the root grant was issued by<owner_name>(or its satisfied guardian quorum if<owner_name>is award). - Closed argument and result schemas: All
invocation.argumentsand returned result objects MUST validate strictly againstschemas/profile-mail.schema.json:mail/list:MailListArgs->MailListResultmail/read:MailReadArgs->MailReadResultmail/send:MailSendArgs->MailSendResult
- **Normative
result_sha256formula (SL-MAIL-006,decided):** For everyoutcome = "executed"response,receipt.payload.result_sha256MUST equalSHA256(canonical_JCS(result_object))whereresult_objectconforms to the action's closed result schema above. Formail/read, raw RFC 5322 message bytes travel alongside the signed receipt and MUST hash toMailReadResult.mime_sha256. - Replay semantics: For
mail/listandmail/read, a duplicateinvocation_idwithin[iat, exp)MAY return the cached signed receipt; formail/send, a duplicateinvocation_idMUST perform zero second SMTP handoff and MUST return the original stored signed receipt (includingoutcome = "uncertain"if unresolved).
4.1 Constrained Arguments and Server-Side Enforcement (SL-MAIL-004, decided)
| Action | Argument | Schema Type | Supported where Predicates |
|---|---|---|---|
mail/list, mail/read | folder | string | eq, in, not_in, prefix |
mail/list, mail/read | sender_domain | string (lowercase ASCII) | eq, in, not_in, suffix |
mail/read | message_id | string | eq, in |
mail/list, mail/read | max_bytes | uint64_str | range |
mail/send | to | string | eq, in, not_in, suffix |
mail/send | subject | string | eq, prefix |
mail/send | body_sha256 | hex64 | hash_eq |
mail/send | size_bytes | uint64_str | range |
- **Server-side verification for
mail/read:** If the grant constrainsfolder,sender_domain, ormax_bytes, the provider MUST verify the actual stored message's folder,Fromdomain, and byte length satisfy everywherepredicate before returning bytes (INVOKE_CONSTRAINT_FAILED). A caller MUST NOT bypass afolderpredicate by passing amessage_idbelonging to another folder. - **Quota reservation for
mail/send:** MUST reserve1unit from{"kind":"seallink/count","resource":"mailbox:<owner>:<label>","unit":"messages"}atomically in the fenced journal (SPEC-06 §6) before SMTP submission, retaining the reservation if handoff outcome isuncertain.
5. Snapshot Pagination and Provider Cut-Over (SL-MAIL-005, decided)
- A
mail/listrequest withpage = 0and nosnapshot_idestablishes a provider-local immutable snapshot (snapshot_id, TTL<= 300s, frozen to matching messages present at that invocation's observation). - Subsequent pages (
page > 0) MUST passsnapshot_idin a newly signedseallink-invocation/1, re-running the fullSPEC-06 §4pipeline (including live UTXO seal check). - Messages arriving after snapshot creation do NOT appear in pages of that
snapshot_id. If the grant's seal is spent between page 0 and page 1, page 1 refusesGRANT_CLOSED(if already journaled) orSEAL_SPENT(if first witnessed on page 1) and discards the snapshot. - Provider switch: Snapshots are strictly local to the issuing provider and are NOT exported during
seallink-migration/1. Presenting an old provider'ssnapshot_idto a new provider refusesINVOKE_CONSTRAINT_FAILED; the caller restarts atpage = 0on the new provider.
6. Reference End-to-End Trace (vectors/trace-01-mail-offline-revoke.json)
The complete byte-level trace (signed JCS objects, BIP-340 signatures, OP_RETURN hex, result_sha256, journal hash chain, and exact refusal codes) is published in vectors/trace-01-mail-offline-revoke.json:
id/alicebindsid/mail-host-a(by fullNamePin) for("mail", "work")in herseallink-manifest/1.id/alicesigns a unilateralseallink-grant/1toid/alice-acct-agent(recipient.mode = "name", pinningid/alice-acct-agentand itsowner_policy) usingexecutor_ref: {"provider_of":"id/alice","service_type":"mail","label":"work"}(valid becausemail/readhasexternal_mutation = false,quota_consuming = false,allows_executor_ref = true, and noquotas) withwhere: {"folder": {"in": ["Invoices"]}}and confirmed UTXOsealanchored by0x01.id/alicetakes all her devices offline.id/alice-acct-agentsends a signedseallink-invocation/1(folder = "Invoices",message_id = "msg-2026-001") + inline grant + inline manifest toid/mail-host-a.id/mail-host-arunsSPEC-06 §4on its own Namecoin node (resolvingid/alice-acct-agent's confirmed name and request key at Step 11a) -> Admits, returnsMailReadResult(size_bytes = "69", matching the exact 69-byte RFC 5322 payload) + raw MIME bytes + signedseallink-receipt/1(outcome = "executed",result_sha256 = SHA256(JCS(MailReadResult))).- A second invocation requesting
folder = "Personal"fails Step 11d -> RefusesINVOKE_CONSTRAINT_FAILED(non-closing). - Later,
id/alicespendssealfrom a secondary device.id/mail-host-awitnesses the spend in its mempool and durably writes aclosure(cause="SEAL_SPENT")entry to its fenced journal (c(0) -> c(1)). - When
id/alice-acct-agentsends a newmail/readinvocation for"Invoices", Step 6a ofSPEC-06 §4hits the durable closure journal and returns the single deterministic refusal code **GRANT_CLOSED** with signedseallink-receipt/1(outcome = "refused",refusal_code = "GRANT_CLOSED").
7. Export Boundary (SPEC-07 §2)
A mail migration manifest (seallink-migration/1) exports RFC 5322 message blobs, folder assignments, message IDs, delivery receipts, and accounting evidence (settled mail/send counts + uncertain SMTP handoffs). It NEVER exports DKIM signing keys, SMTP relay credentials, TLS private keys, or active bearer tokens.