Delivery Status Notifications
SMTP tells a sender what happened to their message with a bounce. A bridge does the same with a kind 7679 event, without telling the relays who it is talking to.
The event
{
"kind": 7679,
"pubkey": "<bridge_permanent_pubkey>",
"tags": [
["r", "<email_id>"],
["ephemeral-pubkey", "<temp_pubkey>"]
],
"content": "<nip44_encrypted_content>"
}
Why it is shaped this way
The sender is found through the r tag: only someone who knows the email-id
of an email they sent can ask for its notifications.
Content
NIP-44 encrypted JSON:
{
"status": "delivered",
"recipient": "bob@example.com",
"smtp_code": 250,
"smtp_response": "2.1.5 OK",
"attempted_at": 1735401600,
"delivered_at": 1735401605,
"details": "Email successfully delivered to recipient's SMTP server"
}
Sending one, as a bridge
-
Generate an ephemeral keypair.
-
Encrypt the JSON with NIP-44 using the ephemeral private key and the sender's pubkey.
-
Build the kind 7679 event with the
randephemeral-pubkeytags, signed by the bridge's permanent key. -
Destroy the ephemeral private key. Never write it to disk.
-
Publish.
Reading one, as a sender
{
"authors": ["<bridge_pubkey>"],
"kinds": [7679],
"#r": ["<email_id>"]
}
Take temp_pubkey from the ephemeral-pubkey tag, decrypt the content with
NIP-44 using your private key and that pubkey, and read the JSON.
This is why the email-id tag matters on the way out: without it, there is
nothing for a notification to point at.