Your identity on every device you own

Until this month, a Flowsta identity lived on the computer it was made on. You could restore it somewhere else from your recovery phrase, but it was one computer at a time.

That has changed. From Flowsta Vault 1.6, one Flowsta identity lives on every computer you own, Windows, Mac and Linux alike, and so does the private data of the apps you use with it. Change something on one computer and about a minute later it's on the other. No server keeps a copy.

This post covers what it does, how it works underneath, how to build it into your own app with the Flowsta SDK, and how we built it into Your Own AI, whose 0.9.0 video is above.

What it does

Add a computer in one of two ways. With a code: open the Vault on the new computer, choose I already have an identity, then Use another device, and type the code it shows into Settings → Devices → Add a device on a computer you already have. The approval always happens on a device that is already yours; the new one never approves itself. Or use your recovery phrase when no other device is to hand.

Everything that's yours follows. Your keys, your profile and email, the apps you've connected and what each one may see, the sites you chose to remember, your activity and your signatures. Disconnect an app on one computer and it's disconnected on all of them.

Your apps' data follows too. Apps keep encrypted backups of their data in your Vault, and each of your Vaults keeps copies of the backups the others made. An app you open on a new computer finds your data waiting.

Locked, still syncing. A locked Vault keeps passing changes between your devices. It just won't approve anything until you unlock it.

Remove a device from any of the others. Settings → Devices → Remove. A removed device can no longer sign in or approve as you, and it stops syncing. What it already holds stays on it until you erase it: a removal is not a remote wipe.

Only you can add a device. Adding one takes your recovery phrase or the approval of a device you already have. Someone holding an old export file, or a stolen laptop and its Vault password, can't add one. (Identities made before 1.6 switch this on by entering the recovery phrase once, in Settings → Devices.)

How it works

Every Flowsta Vault runs its own Holochain node. Your private records, from your profile and email to your connections and your apps' backups, live on an encrypted private network that only your own devices join. Your devices exchange those records directly, peer to peer, and each one checks for changes every minute.

Each device has a key of its own on that network, and your Flowsta identity ties them together. Your Permanent ID (DID), your sign-ins and your signatures are the same on every device: a signature made on any of them is yours.

Flowsta's servers help in two small ways. A meeting point helps your devices find each other on the internet, and a relay carries traffic between devices that can't reach each other directly; both see addresses, keys and encrypted traffic, never what's inside. And Flowsta keeps the list of which device keys belong to an identity, so that a removal holds wherever you sign in. Device names, platforms and versions aren't part of that list. They stay in your private records.

Build it into your app

If your app runs on Holochain and signs people in with Flowsta, your users can have the same thing: one person, every device, one copy of their data. The Flowsta SDK, @flowsta/holochain, does the identity work. Here's the shape of it; the full guides are Your Identity on Several Devices and One identity, several devices.

One private network per person

Your app's Holochain data syncs between a person's devices when every device is on the same private network, with the same network seed. getAppNetworkSecret gets that seed from the Vault. It's derived from the person's identity for your app, the same on every one of their devices, so there's nothing to copy between them and nothing to wait for.

import { getAppNetworkSecret } from '@flowsta/holochain';

// Before installing your DNA on a signed-in device:
const { secretHex } = await getAppNetworkSecret({ clientId, appName: 'My App' });
// Use secretHex as the DNA's network_seed.

It never changes a seed a person already has: an existing backup wins, so an app that has already shipped doesn't split anyone's data.

Give each device its own key

Never run the same agent key on two conductors. Each device gets its own key on the shared network and lists its records at a fixed founding anchor. For anything two devices can both edit, the latest version wins by updated_at, and a deletion is a record of its own, since one device can't delete another device's entry. The five rules we learned building our own apps are in the SDK guide.

Everything else rides a Vault backup

Settings, pictures, anything that isn't Holochain data: post a backup after every change (debounced, a minute is plenty), and read the newest copy from any of the person's devices with across: 'devices'. Poll the list once a minute and read only what moved.

import { retrieveFromVault, listVaultBackups } from '@flowsta/holochain';

// The newest "recovery" backup on any of the person's devices:
const recovery = await retrieveFromVault({ clientId, label: 'recovery', across: 'devices' });

// What the person's other devices hold for this app:
const { otherDevices } = await listVaultBackups();

Keeping the devices in step has the full loop.

Keep devices findable

Holochain networking can stop listing a device that has been cut off for a few minutes (Wi-Fi gone, a server down) until its conductor restarts. keepRegistered reads the conductor's own fresh notes once a minute and registers them again, so a person's devices keep finding each other without a restart.

Your app's devices meet on whatever bootstrap server and relay your conductor is configured with: Holochain's public one, your own, or a community node. Your users' devices never join Flowsta's networks.

Show who's there

GET /devices on the Vault's local API says when this Vault last heard from each of the person's other devices. A dot per device, reachable now or locked or asleep, explains a change that's still on its way better than any paragraph.

Not writing JavaScript? The SDK wraps the Vault's local API, so each of these is a documented HTTP call in the IPC reference, including POST /app-secret for the network seed.

How we built it into Your Own AI

Your Own AI 0.9.0 is the first app built on all of this, and the video above shows the result: install it on each of your computers, click Sign in with Flowsta on each, and your AIs, their memory and your conversations follow you.

  • Conversations and memory live on each person's own private Holochain network. Its seed comes from the Vault (POST /app-secret), so every computer signed in as you joins the same network with nothing to copy, and your computers exchange the records directly.
  • AIs, pictures and settings ride Vault backups: written ten seconds after a change, they show on your other computers in about a minute and a half.
  • Settings › Devices shows a dot for each of your devices, from GET /devices.
  • Devices stay findable. keepRegistered came out of this work: we measured the stalls while building Your Own AI's sync, fixed them there, and put the same fix in the SDK.

Your Own AI is written in Rust, so it calls the Vault's local API directly rather than through the JavaScript SDK: the same calls, one layer down. It's open source, so you can read exactly how it's done.

Try it

Get Flowsta Vault 1.6+ on each of your computers and Your Own AI to see it working. Building an app? Start with Your Identity on Several Devices and the SDK guide.

One identity, every device you own. No one in control but you.