Implement end-to-end encrypted buyer/seller messaging

Wire format (internal/message): sealed boxes to the listing's device key
(X25519 + HKDF + ChaCha20-Poly1305), padded, proof-of-work stamped, with
signed owner replies and address grants. Relay validation, bounded queues,
gossip on per-region message topics and sync (store, p2p).

Owner side (internal/inbox, API): inbox with hidden link messages and a
per-day new-thread limit, replies, grants, and a private per-listing
address. Public POST/GET /api/v1/messages for buyers.

Browser: noble-based sealing and reply verification checked against a Go
fixture, contact form, conversation view, message list, de/en strings.

Docs: PROTOCOL.md messaging section matches the implementation.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-17 19:44:59 +01:00
co-authored by Claude Sonnet 5.5
parent b9e1b0c058
commit 3b0351c774
45 changed files with 8228 additions and 292 deletions
+120 -4
View File
@@ -46,8 +46,66 @@ const de = {
"detail.location": "Lage (ungefähr, ca. 1 km)",
"detail.map": "Auf OpenStreetMap ansehen (externe Seite)",
"detail.contact": "Kontakt",
"detail.contactSoon":
"Der Kontakt zum Anbieter läuft über dessen eigenen Knoten und ist noch nicht verfügbar. Die genaue Adresse wird nie öffentlich verteilt.",
"nav.messages": "Meine Nachrichten",
"contact.title": "Anbieter kontaktieren",
"contact.intro":
"Deine Nachricht wird verschlüsselt. Das Netzwerk sieht nur, dass jemand zu dieser Anzeige geschrieben hat, nicht wer und nicht was. Du brauchst kein Konto. Die genaue Adresse gibt der Anbieter selbst frei.",
"contact.rules":
"Die erste Nachricht muss kurz sein und darf keine Links enthalten. Das schützt vor Betrug; nach der ersten Antwort des Anbieters entfällt es.",
"contact.label": "Deine Nachricht",
"contact.counter": "{used} / {max} Bytes",
"contact.send": "Verschlüsselt senden",
"contact.sending": "Wird vorbereitet … (eine kleine Rechenaufgabe gegen Spam)",
"contact.already": "Du hast diesem Anbieter schon geschrieben.",
"contact.open": "Unterhaltung öffnen",
"problem.empty": "Bitte schreibe eine Nachricht.",
"problem.long": "Die Nachricht ist zu lang.",
"problem.control": "Die Nachricht enthält unerlaubte Sonderzeichen.",
"problem.invalid": "Die Nachricht enthält ungültige Zeichen.",
"problem.link":
"Die erste Nachricht darf keine Links oder Webadressen enthalten (auch kein „Hallo.Ich“ ohne Leerzeichen nach dem Punkt).",
"send.404":
"Dieser Knoten kennt die Anzeige nicht (mehr), oder der Anbieter hat sein Gerät gewechselt. Lade die Anzeige neu.",
"send.429": "Zu viele Nachrichten. Bitte warte einen Moment.",
"send.other": "Senden fehlgeschlagen: {detail}",
"send.network": "Der Knoten ist nicht erreichbar.",
"chat.back": "← Zur Anzeige",
"chat.all": "← Alle Nachrichten",
"chat.title": "Unterhaltung zu: {title}",
"chat.untitled": "Anzeige {id}",
"chat.you": "Du",
"chat.owner": "Anbieter",
"chat.verified": "Vom Anbieter dieser Anzeige (Signatur geprüft)",
"chat.empty":
"Noch keine Antwort. Der Anbieter bekommt deine Nachricht, sobald sein Knoten online ist (die Nachricht bleibt bis zu 14 Tage im Netz).",
"chat.reply": "Antworten",
"chat.replyRules": "Solange der Anbieter nicht geantwortet hat, gelten die Regeln der ersten Nachricht.",
"chat.link": "Dein privater Link zu dieser Unterhaltung",
"chat.linkHelp":
"Setze ein Lesezeichen. Wer diesen Link kennt, kann die Unterhaltung lesen, gib ihn also nicht weiter. Ohne den Link und ohne die Daten dieses Browsers ist die Unterhaltung verloren.",
"chat.noStorage":
"Dieser Browser speichert hier nichts (privates Fenster?). Die Unterhaltung geht verloren, wenn du die Seite schließt, außer du merkst dir den Link unten.",
"chat.gone":
"Die Anzeige ist nicht mehr verfügbar. Antworten des Anbieters kannst du weiter empfangen, aber nicht mehr schreiben.",
"chat.unverified": "Die Anzeige konnte nicht geprüft werden, daher kannst du gerade nicht schreiben.",
"chat.pollError": "Antworten konnten nicht abgerufen werden.",
"chat.rejected": "{n} Nachricht(en) im Postfach konnten nicht als echt bestätigt werden und werden ignoriert.",
"chat.limit": "Nicht prüfbar: ob der Anbieter sein Gerät inzwischen gesperrt hat.",
"chat.delete": "Unterhaltung aus diesem Browser löschen",
"chat.deleteSure": "Wirklich löschen? Ohne den Link ist sie dann weg.",
"chat.deleteYes": "Ja, löschen",
"grant.title": "Adresse vom Anbieter freigegeben",
"grant.address": "Adresse",
"grant.phone": "Telefon",
"grant.email": "E-Mail",
"grant.note": "Hinweis des Anbieters",
"grant.until": "Angezeigt bis {date}",
"grant.expired": "Eine Adressfreigabe des Anbieters ist abgelaufen und wird nicht mehr angezeigt.",
"grant.privacy": "Gib diese Angaben nicht weiter.",
"inbox.title": "Meine Nachrichten",
"inbox.none": "Du hast noch keine Unterhaltungen. Öffne eine Anzeige und schreibe dem Anbieter.",
"inbox.last": "Zuletzt: {date}",
"inbox.note": "Diese Liste liegt nur in diesem Browser.",
"verify.title": "Prüfung in deinem Browser",
"verify.intro":
"Diese Prüfung läuft lokal, nicht auf dem Server. Ein Knoten kann Anzeigen also nicht unbemerkt fälschen.",
@@ -112,8 +170,66 @@ const en: Record<keyof typeof de, string> = {
"detail.location": "Location (approximate, about 1 km)",
"detail.map": "View on OpenStreetMap (external site)",
"detail.contact": "Contact",
"detail.contactSoon":
"Contact goes through the owner's own node and is not available yet. The exact address is never distributed publicly.",
"nav.messages": "My messages",
"contact.title": "Contact the owner",
"contact.intro":
"Your message is encrypted. The network only sees that someone wrote about this listing, not who and not what. You need no account. The owner releases the exact address themselves.",
"contact.rules":
"The first message must be short and must not contain links. This protects against scams; it ends once the owner has replied.",
"contact.label": "Your message",
"contact.counter": "{used} / {max} bytes",
"contact.send": "Send encrypted",
"contact.sending": "Preparing … (a small puzzle against spam)",
"contact.already": "You have already written to this owner.",
"contact.open": "Open conversation",
"problem.empty": "Please write a message.",
"problem.long": "The message is too long.",
"problem.control": "The message contains characters that are not allowed.",
"problem.invalid": "The message contains invalid characters.",
"problem.link":
"The first message must not contain links or web addresses (that includes \"Hello.I\" without a space after the full stop).",
"send.404":
"This node does not know the listing (anymore), or the owner changed device. Reload the listing.",
"send.429": "Too many messages. Please wait a moment.",
"send.other": "Sending failed: {detail}",
"send.network": "The node is not reachable.",
"chat.back": "← Back to the listing",
"chat.all": "← All messages",
"chat.title": "Conversation about: {title}",
"chat.untitled": "Listing {id}",
"chat.you": "You",
"chat.owner": "Owner",
"chat.verified": "From the owner of this listing (signature verified)",
"chat.empty":
"No reply yet. The owner receives your message once their node is online (it stays in the network for up to 14 days).",
"chat.reply": "Reply",
"chat.replyRules": "Until the owner has replied, the rules of the first message apply.",
"chat.link": "Your private link to this conversation",
"chat.linkHelp":
"Bookmark it. Anyone who knows this link can read the conversation, so do not share it. Without the link and without this browser's data, the conversation is lost.",
"chat.noStorage":
"This browser does not store anything here (private window?). The conversation is lost when you close the page unless you keep the link below.",
"chat.gone":
"The listing is no longer available. You can still receive the owner's replies, but not write any more.",
"chat.unverified": "The listing could not be verified, so you cannot write right now.",
"chat.pollError": "Replies could not be fetched.",
"chat.rejected": "{n} message(s) in the mailbox could not be confirmed as genuine and are ignored.",
"chat.limit": "Cannot be checked: whether the owner has since revoked their device.",
"chat.delete": "Delete this conversation from this browser",
"chat.deleteSure": "Really delete? Without the link it is gone.",
"chat.deleteYes": "Yes, delete",
"grant.title": "Address released by the owner",
"grant.address": "Address",
"grant.phone": "Phone",
"grant.email": "Email",
"grant.note": "Note from the owner",
"grant.until": "Shown until {date}",
"grant.expired": "An address release from the owner has expired and is no longer shown.",
"grant.privacy": "Do not pass these details on.",
"inbox.title": "My messages",
"inbox.none": "You have no conversations yet. Open a listing and write to the owner.",
"inbox.last": "Last activity: {date}",
"inbox.note": "This list is kept only in this browser.",
"verify.title": "Checked in your browser",
"verify.intro":
"This check runs locally, not on the server, so a node cannot forge listings unnoticed.",