Space Backup Manual

Space Relay and billing

Chapter 11 of 14 · Contents

Space Relay connects your company's computers and phones when they are at different places and cannot reach each other directly; it carries their already encrypted traffic, stores nothing and cannot read anything. This chapter explains when it is used, what it sees, its settings and status lines, what it costs and how to buy credit, and its wire protocol for integrators.

What Space Relay is#

Space Backup copies files between your own computers and drives. Inside one office the computers find each other on the local network (LAN) and talk directly. When a company has more than one place (two offices, a laptop at home, a phone on cellular), the computers at one place cannot see those at the other: home and office routers do not let a connection in from outside.

Space Relay is a small service run by Digital Sign Technologies at relay.spacebackup.net (TCP port 47900). Every Space Backup app keeps one tiny connection open to it. Through that connection:

The relay never holds a file. It is not cloud storage: when a backup goes from the office to a laptop at home, it goes from one of your computers to another, and Space Relay only passes it along.

Note: Space Backup itself is free on your own network: any number of computers, drives, folders and backups. Only traffic that actually goes through the relay is counted, and each company gets 50 GB of it free every month. See Billing and prices.

For a short overview of where Space Relay fits, see Space Relay in short.

How a connection is made#

Every time one device needs another (a backup to a computer's drive, a restore, a phone browsing its photos), the app picks the way in this order and uses the first that works:

OrderWayWhen it is usedThrough the relay?Counted?
1LANThe other computer is seen on this network (its announcement arrives here).NoNo
2Same siteThe relay says the other computer has the same public IP address as this one (both behind one router, but the LAN announcement did not get through, e.g. different subnets), or one of the other computer's LAN addresses is on one of this device's own networks (the public addresses can differ on one LAN: IPv6 for one and IPv4 for the other, two lines out of one office, or the relay not having said yet). Its LAN addresses are tried, 1.5 seconds each.No (the relay only told the addresses)No
3RelayedNothing above worked. The relay opens a pipe between the two.YesYes

What the app remembers:

Whatever the way, the devices then run their own security handshake with the company key, and everything after it is encrypted end to end between them (see What the relay can and cannot see). The relay cannot tell a backup from a restore; it sees only bytes.

Note: Phones only connect out. A phone is never connected to: no computer tries to reach it, and the relay sets up no pipe towards it. The phone reaches a computer on the LAN when it is on the same network (it learns the computer's LAN addresses from the relay and tries them when both have the same public IP or the address is on one of the phone's own networks), otherwise through a relay pipe.

No direct connections from the internet#

A computer is never reachable directly from the internet. It asks the router for no port forwarding (no UPnP, no NAT-PMP) and tells the relay no public port. Other devices reach it in one of two ways only: on its own network (its LAN addresses, when they are on the same network), or through a relay pipe. Computers at other places always go through the relay. Older versions forwarded the peer port and announced it; the relay no longer passes that port on, so no device of any version dials a computer at its public address.

Which way each computer is reached#

The Destinations window only says, in plain words, when computers at other places cannot be reached. To see exactly how each paired computer is reached, use the CLI:

sbctl dest list           # Windows
spacebackup dest list     # Linux and macOS
spacebackup peers         # Linux and macOS: each peer with lan / relayed

Each peer shows LAN or relayed, and the round-trip time of the last handshake. stats shows the relayed bytes used.

Keeping relayed traffic low#

Relayed traffic is what costs money, so Space Backup avoids it where it can:

Space Relay is on by default#

Every install connects to the relay automatically. There is nothing to type: no address, no token, no certificate. The computers of one company meet at the relay because they hold the same company key (the relay is told a one-way fingerprint of it, never the key; see Joining a group).

When the relay is on but not needed (all your computers are in one office), its connection only sends a tiny keepalive every 30 seconds and carries no data. Data goes through it only when no LAN way exists.

Upgrades: an install from before version 0.9 that had the relay off and no relay token is turned on once (off was the old default, not a choice). If you turned the relay off yourself, it stays off; upgrades never change your choice again.

Turning it on or off#

On Windows: tray icon → Settings… → Space Relay → Connect PCs at other sites through Space Relay.

On Linux: spacebackup-gui → Settings → Space Relay → the same checkbox.

Settings → Space Relay on Windows
Settings → Space Relay on Windows
Settings → Space Relay on Linux
Settings → Space Relay on Linux

From the command line (all computers):

sbctl settings set relay off          # Windows
spacebackup settings set relay off    # Linux and macOS

Turned off, this computer neither finds nor is found by computers at other places; computers on its own network keep working as before. Phones that are away from the office then cannot reach it either.

What the relay can and cannot see#

The relay is built so that a person running it (or someone who broke into it) learns as little as possible.

The relay seesThe relay never sees
The public IP address each device connects from, and whenThe company key or any data key
Each device's name (its machine name, e.g. ANNA-PC), app version and a random instance idFile contents, file names, folder names
Each device's LAN addresses and forwarded port (so others can connect directly)Which files are backed up or restored, or when a backup runs
The group id: a one-way HMAC of a key derived from the company keyYour company's name, members or emails
A sealed blob per computer (its LAN announcement, encrypted with the company key), passed on unreadWhat is inside the announcement (destinations, free space)
How many bytes each pipe carried, and how long it lastedWhat is inside a pipe: the devices' own encrypted channel

What it does with that:

See Security model for the whole picture, including what our account service sees.

Status lines#

Under the checkbox in Settings, one line says what the relay is doing. The same line is the read-only setting relay-status (settings get relay-status) and relay.status in status --json.

LineMeaningWhat to do
Connected · 1.2 GB relayed this monthConnected. The number is your whole company's relayed traffic this month (in + out, all its computers), in decimal GB (or MB below 0.1 GB).Nothing.
Not needed: all PCs are on this networkConnected, no computer of your company is reachable only through the relay, and nothing was relayed this month.Nothing: the relay stays connected so that a computer at another place can find this one.
Connecting…Just started, or reconnecting.Wait a few seconds.
Can't reach the relay (offline?)No connection for 20 seconds or more: this computer is offline, or a firewall blocks outgoing TCP 47900.Check the internet connection; allow outgoing TCP to relay.spacebackup.net:47900 (see Firewall and ports). Computers on this network keep working.
Can't reach the relay: the relay's certificate is not valid: …The TLS certificate was refused: not trusted, not issued for the relay's name, or not the pinned fingerprint. The line says which.Usually a network that intercepts TLS (a company proxy or antivirus "HTTPS scanning"). Exempt relay.spacebackup.net:47900 from it. If you set relay-address or relay-fingerprint yourself, check them.
The relay refused this PC: …The relay refused the connection: a relay token that is unknown or revoked, a group blocked for abuse, or a limit (too many computers in one group, too many new groups from one IP address in a day).Read the reason. For a token problem, clear or fix relay-token. Otherwise contact support@spacebackup.net.
Activation needed: this month's free relay traffic is used (PCs on the same network keep working)Your company used its free 50 GB this month and has no prepaid credit left. The relay keeps the connection (other places still see this computer) but carries no data.Buy credit: Activate Space Relay… (see How to buy credit).

Other places it shows:

Note: When activation is needed, nothing breaks silently: backups to computers on the same network keep running. Only the computers that can be reached through the relay alone wait. Their backups are not lost; they catch up once credit is bought.

Settings#

Settings shows one checkbox, the status line, the balance line and the buttons. Everything else is deliberately hidden: there is no Advanced section on any platform. The other settings exist as settings keys for IT people and test setups, with the same defaults everywhere. A value set from the CLI keeps working and is kept when someone saves the Settings window.

KeyValuesDefaultIn the window?What it does
relayon / offonYes: Connect PCs at other sites through Space RelayUse the relay. Setting it records it as your choice; upgrades never change it.
relay-addresshost:port (IPv6 as [addr]:port)relay.spacebackup.net:47900NoThe relay to use. A config with the pre-0.8 default spacerigs.io:47900 is moved to the new name on start.
relay-tokena token, - (read it from standard input), --file F, or nonenot setNoOnly for pre-provisioned (enterprise) accounts; not needed by anyone else. Never printed: settings get shows only whether it is set.
relay-fingerprintSHA-256 hex (64 digits, with or without :) or nonenoneNonone: the certificate is checked normally (trusted chain, valid for the name; the production relay has a Let's Encrypt certificate). A fingerprint pins a self-signed relay instead.
relay-statusread-onlyThe status lineSee Status lines.
relay-balanceread-onlyThe balance lineThe company's relay credit in one line; empty when not signed in or not read yet.
relay-activate-urlread-onlyThe activation page once this month's free traffic is used; else empty.
lan-discoveryyes / noyesNoLinux and macOS only, for tests: no finds peers only through the relay (restart to apply).

Examples:

# Windows
sbctl settings get relay-status
sbctl settings set relay-address relay.spacebackup.net:47900
sbctl settings set relay-fingerprint none

# Linux and macOS
spacebackup settings get relay-balance
echo 'k_example_token' | spacebackup settings set relay-token -
spacebackup settings set relay-token none

Where they are kept: config.json (UseRelay, RelayUserChoice, RelayAddress, RelayFingerprint). The relay token is a secret and is kept apart: DPAPI-encrypted for the user on Windows, the file ~/.config/spacebackup/relay-token (mode 0600) on Linux, the login Keychain on macOS. It is never put into config.json or a diagnostic bundle.

The full list of settings keys is in Settings keys.

Billing and prices#

What is free and what is paid#

PackPrice (USD)Per 100 GBLookup key (API)
500 GB$9$1.80sb_pack_500
2 TB$25$1.25sb_pack_2000
5 TB$49$0.98sb_pack_5000

How it is measured:

Activation needed#

When the month's free 50 GB are used and there is no prepaid credit left, the company needs activation:

At the 1st of the next month the free 50 GB are there again, so a company that never buys simply waits for the next month.

Note: A company is billed as a company only once one of its computers is signed in with an email (Settings → Account). A signed-in app links the company's relay group to the company on our account service. A group no signed-in app has linked yet still gets 5 GB free a month from the relay itself, but cannot buy credit until someone signs in.

Low credit and auto top-up#

How to buy credit#

Any active member of the company can buy. There are four ways in; all end on the same buy screen of your account page, then Stripe Checkout.

  1. From the app's Settings. Windows: tray → Open Space Backup → Settings → Space Relay → Buy relay credit… (shown when signed in and payments are available), or Activate Space Relay… (shown when activation is needed). Linux: spacebackup-gui → Settings → Space Relay, the same buttons. They open the browser on a single-use link, valid 15 minutes, that signs the browser in as this computer's email and shows the buy screen. No password, no second sign-in.
  2. From the CLI:
    sbctl relay buy --open            # Windows: prints the link and opens it
    spacebackup relay buy             # Linux / macOS: prints the link alone on the first line
    spacebackup relay activate --open # what Activate Space Relay… does

    relay activate gives the same single-use buy link when this computer is signed in; when it is not, it gives the relay's activation page instead (it asks you to sign in in the app first). Not signed in and no activation page: exit code 1.

  3. On the web: sign in at https://spacebackup.net/account/ with your email, then open Space Relay credit (https://spacebackup.net/account/relay; the address https://spacebackup.net/account/?next=relay signs in and goes there).
  4. The activation link the relay hands out when activation is needed (https://spacebackup.net/account/relay/activate?group=<group code>, for example …?group=7KQ2-M9XD): signed in, it shows the buy screen; otherwise it explains how to sign in.
The Space Relay credit page on the web
The Space Relay credit page on the web

The buy screen shows the company's balance (Free this month: 3.2 / 5 GB · Prepaid: 87 GB), "activation needed" in red when it applies, whether auto top-up is on, and the three packs, each with its price per 100 GB, the auto top-up checkbox and a Buy button.

Paying:

  1. Click Buy 500 GB (or 2 TB, 5 TB). You go to Stripe Checkout, Stripe's own payment page. We never see your card number.
  2. Pay. Stripe sends the receipt to your email.
  3. You come back to Thank you: "500 GB was added to your relay credit." If Stripe is still confirming the payment, the page says so and the credit is added as soon as Stripe confirms it.
  4. Cancelling on Stripe's page brings you to Payment cancelled: nothing was charged.

The card is kept by Stripe for auto top-up only. An admin can turn auto top-up off on the admin page at any time.

Note: When payments are not set up on the service, the buy screen says "Payments are not set up yet. Please try again later." and the apps hide Buy relay credit….

Behind the scenes, each purchase is credited exactly once, whichever arrives first (Stripe's webhook, a retry of it, or your return to the Thank you page). A payment below the pack's price is not credited but held for review.

Checking the balance#

In the apps: the iPhone's and the Space Backup window's Settings › Space Relay show a bar of this month's free relay traffic left and, once it is used up, a bar of the prepaid credit left, with Buy relay credit… under them; once the free traffic is used up a small "Relay balance: 38 GB left" line is at the top of every screen, red when little is left (Space Relay balance). From the command line:

sbctl relay balance
Free this month: 3.2 / 5 GB · Prepaid: 87 GB
Auto top-up: on (500 GB pack)

When activation is needed, a line Activation needed: … follows. With --json:

{
  "month": "2026-10",
  "freeBytes": 5000000000,
  "freeUsedBytes": 3200000000,
  "prepaidBytes": 87000000000,
  "activationNeeded": false,
  "autoTopUp": true,
  "autoTopUpPack": "sb_pack_500",
  "paymentsEnabled": true,
  "line": "Free this month: 3.2 / 5 GB · Prepaid: 87 GB"
}

freeBytes is null when the free allowance is unlimited (a beta setting). Not signed in: not signed in: sign in first: account signin <email>, exit code 1.

The admin page's Space Relay panel#

Owners and admins find a Space Relay panel on the company admin page (https://spacebackup.net/account/admin, section #relay):

The Space Relay panel on the admin page
The Space Relay panel on the admin page

Plain members see their company's balance and the buy screen, and reach it from their own page (/account/me), but not the usage table, the purchases or the auto top-up setting. See The admin page.

Billing questions#

Relay protocol#

This section is for integrators who want to understand or reimplement the client side of Space Relay (the iPhone app is one such client). It describes protocol version 1 as the relay at relay.spacebackup.net:47900 speaks it.

Connections, address and TLS#

Framing#

Every message is a frame: a 4-byte big-endian length, then that many bytes of UTF-8 JSON. The JSON is an object with a string field "t", the message type.

+----------------+-------------------------------------------+
| length (4, BE) | {"t":"ping","ref":"17"}  (UTF-8 JSON)      |
+----------------+-------------------------------------------+

Joining a group#

Devices of one company meet in a group. The group id is derived from the company key; the relay never learns the key, and a company's devices land in the same group because they hold the same key.

How the group id is computed (exactly as the apps do it):

  1. master = PBKDF2-HMAC-SHA256(password = the company key text, trimmed, UTF-8; salt = UTF-8 SpaceBackup company key v1; 200,000 iterations; 32 bytes).
  2. relayKey = HKDF-Expand(SHA-256, PRK = master, info = UTF-8 relay, 32 bytes).
  3. group = lower-case hex of HMAC-SHA256(key = relayKey, message = UTF-8 space-relay-group-v1): 64 hex digits.

The short group code shown to people and in the activation link is one-way too: the first 40 bits of SHA-256 of the ASCII lower-case group id, as 8 Crockford base-32 digits (0123456789ABCDEFGHJKMNPQRSTVWXYZ), written XXXX-XXXX. Typed codes are normalised: any case, O read as 0, I and L as 1, dashes and spaces ignored.

Who pays for a group:

When the company key is rotated, the group id changes; the apps link the new group to the company again by themselves.

Messages#

Directions: C = client (a device), R = relay. ref is any short string the client chooses; the relay echoes it in the answer.

TypeDirectionFieldsMeaning
helloC → R, first frame of a control connectiongroup (64 hex), instanceId, machine, version, protocol (1), lanAddrs, blob?, token?Join the group.
hello (guest)C → Rguest (relay pass), instanceId, machine, version, protocolJoin as a guest; no group or token.
welcomeR → CpublicIp, keepalive (seconds), protocol, usedBytes, quotaBytes, and for open groups groupCode, activateUrl, activationNeededAccepted. publicIp is the address the relay sees for this device.
peersR → C, right after welcomepeers: [Peer]The other devices of the group online now.
peer-joinedR → Cpeer: PeerAnother device joined.
peer-updatedR → Cpeer: PeerAnother device's addresses or announcement changed.
peer-leftR → CinstanceIdAnother device left.
updateC → RlanAddrs, blob?This device's addresses or announcement changed.
pingC → RrefKeepalive.
pongR → Cref, usedBytes, quotaBytes, and for open groups groupCode, activateUrl, activationNeededKeepalive answer with the current usage.
relay-connectC → Rto (the other device's instanceId), refAsk for a pipe.
relay-sessionR → Cref, sessionIdThe pipe is set up; attach to it.
relay-incomingR → CsessionId, from (instance id)Another device asked for a pipe to this one; attach to it.
noticeR → Ccode, message, and for activation also groupCode, activateUrlInformation: quota-warning, quota, activation.
errorR → Ccode, message, ref?, fatal?A refusal (see Errors).
attachC → R, first frame of a data connectionsessionId, instanceId, token?Join one side of a pipe.
attachedR → CBoth sides are in; raw bytes from now on.

Peer object:

{"instanceId": "5f1c0a9e2b7d4c31", "machine": "OFFICE-NAS", "version": "0.14.2",
 "publicIp": "198.51.100.7",
 "lanAddrs": ["192.168.1.20:47800"], "online": true, "blob": "U0JBMd…"}

hello fields and their limits:

FieldRule
group64 hex digits (any case; the relay lower-cases it).
instanceId1 to 64 ASCII characters from ! to ~ (0x21–0x7E: no spaces, no control characters), unique per install. A second hello with the same instance id in the same group replaces the first connection (which gets error replaced).
machineThe device's machine name, at most 64 characters.
versionThe app version. Required without a token (an empty version is refused); kept to its first 32 characters.
lanAddrsAt most 16 strings ip:port, each at most 64 characters; others are dropped.
publicPortSent by older versions (a port the router forwarded); ignored, never passed on.
blobBase64, at most 48 KB decoded; larger is dropped.
tokenOnly for token accounts, at most 256 characters.

A typical start of a control connection:

{"t":"hello","group":"3f9a…e1c4","instanceId":"5f1c0a9e2b7d4c31","machine":"ANNA-PC","version":"0.14.2","protocol":1,
 "lanAddrs":["192.168.1.34:47800"],"blob":"U0JBMd…"}
{"t":"welcome","publicIp":"203.0.113.24","keepalive":30,"protocol":1,"usedBytes":1200000000,"quotaBytes":5000000000,
 "groupCode":"7KQ2-M9XD","activateUrl":"https://spacebackup.net/account/relay/activate?group=7KQ2-M9XD","activationNeeded":false}
{"t":"peers","peers":[{"instanceId":"a07d…","machine":"OFFICE-NAS","version":"0.14.2","publicIp":"198.51.100.7",
 "lanAddrs":["192.168.1.20:47800"],"online":true,"blob":"U0JBMd…"}]}

Updates. Send update whenever the LAN addresses, the forwarded port or the announcement change; the apps send it with every announcement (every 30 seconds), which also keeps them listed as online. The relay sends at most one peer-updated per device every 2 seconds (only the latest state of a burst).

Keepalive. Send ping every keepalive seconds (30, from welcome). A connection on which the relay hears nothing for 3 keepalives (at least 90 seconds) is closed; the apps likewise reconnect when they get no answer for 3 keepalives. Reconnect with back-off: the apps start at 1 second, double up to 60 seconds, add random jitter, and wait 5 minutes after an auth or revoked refusal. After a reconnect the new peers list replaces the old one.

A slow reader is dropped. The relay queues at most 32 frames for a device and gives each frame 20 seconds to be written; a device that does not read its control connection is disconnected (it reconnects and gets a fresh list).

Setting up a pipe#

  1. A (wants B) sends relay-connect {to: <B's instanceId>, ref} on its control connection.
  2. The relay answers A with relay-session {ref, sessionId} and sends B relay-incoming {sessionId, from: <A's instanceId>}. The session id is 128 random bits (32 hex digits).
  3. A and B each open a new TLS connection to the relay and send attach {sessionId, instanceId} (plus token for a token account).
  4. When both are in, each gets attached, and the relay splices the two connections. Everything after attached is the byte stream between A and B.
  5. Inside it, the two devices run the ordinary Space Backup peer protocol, starting with its handshake (A is the client). See Peer protocol and its frame format.
  6. When either side closes, the relay closes the other (there is no half-close).

Rules:

Uploads through the HTTPS door#

iPhones and iPads hand big files to iOS, which keeps uploading them while the app sleeps. It can only do so with a plain HTTPS request, so the relay has a door for it: PUT https://relay.spacebackup.net/v1/upload. Each request carries one file for one computer. The relay stays a pipe: it stores nothing and cannot read the file, its name or where it goes.

The full contract is docs/relay-upload.md in the source tree.

Devices' logs through the HTTPS door#

While Space Backup is being developed, devices send their own log lines to the relay so that a night's problems can be read on the server (the iPhone does today). PUT https://relay.spacebackup.net/v1/logs carries a piece of a device's log: UTF-8 lines, each starting with its UTC time, at most 2 MB.

The full description is docs/relay-logs.md in the source tree.

Limits#

LimitValue
Frame body64 KB
Sealed announcement (blob)48 KB
LAN addresses per device16
TLS handshake plus first frame15 s
Attach after relay-session30 s for both sides
Idle control connectionclosed after 3 keepalives without a frame (at least 90 s)
Queued frames per device32, 20 s per frame
Devices per open group at once200
Connections per token at once200
Guests per group at once50
New open groups per source IP per day (UTC)20
Pipes200 per account being set up (not yet attached); 10,000 in all on the relay, every pipe counted (being set up or attached and running)
Relayed ratea total cap for the whole relay (300 Mbit/s by default), shared fairly between pipes in 64 KB turns
Usage limit checkevery 4 MB per pipe direction

Usage and its notices. welcome and every pong carry usedBytes (this month, in + out, the whole group or token) and quotaBytes (the limit, or null for none). At 80 % of a fixed limit (a token's quota, or an unlinked open group's free allowance) every device gets notice {code: "quota-warning"} once a month; for groups billed by the account service there is no percentage warning (the apps show the company's balance instead). At 100 % every device gets a notice with code activation (open groups, with groupCode and activateUrl) or quota (token accounts), new relay-connect requests are refused with the same code, and running pipes are closed within 4 MB. The control connection stays.

Errors#

An error frame carries code and a human-readable message.

CodeWhenExample messages
bad-requestA malformed or unexpected message."hello needs group (64 hex digits), instanceId and machine", "hello needs the app version", "expected hello or attach", "unknown message …", "that instance id is in use", "already attached"
authNot allowed in, or not a party."invalid relay token", "this relay needs a relay token", "not a party of this relay session", "invalid guest pass", "guest pass expired", "no such relay group"
revokedThe token was revoked (running connections are closed within 5 seconds)."relay token revoked"
blockedThe group was blocked by the relay's operator (abuse)."this group is blocked by the relay"
busyA limit was reached."too many new relay groups from <ip> today", "at most 200 PCs per relay group", "the relay is busy (too many connections being set up)"
offlineThe other device is not connected, or the session is gone."that PC is not connected to the relay", "no such relay session (expired?)"
timeoutThe other side did not attach in time."{machine} did not join the relay session in {seconds} s"
activationAn open group used its free allowance and has no credit (with groupCode, activateUrl)."Space Relay activation needed: this month's free relay traffic and the prepaid relay credit are used"
quotaA token account reached its monthly quota."relay quota reached"
quota-warningIn a notice only: 80 % of a fixed limit."82 % of the free relay allowance used this month (4.10 of 5 GB)"
replacedThe same instance id connected again; this connection is closed."the same PC connected again"
shutdownThe relay is restarting; reconnect."the relay is restarting"

Guests at the relay#

A device outside the company that was invited to an album (see Guests from outside the company) gets a relay pass from the account service (POST /account/api/guest/pass, the relay value per company, valid one hour). It is opaque to the guest: gp1. + base64url(nonce 12 | ciphertext | tag 16), AES-256-GCM under a key derived (HKDF-SHA256, info space-relay-guest-pass-v1) from a secret only the relay and the account service share. Inside is the UTF-8 JSON {"g": <group id, 64 hex>, "c": <company id>, "d": <the guest's device id>, "x": <expiry, Unix seconds>, "m": [<names of the computers the guest may reach>], "v": 1, "ExpiresAt": <x as an ISO 8601 date-time>}; the guest never learns the group id. ExpiresAt is a computed copy of x that the account service's serializer writes too (about 40 bytes); the relay ignores it when it opens a pass and goes by x: the pass is expired from the second x on (x ≤ now).

The guest says hello {guest: <pass>, instanceId, machine, version, protocol}. The relay then:

Bytes in a guest's pipes count to the group, so to the album owner's company. Inside the pipe the guest and the computer run the guest channel (authenticated with both registered device keys), described in Peer protocol.

The relay and the account service#

The relay and the account service run on the same server. Billing works like this:

The apps' relay routes on the account service:

RouteWhoWhat
POST /account/api/relay/groupdevice token of an active memberLink this device's relay group to its company.
GET /account/api/relay/balancedevice token of an active membermonth, freeBytes, freeUsedBytes, prepaidBytes, activationNeeded, autoTopUp, autoTopUpPack, paymentsEnabled, prepaidTotalBytes, lowBytes, packs ([{id, bytes, cents, currency, name}], the packs on sale).
POST /account/api/relay/buy-linkdevice token of an active member{"url","expiresAt"}: a single-use link (15 minutes) that signs a browser in as this device's email and opens the buy screen.
GET /account/relayweb sessionThe buy screen.
POST /account/relay/checkoutweb session, CSRF tokenStarts Stripe Checkout for pack (and autoTopUp).
GET /account/relay/success, GET /account/relay/cancelbrowserStripe's return pages.
GET /account/relay/activate?group=<code>browserThe relay's "activation needed" link.
POST /account/admin/relay/auto-topupowner or admin, web sessionAuto top-up on or off, and its pack.
POST /account/stripe/webhookStripePayment events, checked with Stripe's signature.

Full request and answer formats, authentication and errors are in Account service API.