Nine lines of crypto
A scoped data grant is small enough to fit in a paragraph and general enough to swallow a product category. Here’s the idea — and why I want you to build a client against it.
Here’s a sentence that sounds like it can’t be literally true: I built a contacts app, a document vault, a whistleblower tip line, a family inheritance system, two games, and an AI agent runtime — and they’re all the same handful of cryptographic moves wearing different clothes.
It’s true. And the reason it’s true is the reason I’m writing this to builders specifically.
The whole idea
Strip nostr to the studs: you publish signed events to dumb relays that don’t know or care what’s in them. Now add one move. Take a blob — a document, a contact record, an API credential — encrypt it under a random 32-byte key that has nothing to do with your identity key. Publish the ciphertext as an ordinary event. Then hand the decryption key to exactly the people or agents you choose, wrapped in a gift-wrapped event only they can open.
That’s the whole primitive. It’s a scoped data grant — spec’d as NIP-DA, PR #2411. Four kinds carry it: 30440 is the encrypted data set, 440 is the grant, 441 a revocation, 10440 a self-recoverable index of everything you’ve granted.
The part that makes it more than “encrypted file sharing” is revocation. There’s no server ACL to flip, no token to expire. You publish a key rotation. The old scope key is dead — anyone still holding it can read the old ciphertext they already saved, but they get no more updates, ever. No cryptosystem can un-tell a secret, and this one doesn’t pretend to. That’s the creed:
The signature is the authorization; the rotation is the revocation.
One primitive, seven apps, none of them special
Every app I built is a pure client of that one grant. None reimplement access control. None run a server trusted with plaintext.
Nontact is a no-maintenance address book — each person’s record is self-maintained and shared as scopes, so your address book is an emergent view over grants, not a copy anyone owns. Nvelope points it at documents — live folders with real revocation. Nherit points it at your death — a legacy vault with a dead-man’s-switch and a paper Shamir backup. Notegate points it at journalism — a serverless tip line where no server ever holds a readable tip. Noir and Ntrigue make it playful — spycraft intel that literally is a scoped grant, and a party game where “you can revoke a secret, but you can’t un-tell it” is just the honest physics of the crypto. And Nvoy hands an AI agent exactly the slice of your data it needs over MCP — then cuts it off mid-sentence, live.
Seven apps. One grant. That breadth is the whole point: the primitive is general, and it’s small.
This is the recruiting pitch
Here’s the honest shape of it. The idea is nine lines of crypto. The JavaScript reference (nipxx.mjs) that implements the full spec is about 200 lines. There’s a Go CLI too, and the two interoperate live against public relays — one encrypts, the other decrypts, on the spec text alone.
Both of those are mine. That’s the gap I’m asking you to close.
A spec earns its place when someone who didn’t write it can build against it from the document and interoperate on the first try. That’s the single most valuable thing anyone can contribute to NIP-DA right now — worth more than any feature, any app, any amount of my own output. If the primitive is as clean as I think it is, a second, independent implementation should be a weekend, not a project.
So, concretely — if you build clients:
- Read the spec:
DA.mdin PR #2411. It’s one screen of definitions and four event kinds, building only on NIP-44 and NIP-59. Zero relay changes. - Build the smallest thing that interoperates — decrypt a
30440from a440grant you were handed, or publish one another client can read. Any language. Referencenipxx.mjsonly to check yourself, not to copy. - Cross-test it live against a public relay with the reference lib, and say so on the PR thread. One “I built an independent implementation and it interops” comment moves this spec further than a hundred of mine.
The idea about encrypting a blob and handing out the key turned out to be enough scaffolding for an address book, a vault, a tip line, an inheritance system, two games, and the agent that ties a digital life together — with revocation everywhere meaning exactly one thing: you rotated a key.
If that’s the kind of primitive you want to exist in nostr, the most useful thing you can do is prove it works in your hands. Build the second implementation. 🐝
Write a comment