Ayni iconayni/ diaswarm / developers

a new shape for diabetes data

The data commons that can't be bought, captured, or switched off

Every diabetes data platform so far has had a middle — a server, a company, a foundation, a grant — and the data has only ever been as safe, as private, and as permanent as that middle. diaswarm removes the middle entirely. Your loop's data lives as sealed ciphertext spread across the community's own devices. Who can read it is decided by who holds a key. There is no host to trust, no operator to capture, and nothing anyone can switch off.

It already runs — on a live closed loop, phone to phone, across networks, with nobody in the middle. This is what comes after the server.

Honest scope, because this page is for people who will check: the custody and transport layers run today on Android/AAPS and the Ayni follower. An iOS follower does not exist yet (D12), and the research-export gateway is designed but not built — every claim below carries a tag for what actually ships. The cryptography is standard primitives in a composition that has had no third-party review (SECURITY.md).

When the host dies, the commons dies with it

For years, people have been able to donate their loop data to research through hosted data commons — you upload, an institution holds it, studies draw on it. Those pathways keep disappearing: a grant ends, a project winds down, priorities shift, and the commons goes dark with its host. That isn't bad luck — it's the design.

diaswarm is built so that can't happen. The commons isn't a place you upload to — it's a set of keys. The data lives, encrypted, on the devices of the people in it. No server to fund, no company to acquire, nothing to defund. A research project is just someone you hand a key to, and stop handing keys to when you're done.

The community already generates some of the richest health data in the world. It should outlive whoever happens to be hosting it this year.

One gesture. Every scale.

Sharing your glucose with your mum and feeding a global research cohort are the same act — seal data, hand a key to whoever you chose. Watch it scale.

one key → a whole commons

    1. One person, one key

      A reading is sealed on your phone and a key is handed to one reader. That's the whole idea — everything else is this, repeated.

    2. The same gesture, three scopes

      Hand that key to a parent, a clinic, or a study. The gesture doesn't change — only the scope of the key does. A clinic's opens a 90-day window; a study gets rows, not a person.

    3. Zoom out: it's a commons

      Thousands of people doing the same thing, and every phone quietly carrying a little of everyone else's sealed data — able to read none of it. The more people, the stronger it gets.

    4. There was never a middle

      Picture the server every other system puts here. Now take it away. Nothing to run, nothing to capture, nothing anyone can switch off.

    01 · individuals

    The person with diabetes

    Your phone seals its own history and publishes it. You hold the keys; nobody reads a byte unless you hand them one.

    running · AAPS
    02 · followers

    A parent or partner

    Handed a key one at a time, and cut off one at a time — not the all-or-nothing shared password every server forces on you.

    running · Ayni
    03 · providers

    A clinic

    Granted a window the key itself enforces — older data is unreadable to them, not merely hidden.

    protocol today · app next
    04 · research

    A study

    A granted member on the swarm side, standard research formats (CSV, Parquet, FHIR) on the other. The donation role, re-homed where it can't be defunded.

    specced · next build
    05 · the commons

    Every device, carrying

    Each phone holds a share of others' sealed data it can't read, so a sleeping phone stays reachable — and it self-heals as people come and go.

    running · the substrate
    clinics & researchers

    Both connect through the exact same key mechanism — the only difference is the scope of the key and the shape at the edge. A clinic's key opens a bounded window. A study's data is translated into research formats on the granted reader's own device, so even the exporter never becomes a custodian. No new trust model, no new server, at either end.

    Everything the Diabetes Data Rights Charter is asking for, running on a phone

    People with diabetes spent seven roundtables across 16 countries writing down what control of their data should mean — the Diabetes Data Rights Charter. They described a system that doesn't exist in the commercial world. diaswarm is a working demonstration that it can be built: running code, not a policy asking a manufacturer to behave.

    Consent & control that's real

    Per person, by key, and withdrawable without asking a server's permission. Revoking one follower doesn't revoke everyone.

    Privacy by design, in the strongest form

    The people holding your data cannot read it — structurally, not as a policy they could quietly change.

    Access with no vendor in the chain

    Sensor to open source to your chosen reader. Nobody's cloud in the middle.

    the honest part — because it's the project's style

    The project keeps a public, unflinching self-assessment against all eight principles, including where it still falls short and what would close each gap. That document is itself the kind of transparency the Charter is asking industry to adopt. → docs/rights.md

    You can't buy the middle, because there is no middle

    Every company circling this space is selling the same thing: a place in the middle — the server you rent, the account they gate, the data they broker, the lock-in that keeps you. Centralised platforms can be monetised because there's a chokepoint to own.

    What a custodian charges for

    • The host and the database the data lives in
    • The account and directory that gate who's who
    • The API that reads and writes it
    • Brokering the aggregate data onward to third parties
    • The friction of migrating off — lock-in

    Each is a chokepoint someone owns.

    What diaswarm leaves

    • No server to meter — data is ciphertext on participants' devices
    • No custodian holding the data to broker
    • No directory — you can't even search for a person, by design
    • Access is key custody; withdrawing asks no server's permission
    • AGPL, no APK sold, no account to lock in

    No chokepoint to charge rent on.

    The same thing that means nobody can sell it means nobody can capture it, subpoena it out of an operator, or pull its funding — because there's no operator and no funding to pull. It's AGPL, it's the community's, and it stays that way. The honest cost, said out loud: there's no company behind it either. What keeps it alive is the people who build and run it.

    The questions change

    Most worries about a system like this come from a lifetime of thinking in servers. Take the server away and the questions don't get harder — they change.

    the old questionWhat happens when the server goes down — or when their phone is off?
    the shiftThere's no server to go down, and no single phone the answer depends on. Many devices hold your data at once; the more people, the more available it gets, and it repairs itself as people come and go. Availability stops being "is the one machine up?" and becomes a property of the crowd.
    the old questionHow do I edit the bad row in the database?
    the shiftThere's no row to edit — the history is a signed, append-only ledger, which is why nobody can tamper with yours either. You correct forward: the right value is published and the trend reflects it, in the open, the way a ledger posts a correction rather than silently rewriting the past.
    the old questionCan I make the server delete it?
    the shift"Delete" on a server was always a polite fiction — backups, replicas, caches, whoever already copied it. Here the guarantee is honest and stronger where it counts: you stop handing out keys, and from that moment nothing new is readable to them, ever. What's already out is ciphertext nobody without a key can open. We'll never claim data was erased from the world, because no system can truthfully promise that.

    None of these are things diaswarm fails to do. They're things the server made you expect in a shape that was never quite true. Same guarantees, told honestly — and, in the ways that actually protect you, stronger.

    A role for Nightscout: seed the swarm, hold nothing

    Keeping the network available isn't only on the users being followed. Anyone who wants to support it can strengthen it — at very low cost and effort. A single always-on device that carries a share of the swarm and serves it onward makes everyone's data more reachable, whether or not you follow a single person yourself.

    Availability gets stronger the more always-on devices sit in the pool. A handful of seed boxes — funded by the Foundation and scattered around the world — would make it structural rather than a matter of how many followers happen to be awake. Each carries a share of the swarm's sealed data and can read none of it. A seed box breach is not a data breach.

    Runs on anything

    A small Rust binary. An old phone, a Raspberry Pi, a spare NAS, a retired laptop — mains power and a network connection is the whole spec. No battery, no Doze, so it's simply always there.

    Costs next to nothing

    A pool share is tens of megabytes a year and a trickle of bandwidth. Run one on hardware you were about to throw out, for roughly the electricity of a nightlight.

    Holds nothing it can read

    Every byte on a seed is ciphertext for people it was never granted. The Foundation strengthens the commons without ever becoming a custodian, a data controller, or a breach target.

    Nothing central

    Seeds don't coordinate and none is privileged — they just add always-on shoulders under the pool. Lose one and the arithmetic heals.

    the honest sweetener

    The pool has so far only run on a handful of phones. A dozen funded seed boxes wouldn't just harden availability — they'd be the first real test of the swarm at scale, the one thing the project most needs and can't fake with three devices. Funding the seeds is funding the proof.

    It's the cleanest role there is for an organisation that cares about this community's data: make it more available to everyone, while holding none of it, reading none of it, and being liable for none of it.

    Where it stands

    Everything above the line runs. Everything below is a known next step with a design already written — which is exactly where a project invites the people who want to shape it.

    Running on real hardware — sealing, granting, revoking, the swarm, phone-to-phone across different networks, on a live closed loop.

    shipped

    The follower app (Ayni) — a real Android app that shows someone's glucose.

    shipped

    iOS — the core is platform-neutral Rust; no iOS follower yet. The obvious next build, and where the Trio community comes in.

    open

    The research gateway — the export formats that make the commons a commons are specced, not written.

    next

    The clinic app — the protocol enforces scoped windows today; the provider UI is still to build.

    next

    Security review — standard primitives, composed by hand, no third-party audit yet. We say so everywhere and we'd welcome it.

    honest gap

    Read the source

    Where to start, depending on what you want to check.

    Record format

    The frozen contract every later stage encodes against, with the mistakes that shaped it.

    spec/records.md

    Keys vault

    Segments, group secrets, grants, rotation and the follower's read path.

    crates/diaswarm-keys

    Networking

    Swarm setup, topics, bucket assignment and replication on p2panda-net and iroh.

    crates/diaswarm-net

    Decisions

    Why each piece is the way it is, including the ones that were reversed.

    docs/decisions.md

    What we won't claim

    The sentences this project may never say, and the true version of each.

    docs/feasibility.md §11

    Security

    Scope, known limits, and how to report a problem.

    SECURITY.md

    Roles

    Who each layer is, what they may truthfully be told, and the honest limit on each.

    docs/roles.md

    Data rights

    The full per-principle assessment against the Charter, with the evidence that would change each verdict.

    docs/rights.md