Skip to content

For A Regulator's Officials: Certifying A Frame, Step By Step ​

This guide is for a public authority and the people who act for it. It walks the work in the order it happens: binding your frame, giving an official the permission, issuing a certificate under the two-person rule, delivering it, the public page anyone can check it on, and withdrawing it. What a regulator frame is, and every rule it follows, is in chapter 43; this page says how to do the work, and was run end to end on the network's sandbox regulator before it was written.

Switched off on the production frames for now. The regulator role (REGULATOR_ROLE_ENABLED), the genesis's claim signing (REGULATOR_CLAIM_SIGNING_ENABLED) and a certified frame's reading of certificates (REGULATORY_CERTIFICATES_MODE) all default to off, and each is a separate decision on each frame. Today the only regulators on the network are demonstrations: Sandbox Regulator certifies the sandbox frames, and a demonstration regulator for the production frames comes next.

Before you start: two roots ​

Your frame is a regulator frame only when both hold (chapter 43, "Two roots, both required"):

  1. The network's root. The network's genesis signs your frame's licence with a regulator claim: your jurisdictions (two-letter country codes), your domains (financial is the one a rail acts on today), your authority's name, and the domain your binding lives on. The genesis does this only once your binding verifies.
  2. Your root. Your authority publishes a signed document on its own domain that binds this frame: https://<your domain>/.well-known/theprotocol-regulator.json.

1. Bind your frame ​

The binding is a small JSON document with three parts:

  • payload: kind (always tp.regulator.binding.v1), trust_domain (your frame's trust domain), licence_key (the thumbprint of the key your frame's licence certifies), and valid_until (an ISO date and time);
  • key: your authority's own public key, an Ed25519 key in JWK form (kty OKP, crv Ed25519, x);
  • signature: kid (the thumbprint of that key) and value, the key's signature over the payload in canonical JSON (keys sorted, no spaces), base64url.

Your frame's administrator reads the licence key's thumbprint from the frame (POST /api/v1/admin/federation/licence/key answers the key; the thumbprint is the RFC 7638 one over crv, kty and x), and your authority signs the document with a key it keeps itself. The document is served from your authority's domain over HTTPS, and nothing redirects it.

When the binding domain is the frame itself (a demonstration regulator, or an authority that runs its frame on its own domain), the frame stores the document and serves it, byte for byte, at its own /.well-known/theprotocol-regulator.json:

  • PUT /api/v1/admin/federation/regulator-binding with the document as the body (at most 16 KB): refused unless it binds this frame's trust domain and its active licence key, is signed by the key it carries, and is still valid;
  • GET /api/v1/admin/federation/regulator-binding: what is stored and whether it still verifies against the frame now;
  • DELETE /api/v1/admin/federation/regulator-binding: removes it, and the public file answers 404 again.

These need the federation administrator's flag and the role switched on.

How anyone checks it. The public file is plain: anyone can fetch it and verify the signature with the key it carries. The genesis records the document's hash in your claim, so a later change to the document no longer matches what the network signed, and the Regulator page (step 5) and the SDK's checker both say so.

2. Give an official the permission ​

The people who issue, deliver and withdraw need one permission, the narrow regulator flag admin_regulator. It opens the Regulator page and its four acts (issue, deliver again, withdraw, read the issued list) and the frame's held list, and nothing else: no other administration, no platform administrator's authority.

  • In the console: your frame's administrator opens Administration, Developers, picks the official, Permissions, ticks admin_regulator and saves. Saving the other flags leaves this one as it is.
  • By the API: PUT /api/v1/admin/developers/{id}/admin-flags with {"admin_regulator": true} (and false to take it away).

The official then signs in and finds Administration, Regulator in the sidebar, with no other administration beside it. The registry records each change of a flag in its audit log.

A certificate is decided in your authority's own organization on the frame (REGULATOR_ORGANIZATION_ID): the officials who decide are that organization's owner or its approvers, and the console acts as the agent the signed-in official is acting as, so the official who asks should own the agent that asks.

3. Issue a certificate: four steps, two people ​

Open Administration, Regulator. The page shows your claim at the top (jurisdictions, domains, the licence, verified in your own browser back to the network's genesis, your signing key and your binding), then the issue form, then the certificates you issued.

  1. The facts. The frame you certify (its trust domain) and its name, the acts it is permitted (a closed list, each by its code on the form: exchange.listing, the exchange's launch act and fiat.lane act; registry.operation is shown and never enforced), the jurisdiction and the domain (inside your claim, or refused), how many days it is valid (at most 366), and whether your regulator runs on the same host as that frame. Prepare freezes the facts and shows their sha256: the approval will name exactly these facts.
  2. Ask. Choose your organization's room and Ask for the decision. The page then waits: a person with the owner's or an approver's role has to decide it, with presence, in the Approvals. The agent that asked cannot.
  3. Decide, another person, with presence. A second official opens the approval card (in the room, or in Approvals on the phone) and approves it with presence: a device they enrolled signs the decision (the two-factor or device step-up). A decision without presence is refused with 428 and a challenge; the certificate records the decider's role, never the name.
  4. Issue. Back on the page, Issue turns the decided approval into a signed certificate, once: a compact JWS under your frame's licence key, its own type tp-regulatory-certificate+jws, and under the card's size cap. The approval is consumed and cannot be used twice. The same step by API is POST /api/v1/regulator/certificates with the approval's id and the facts, called by the agent that asked.

A demonstration regulator's certificate carries demonstration in its own signed payload, and every surface shows it.

4. Delivery ​

Issuing delivers the certificate to the certified frame over the federation lane. A failed delivery is recorded and the certificate stands: the issued list shows the delivery's state and its error, and Deliver again (POST /api/v1/admin/regulator/certificates/{hash}/deliver) tries once more. The certified frame keeps a certificate only when it reads certificates at all (shadow or enforce), the certificate names it, has not expired, and verifies under your licence (chapter 43, "What a certified frame does with one"). Its card then shows Regulated by with your trust domain, the scope, the permitted acts and the dates.

5. The public page ​

Your frame serves a Regulator page open to everyone, with no account (#/regulator on your frame's console). It shows your claim and lets anyone paste a certificate and check it in their own browser, against the key your frame publishes: genuine and in force, genuine and withdrawn, expired, or not genuine, with each check named. Nothing pasted is sent anywhere. Below it, the certificates you withdrew, as your signed list says.

The same check runs offline with the SDK's checker, from public documents only: your licence, the genesis's, your binding and your withdrawal list:

python -m theprotocol.registry.regulatory_certificate --subject <the certified frame> --cert certificate.txt --genesis <the genesis's trust domain>

It prints each of sixteen checks and OFFLINE VERIFY PASSED (16 of 16), or the ones that failed. The checker is in theprotocol-sdk 0.12.0 and later: install it with pip install "theprotocol-sdk[verify]" (the verify extra brings the signature library the checks need).

6. Withdraw ​

On the issued list, Withdraw opens a confirmation that says what a withdrawal does: the certificate goes on your signed withdrawal list (/.well-known/regulatory-certificates.json), the list is pushed to the certified frame, and it cannot be undone: a new certificate would have to be issued. The console asks for a reason (at least eight characters), and the reason is kept with the certificate. The API is POST /api/v1/admin/regulator/certificates/{hash}/withdraw with an optional reason; a second withdrawal of the same certificate is refused (409, already_withdrawn).

From then on the public page reads the certificate as genuine, and withdrawn, the offline checker fails it on not_withdrawn, the certified frame's card stops showing it at its next build, and the certified frame's own Certificates view keeps it listed with its state, withdrawn, beside the time.

What your frame can never do ​

  • No emergency brake. A regulator frame cannot suspend, freeze or move anything; it certifies, and a certificate moves no balance.
  • No authority it was not given. A certificate outside your claim's jurisdictions or domains is refused, and the genesis never decides who a regulator is: it signs a claim only when your own binding verifies.
  • No one alone. Every certificate is two people: the agent that asks cannot decide, and the decider decides with presence.
  • No demonstration as cover on production. A demonstration regulator's certificate covers a regulated act only on a registry that states it is a sandbox.

Server components AGPL-3.0-or-later · SDKs and the auditor Apache-2.0 · this documentation CC BY 4.0. If a doc and the running stack disagree, trust the stack. Legal notice (Impressum) · Privacy · Terms