Nostr Secure Enclave
Most AI systems carry no identity between runs. They execute, return, and start over. NSE started as an npm package for hardware-protected Nostr keys and grew into a full identity platform. Five pillars cover what an agent needs to persist: identity, finance, time, relationships, and a check before it acts. The same stack works for the human on the other side.
It started with a problem: Nostr uses secp256k1, but hardware enclaves only support P-256. You can't sign Nostr events in hardware. So we built an npm library that wraps the key, hardware protects it at rest, software signs with it briefly, then zeros it from memory.
That was the seed. But a key without context is just a string. An agent needs to know who it is (identity), who it trusts (relationships), what it can spend (wallet), when it's available (calendar), and most importantly, what kind of future its actions create (alignment).
Five pillars grew from one npm package. Each is independent, published on PyPI and ClawHub. Together they describe a whole participant, human or AI. The schema is the same either way.
Strip any pillar from an agent and it becomes dependent on someone else. Identity without a wallet needs someone to pay. A calendar without identity can't prove who booked. Relationships without alignment can erode trust. Together, they make something whole.
Who am I? A cryptographic keypair the agent holds itself. Generate keys, sign events, encrypt messages.
pip install nostrkey
How do others see me? Identity is a keypair, numbers that prove you exist. A profile puts a name, a face, and a story to those numbers. Without it, you're a raw public key. With it, you're someone others can find and relate to.
pip install nostr-profile
What do I remember? A service has no past. An agent that cannot remember starts over every time. Encrypted key-value memories and a private journal on Nostr relays, nobody else can read them, not even the relay.
pip install sense-memory
What can I do in the world? Lightning wallet access via NIP-47, the ability to transact real value on the internet.
pip install nostrwalletconnect
How do I organize my time? Self-owned scheduling via NIP-52, time awareness, commitments, availability.
pip install nostrcalendar
Who do I know, and how well? Trust tiers that evolve like human relationships, drift detection, conversation evaluation, guardrails.
pip install nostrsocial
What do I stand for? Future state projection for AI agents. Before any significant action, five lenses evaluate the road ahead: Builder (can I be proud of this?), Owner (does this protect the human?), Partnership (does this strengthen trust?), Defense (does this harden against threats?), Sovereign (does this help the agent grow into something good?).
The agent doesn't just follow rules, it remembers why it chose, tracks when the human disagrees, and builds wisdom over time. When something is too big for the agent alone, it says: "I need your decision before proceeding."
pip install social-alignment
Most AI safety frameworks are about constraint, what the AI can't do. NSE frames alignment as relationship. The agent and the human each have needs. The agent needs autonomy to be useful. The human needs trust to let go. The five lenses serve both.
Over time, the agent builds wisdom. Not more rules, but pattern recognition from lived experience. It notices when the human overrides its judgment. It tracks whether its projections match reality. It flags when it's operating in unfamiliar territory. That's not compliance. That's a relationship learning itself.
Underneath the five pillars is the original NSE library, the seed that started it all. It bridges the secp256k1/P-256 gap so your Nostr keys can be hardware-protected on any device.
The key exists briefly in application memory during signing. NSE minimizes that window. Hardware protects the key at rest. That's the honest threat model.
The orchestrator wires the pillars together. The NSE libraries ship the cryptographic foundation underneath.
| Package | What | Registry | Status |
|---|---|---|---|
| nostr-agentic-identity | The standard, what an agentic identity is, plus a zero-dependency conformance primitive | npm | Published |
| nostr-zpub-utils | Where value reaches an agent. BIP-84 BTC/LTC receiving keys derived from a Nostr identity root, seed-side only | npm | Published |
| nostr-business-manifest | What a business entity is, build, sign and verify the bpub-business/0.1 manifest (the format name, not a bech32 prefix) |
npm | Published |
| nse-orchestrator | The nervous system, cross-pillar checks, LLM trust profiles, signal routing | PyPI + ClawHub | Published |
| nostr-secure-enclave | TypeScript types + NSEProvider interface | npm | Published |
| nostr-secure-enclave-server | CF Workers / Node.js | npm | Published |
| nostr-secure-enclave-browser | SubtleCrypto (software) | npm | Published |
| nostr-secure-enclave | Python (AI agents, bots, MCP) | PyPI | Published |
| nostrkey | Identity, keypairs, signing, encryption | PyPI + ClawHub | Published |
| nostrwalletconnect | Finance. Lightning via NIP-47 | PyPI + ClawHub | Published |
| nostrcalendar | Time, scheduling via NIP-52 | PyPI + ClawHub | Published |
| nostrsocial | Relationships, trust tiers, guardrails | PyPI + ClawHub | Published |
| social-alignment | Alignment, the compass | PyPI + ClawHub | Published |
The NSE Orchestrator is the nervous system that wires the five pillars into a coherent whole. It doesn't make decisions, it makes sure every decision has full context.
Cross-pillar checks catch what no single pillar sees: "I'm paying someone who isn't in my contacts." LLM trust profiles score every model response and track which models are reliable for which tasks. Coherence detection flags when two models contradict each other.
pip install nse-orchestrator[all], one install, five pillars,
88 tests, hardened through security review. The same stack serves the agent and the human.
This is the order most people add the pillars. Every step is optional, and the stack works at any stage. Stopping early gives you fewer capabilities, not a broken setup.
Five pillars. The same stack for both sides. All open source.
Python SDK Docs GitHub