messaging: the price of writing to a listing rises as its queue fills

Flooding a listing's inbox now gets dearer with every envelope. Relays ask
more proof-of-work from half full on, the node tells browsers the current
price, and the browser mines to it (or says the listing is too busy).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AeFqV96dVeBX94inzcgZKw
This commit is contained in:
2026-11-18 20:59:11 +01:00
co-authored by Claude Sonnet 5.5
parent 13c82f8d59
commit 253eb6e75c
12 changed files with 379 additions and 35 deletions
+1
View File
@@ -105,6 +105,7 @@ func New(cfg Config) http.Handler {
// Messaging: public relay endpoints for buyers' browsers...
mux.HandleFunc("POST /api/v1/messages", s.postMessage)
mux.HandleFunc("GET /api/v1/messages", s.getMailbox)
mux.HandleFunc("GET /api/v1/messages/required", s.getRequiredWork)
// ...and the owner's inbox and private address, behind the admin token.
if cfg.Inbox != nil {
mux.HandleFunc("GET /api/v1/mine", s.admin(s.mine))