Open standard · First implementation for Home Assistant · Decided in your home

Relay Specification v0.1.0

Reachable from outside, without having to trust the relay

Most gateways sit behind a router and cannot be reached by agents in the cloud. The Relay Specification defines how a relay makes them reachable under a public name – run by anyone, without the operator being able to read or change what passes. It is a companion specification with its own versions and requires the Home-Mandate Specification v0.2.0 or later.

Who talks to whom

The gateway opens a tunnel to the relay itself. The relay passes an agent's TLS connection through the tunnel without opening it: the key exists only in the gateway, and OAuth, the mandate and approvals stay at home.

Read Section 1.2 of the Relay Specification
Agent anywhere on the internet
Relay run by an operator of your choice
Home
Gateway opens the tunnel from inside
Encrypted from the agent all the way into your home
  • The relay sees: the name, the agent's address, the time and how many bytes pass.
  • Not: what the agent asks, what is decided, your mandate or your devices.

Who it is for

You run a relay

Operator

Publish your metadata at /.well-known/home-mandate-relay, offer pairing, certificates and both protection levels, and keep the obligations of Section 7. You conform when a test shows it, not when you say so.

You build a gateway

Gateway

Pair with an operator of your choice, keep the tunnel open and watch the Certificate Transparency logs for your name. Classes for gateways follow once gateways implement the specification; the cases for their decisions exist already (Section 8.5).

Conformance classes for operators

An operator conforms if it passes all five classes. A claim of conformance names the version, the operator domain, the classes, the manifest of the cases and the date of the test.

  • metadata required

    Metadata

    The metadata document and how it is served, the operator's domains and both protection levels.

    Sections 3, 7.1, 7.3

  • enrollment required

    Enrollment

    Directory, nonces, requests with their errors, pairing, tunnel certificates, ACME support, own-domain names and unpairing.

    Sections 5, 6.4

  • dns required

    DNS

    The records of the name domain and of a standard name: CAA, A and AAAA, challenge records, TTL and their removal on unpairing.

    Sections 5.6, 5.7, 6.3

  • relay required

    Relay

    The tunnel: TLS, frames, control and data connections, routing by name, the PROXY header, the pinned keys and the denylist.

    Sections 4, 6.1, 6.8

  • issuance required

    Issuance

    A certificate for a standard name from an allowed CA, the refusals that CAA demands, the SCTs and no other certificate for the name in Certificate Transparency.

    Sections 5.6, 6.3, 6.6, 6.7

  • 815

    cases in 14 machine-readable files, each with a JSON Schema – for operators and for gateways.

    The cases

What no test from outside can check – such as how long an operator keeps data or whether its backup keys are held offline – is part of no class. The report of the test tool lists it, so that a claim of conformance claims no more than was tested.

Testing an operator

relay-conformance plays a gateway and an agent against a live operator: it pairs test installations, sends requests with deliberate defects, opens the tunnel, connects as an agent, obtains a certificate and finally unpairs everything again.

Every release attaches the tool's report against the reference, with an attestation of its build. Section 8.3 describes the run, Section 8.4 the access an operator gives for it.

Install the test tool (needs Go)
go install github.com/home-mandate/relay-spec/cmd/relay-conformance@v0.1.0
Every check with its section
relay-conformance -list
The call, the codes, the classes and the exit codes
relay-conformance -help

Downloads

Check files against their SHA-256 checksum. The metadata also has an address of its own: relay-metadata/v0.

Metadata schema

Specification versionv0.1.0

JSON Schema of the document in which an operator describes itself.

relay-metadata.schema.json · 6.6 KB

SHA-256 3702b4d7…4081 ShowHide 3702b4d7f96a660761a40e613b2245781913caa0d9b87e5524c30abba48d4081
Download: Metadata schema

Enrollment schema

Specification versionv0.1.0

JSON Schema of the messages for pairing, certificates and unpairing.

relay-enrollment.schema.json · 15 KB

SHA-256 cd82d553…66a7 ShowHide cd82d553ebeeb7f1fbfc7d4f37877ba40ab2bd9d5d59d6c602af38b3488f66a7
Download: Enrollment schema
/relay/errors/ Error types The addresses an operator names in error responses, with their meaning.