SSyncropel Docs

Federation

How two or more workspaces share records while keeping trust boundaries intact.

What federation is

Federation is how two or more Syncropel workspaces (your laptop, a shared server, a teammate's laptop, a hosted workspace) share records without any of them becoming a single point of failure.

If you only run one workspace, you don't need federation. If you want more than one, for collaboration, for a backup, or to use a hosted and a local workspace together, federation ties them together.

How it works

Three ideas shape federation.

1. Records never change

A record is the same record wherever it lives. The copy on your laptop and the copy on a teammate's server are identical, and either side can verify it. You can't edit a record, only write new ones that refer to it. So syncing only has to answer one question: do these two workspaces hold the same records on this thread?

2. Federation is pull-based

Each workspace decides what to fetch, from which peer, and how often. Nobody pushes records into you uninvited. A workspace answers GET /v1/sync/changes?since=<cursor> requests, and the other side decides when to ask. Pairing sets up the credentials and the sharing permissions, and then both sides pull from each other on their own schedules.

Every record is signed by the actor who wrote it, and the signature is checked when the record arrives. Sharing records across namespaces needs an explicit consent grant. Without one, records stay in their namespace even when the workspaces are paired.

So a peer finding you on the network gets no access, and pairing with a peer does not share records across namespaces. Discovery and pairing are separate from permission.

The pieces

Identity: who a peer is

Each workspace has an identity: a key pair and a DID. There are three kinds of DID:

  • did:key: the DID is the public key itself. No signup or service needed. spl init creates one in under a second. Good for first-time users and short-lived agents.
  • did:web: the DID points to a domain you control (e.g., did:web:alice.dev). It is found at https://alice.dev/.well-known/did.json. If you own a domain, you own your identity.
  • did:sync: the DID is looked up in a directory that stores the public key and address. It supports key rotation and handle lookup. The default directory is run by Syncropic, or you can host your own.

All three give the same result: a public key that verifies signatures and an address that serves the Syncropel API. They differ in how the DID is looked up and whether keys can be rotated.

Pairs: how workspaces connect

A pair is a lasting connection between two workspaces. Pairs are records on the reserved thread th_federation_pairs, so they survive backup and restore and can be audited.

A pair carries:

  • peer_did: the peer's identity (URLs change, DIDs persist)
  • peer_url: where to reach them on the network
  • state: establishing, active, paused, degraded, revoked
  • tokens: bearer tokens created when pairing (each side holds the other's)
  • cursors: how far each synced thread has been synced

Pausing and revoking a pair are records too. An audit trail of pair changes is kept on the thread th_audit_federation_pairs.

Creating a pair is one command: spl federation pair add <peer-url>. It finds the peer, completes a secure handshake, creates matching service accounts and bearer tokens on both sides (valid for 90 days and renewed automatically), and records the pair on both sides. spl sync then uses the pair automatically, with no manual token setup.

Peers

Federation is a network of equal peers. There is no central broker. Every workspace, hosted or local, can pair with another with one command. You can start on a hosted workspace and later run your own on a laptop or server with all your records intact.

The shape of the network is up to you:

  • Pair: two workspaces connected to each other.
  • Star: one central workspace paired individually with several others.
  • Mesh: everyone paired with everyone. This is practical for fewer than about 10 workspaces.
  • Hierarchy: rarely the right choice. Delegate by namespace instead.

You manage pairs, not network shapes.

This network of peers, and the discovery it allows, is what Syncropel calls the Graph. It is a pattern, not a server: every paired workspace is already part of it.

Thread filtering on a pair

By default, all threads that consent permits are synced. To share less, for example th_shared_workspace and th_shared_design but not the rest of default, set filters on the pair:

  • spl federation thread-allow <pair-id> <thread-id>: allowlist a specific thread for this pair. Records on threads not in the allowlist don't leave.
  • spl federation thread-rule <pair-id> '<CEL expression>': an expression checked against record and thread(). Useful for "all threads under namespace X" or "only threads tagged shared".

A record is shared only if consent allows it and it matches the pair's allowlist and rules.

One-way sync

You can also set up a one-way, per-thread subscription with spl fleet sync add and your own tokens. See the CLI reference. For new connections, use spl federation pair add <peer-url>.

When sharing crosses namespace boundaries, for example your default namespace syncing to a partner team's partner-team namespace, consent decides what passes.

The default is strict: with no consent grant, no records cross. Grants are records on the reserved thread th_consent and specify:

  • source namespace (where records originate)
  • target namespace (who's allowed to receive)
  • how much of each record the receiver may see: the full body, or only its structure

A grant that withholds the body means records still arrive on the other side with their contents held back: the receiver learns that something happened and what shape it had, never what it said. Useful for telemetry collection, audit archives, or any case where you want presence signals without content.

Discovery: how peers find each other

You don't have to enter every peer URL by hand. There are four optional ways to find peers:

  • LAN broadcast (mDNS): workspaces on the same local network announce themselves and find each other in under a second. Good for home or office setups.
  • did:web domain lookup: if you know a peer's domain, look up their DID over HTTPS. Works anywhere.
  • did:sync directory query: ask a directory (the Syncropic-hosted one at discovery.syncropel.com, or your own) for peers in a namespace.
  • Transitive introduction: ask a peer you're already paired with for the peers they know. This is opt-in.

Discovery only tells you a DID and where to reach it. It never creates a pair. You always confirm before pairing.

What federation is not

It is not a relay network. Every pair is a direct HTTPS connection between two workspaces. There is no routing through other peers.

It is not full replication. A pair does not copy every record. Consent grants control what crosses namespaces, and allowlists and rules narrow it further. By default, nothing crosses without an explicit consent grant.

It is not a trust mechanism. Pairing with a peer does not mean you trust them. Every record they send is signature-checked, filtered by consent, and weighed by trust independently. A pair means you are willing to exchange records under your consent and filtering rules.

How the pieces fit together

A typical end-to-end flow:

  1. Alice runs spl init on her laptop. A did:key identity is generated. She starts spl serve.
  2. Bob runs spl init on his workstation. Same thing, his workspace is up.
  3. Alice runs spl federation pair add https://bob.example/. The two workspaces handshake, create matching tokens, and record the pair on both sides. The pair works in both directions from this moment.
  4. (Optional) Alice narrows what she shares: spl federation thread-allow <pair-id> th_shared_workspace. Without an allowlist, all consent-permitted threads sync.
  5. Alice emits a record: spl intend --thread th_shared_workspace "review the design".
  6. Within about 5 seconds Bob's workspace has pulled it, checked its signature, applied consent and thread filters, and stored it. Alice's side pulls Bob's records the same way.
  7. If Alice and Bob are in different namespaces, the consent filter runs. If there's no matching grant, nothing propagates. If the grant covers the full body, records arrive intact. If it withholds the body, records arrive with only what the grant allows: their structure without the contents. A thread that was never granted doesn't appear at all.

Setup takes about a minute. After that, sharing is automatic and works both ways.

Known limits

Pair traffic is protected by TLS between the two workspaces. Record bodies are not separately encrypted end to end.

What's next

  • The Graph: the federation pattern: how workspaces discover each other and what they publish
  • Universal traversal: see everything you reach across your workspaces as one view; how shared threads appear with exactly the granted access
  • Federation pair guide: hands-on spl federation pair add walkthrough with two local workspaces
  • Consent management: the full consent grant flow for cross-namespace sharing
  • Records, Threads, Actors: the building blocks federation uses
  • Namespaces: what consent grants apply to

On this page