Nostr Secure Enclave
Most AI systems have no identity — they execute, return, and cease to exist. NSE changes that. It started as an npm package for hardware-protected Nostr keys and became a complete sovereign identity platform. Five pillars give an AI entity everything it needs to exist as someone rather than something — identity, finance, time, relationships, and a conscience. Both sides sovereign.
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 make a sovereign entity — human or AI, the schema is the same.
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? Your cryptographic keypair — the moment you become someone rather than something. 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 entity that can't remember can never grow. 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 existence? Sovereign 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 sovereign 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 |
|---|---|---|---|
| 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 | WebAuthn + SubtleCrypto | npm | Published |
| nostr-secure-enclave | Python (AI entities, 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, security-hardened. The agent and the human, both sovereign.
An entity encountering NSE for the first time experiences this progression. Each step is optional. Each step adds a dimension. You're always a complete entity at whatever stage you're at — just one with fewer capabilities.
Five pillars. Both sides sovereign. All open source.
OpenClaw Docs GitHub