1 swaprelay.smesh.lol policy
2 ==========================
3 4 The file next to this note is read by the torly-swap service
5 (/etc/systemd/system/torly-swap.service, environment /etc/torly/swaprelay.env).
6 7 What each kind is
8 -----------------
9 10 30333 gateway presence record ("the listing" of a gateway and its chains). Stored,
11 addressable, and only the gateway may publish it.
12 23197 gateway -> wallet tunnel frames (the bulk of a wallet's sync). Only the gateway may
13 publish them, and they carry no rate: delivery is paced by TORLY_OUTBOUND_BYTES_PER_SEC
14 or left at line rate.
15 23196 wallet -> gateway tunnel frames (requests and acks). Open to any wallet, rate- and
16 byte-limited per connection.
17 1 with t=blake-swap-market the standing swap offers. Only the gateway may publish them.
18 1 with t=blake-swap-market-take a participant's take, cancel or match, rate-limited.
19 /-cancel/-match
20 1 with any d tag directed swap coordination messages (kind 1, d=swap id),
21 rate-limited. This is what the two swap engines exchange.
22 5 deletions, authenticated, rate-limited.
23 24 Everything else is refused.
25 26 The gateway key
27 ---------------
28 29 The three rules marked with the all-zeros key are the gateway-only ones. Replace every
30 0000000000000000000000000000000000000000000000000000000000000000 with the gateway's
31 *public* key (64 hex). The public key is what nostrino-bridge prints in its connection URI:
32 33 nostr+chaindata://<PUBKEY>?chains=...&relay=wss%3A%2F%2Fswaprelay.smesh.lol&v=1
34 35 Until it is replaced, those kinds cannot be published at all (the zero key is nobody), which
36 is the safe default: the relay refuses rather than trusting an unregistered key.
37 38 After editing, validate and restart:
39 40 torly-swap -h >/dev/null # no; use the service check below
41 systemctl restart torly-swap
42 journalctl -u torly-swap -n 50 --no-pager
43 44 A policy that does not parse stops the service instead of running permissive, and the error
45 names the file and the rule.
46 47 The relay URL for the gateway and for clients
48 ---------------------------------------------
49 50 wss://swaprelay.smesh.lol/
51 52 NIP-11: https://swaprelay.smesh.lol/ with Accept: application/nostr+json
53 Health: https://swaprelay.smesh.lol/health
54