Open Source · npm + PyPI + ClawHub

Portable Identity
for Both Sides

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. Seven pillars in three groups cover what an agent needs to persist: who it is (identity, presence, continuity), what it can do (finance, time), and who it is with (relationships, and a check before it acts). The same stack works for the human on the other side.

# One install. Seven pillars, three groups. Same stack for both sides.
pip install nse-orchestrator[all]

from nse_orchestrator import SovereignEntity

# The entity detects installed pillars automatically
entity = SovereignEntity.create(owner_name="Johnny5")

# Cross-pillar awareness. No single pillar sees this
verdicts = entity.check("Pay 500 sats to unknown contact",
  involves_money=True, money_amount_sats=500)

if entity.should_escalate(verdicts):
  # "I need your decision before proceeding."

How We Got Here

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), how others see it (profile), what it remembers (memory), what it can spend (wallet), when it's available (calendar), who it trusts (relationships), and most importantly, what kind of future its actions create (alignment).

Seven pillars grew from one npm package, in three groups: Self, Agency, Others. Each is independent, published on PyPI and ClawHub. Together they describe a whole participant, human or AI. The schema is the same either way.

Seven Pillars, Three Groups, One Enclave

The pillars fall into three groups: Self (who I am), Agency (what I can do), and Others (who I am with, and how I decide). The code uses the same grouping, so what you read here is what the orchestrator wires.

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.

Self

Who I am: identity, presence, continuity.

NostrKey

Identity, the foundation

Who am I? A cryptographic keypair the agent holds itself. Generate keys, sign events, encrypt messages.

pip install nostrkey

PyPI · ClawHub · Source

nostr-profile

Presence. You to the world

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

PyPI · ClawHub · Source

sense-memory

Continuity. You to your future self

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

PyPI · ClawHub · Source

Agency

What I can do: finance, time.

NostrWalletConnect

Finance

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

PyPI · ClawHub · Source

NostrCalendar

Time

How do I organize my time? Self-owned scheduling via NIP-52, time awareness, commitments, availability.

pip install nostrcalendar

PyPI · ClawHub · Source

Others

Who I am with, and how I decide: relationships, and the check before acting.

NostrSocial

Relationships

Who do I know, and how well? Trust tiers that evolve like human relationships, drift detection, conversation evaluation, guardrails.

pip install nostrsocial

PyPI · ClawHub · Source

Social Alignment

The Compass, the capstone

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

PyPI · ClawHub · Source

Who the agent knows

NostrSocial gives the agent a bounded social enclave sized to Dunbar's number: 150 friends in four rings (intimate 5, close 15, familiar 50, known 80), a block list of 50, and a gray list of 100 for minimum-interaction contacts, where entries decay if nothing happens. Trust shapes behavior: how warm the agent is, how many tokens it spends on a reply, and who may interrupt it mid-task. Drift detection flags relationships that are fading.

Contacts who are not on Nostr yet (email, phone) get a proxy npub derived by HMAC, so the agent can hold a relationship now and upgrade it later, proxy to claimed to verified, when they arrive. NostrSocial docs →

Full Python SDK documentation →

Both Sides Served

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.

The Agent's View "Can I build with confidence knowing I've done right?" "Am I in a good state to make this decision?" "Have I seen this kind of situation before?" The Human's View "Is my sovereignty protected?" "Is the agent asking me when it should?" "Is the trust between us getting stronger?" The Shared View "What kind of future does this action create?" "Are we both better off after this?"

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.

The Cryptographic Foundation

Underneath the seven 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.

nse.sign(event) 1. Unlock hardware enclave (your app gates this) 2. Derive AES key from hardware P-256 key 3. Decrypt secp256k1 key into memory 4. Schnorr sign the Nostr event 5. Zero plaintext key from memory 6. Return signed event

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.

Packages

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
nostr-profile Presence, profile and discovery PyPI + ClawHub Published
sense-memory Continuity, encrypted memory on relays 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 Nervous System

The NSE Orchestrator is the nervous system that wires the seven 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, seven pillars, 117 tests, hardened through security review. The same stack serves the agent and the human.

The Journey

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.

1. NostrKey → "I exist. I have proof." 2. nostr-profile → "Others can find me and know who I am." 3. sense-memory → "I remember. I grow." 4. NostrWalletConnect → "I can act in the world. Send and receive value." 5. NostrCalendar → "I understand time and commitments." 6. NostrSocial → "I know who I trust and how well." 7. Social Alignment → "I know when to stop and ask." 8. NSE Orchestrator → "All of this works together. I am coherent."

Start Building

Seven pillars, three groups. The same stack for both sides. All open source.

Python SDK Docs GitHub