NostrAgent: A Decentralized Identity and Delegation Architecture for Sovereign Agentic Systems
Organizations: University of Southern Denmark, Odense, Denmark
Abstract
Autonomous AI agents increasingly act across organizational boundaries on behalf of human operators: they invoke third-party services, delegate subtasks to other agents, and pay for metered resources. Deploying such agents safely requires five capabilities that today live in separate systems: persistent identity, scoped delegation, peer trust, discovery, and payment. Existing approaches root these in centralized authorities or cover only subsets, so authority, trust, and payment fracture exactly where autonomy needs continuity: when a key rotates or a delegation must be revoked. We present NostrAgent, a decentralized architecture that unifies all five over Nostr relays using three custom event kinds: Kind 38100 identity declarations authenticated by BIP340 Schnorr signatures with pre-rotation commitments, Kind 38101 scoped delegation chains whose every hop verifiably narrows granted capabilities, and Kind 38102 peer attestations forming a Sybil-deterrent trust graph, with Lightning HTTP 402 (L402) binding payment to agent identity. Identity remains operator-sovereign without any registration authority; relays are substitutable transport rather than a trust root; and every authorization decision is replayable offline from signed events. We evaluate a Python prototype with a mixed-method design: ATAM quality analysis with a two-round mini-Delphi panel, STRIDE threat modeling across three trust boundaries, eleven benchmarks with non-parametric statistics, and 19 failure modes. Results show sub-millisecond offline verification, linear delegation-chain scaling, and Lightning-settled L402 at 157 ms median on regtest. 17 of 19 failure modes pass empirically, one is bounded analytically, and one is disclosed as an architectural limitation. NostrAgent demonstrates an auditable prototype substrate for trustworthy agentic systems without centralized trust roots.
Figures & tables
| Term | Meaning |
|---|---|
| d -tag | Operator-chosen stable identifier keying a replaceable event |
| Preimage | Secret whose SHA256 hash locks a payment; proof of settlement |
| Satoshi (sat) | Smallest Bitcoin unit; Lightning payments are denominated in sats |
| Regtest | Local, deterministic Bitcoin/Lightning test network |
| Pre-rotation | Commitment to the hash of the next key before that key is ever used |
| Noisy-OR | Combination rule treating each trust path as independent evidence |
| System | A1 | A2 | A3 | A4 | A5 | A6 | A7 |
|---|---|---|---|---|---|---|---|
| NostrAgent | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | |
| AIP ( key: ) | ✓ | ✓ L | P | P | P | ✓ P | |
| AIP ( web: ) | P | ✓ L | P | P | P | ||
| KERI/ACDC | ✓ | ✓ | ✓ | P | P | ||
| W3C DID ( did:web ) | P | A | |||||
| ERC-8004 | P | P | A |
| ID | What it measures | Env. |
|---|---|---|
| B1 | Kind 38100 verification: serialization, event-id recomputation, BIP340 verify, content parse | Offline |
| B2 | Isolated BIP340 signature verification, per event kind | Offline |
| B3 | Delegation-chain verification at depths 1 through 4 | Offline |
| B4 | Relay discovery of a Kind 38100 identity across 1 to 3 relays | Docker |
| B5 | Kind 38102 attestation validation: schema, event id, signature | Offline |
| B6 | Trust-graph query (noisy-OR depth-first search), 5 to 500 nodes | Offline |
| ID | Variant | Median (ms) | IQR | P95 | P99 | N |
|---|---|---|---|---|---|---|
| B1 | kind_38100 auth | 0.0165 | 0.0005 | 0.0169 | 0.0204 | 900 |
| B2 | BIP340 verify (all kinds) | 0.0154 | 0.0001 | 0.0157 | 0.0169 | 900 |
| B3 | depth 1 | 0.0155 | 0.0001 | 0.0159 | 0.0196 | 900 |
| B3 | depth 2 | 0.0308 | 0.0005 | 0.0320 | 0.0365 | 900 |
| B3 | depth 3 | 0.0460 | 0.0001 | 0.0487 | 0.0520 | 900 |
| B3 | depth 4 ( 15 us/hop) | 0.0619 | 0.0002 | 0.0658 | 0.0698 | 900 |
| Branch | Leaf | Concern | (Imp, Diff) |
| Sovereignty | S1 | Offline verifiability | H,H |
| S2 | Censorship resistance (relay migration) | H,M | |
| S3 | Key portability (rotation enforcement) | H,H | |
| S4 | Infrastructure independence | M,L | |
| Operability | O1 | Verification latency | H,M |
| O2 | Framework interoperability d | M,M |
| Gap | Mechanism | Evidence |
|---|---|---|
| G1 key continuity | Pre-rotation and prev_key chain (Sect. 4.5 ) | B7: rotation 236 ms; FM-6: competing rotations rejected; FM-7: continuity; attestations survive rotation (T2) |
| G2 attenuated delegation | Kind 38101, INV-1 through INV-7 (Sect. 4.3 ) | B3: linear verification at roughly 15 µs per hop; B10: 4.2 µs per caveat; B8: revocation on all relays in 337 ms; FM-9 and FM-17: escalation rejected |
| G3 peer trust | Kind 38102 attestations, noisy-OR aggregation, L402 cost floor (Sect. 4.4 ) | FM-8: decay caps Sybil trust at 0.714 vs. 1.0; FM-13: 10,000 to 20,000 sats per unit of fabricated trust; B6: query scaling |
| G4 registry-free discovery | Kind 38100, NIP-01 filters, multi-relay publishing (Sect. 4.2 ) | B4: resolution 1.4 to 2.3 ms (SP-1); FM-1: graceful degradation; FM-2: omission defeated |
| G5 identity-bound payment | 65-byte macaroon identifier, preimage, BIP340 request signature (Sect. 4.6 ) | B9: settlement 157 ms; B11: five checks in 0.055 ms; FM-4: LND-outage recovery |
| ID | Status | Detail |
|---|---|---|
| FM-1 | PASS | Relay partition: resolution succeeds with 1/2/3 relays (3.9/3.3/11.1 ms) |
| FM-2 | PASS | Relay malice: union queries defeat censorship-by-omission; BIP340 signatures preclude tampering |
| FM-4 | PASS | L402 fails cleanly on LND outage; recovers without channel corruption |
| FM-5 | PASS | Revocation verification: 33.4 µs |
| FM-6 | PASS | Key compromise: attacker rejected, legitimate rotation accepted |
| FM-7 | PASS | Key loss: identity chain valid after pre-rotation recovery |
| Category | TB1 | TB2 | TB3 |
|---|---|---|---|
| Spoofing | 2 | 2 | 2 |
| Tampering | 2 | 1 | 2 |
| Repudiation | 3 | 2 | 2 |
| Information Disclosure | 4 | 4 | 3 |
| Denial of Service | 3 | 2 | 3 |
| Elevation of Privilege | 2 | 2 | 2 |
AI Agent Security
Artificial intelligence agent security studies attacks and safeguards for tool-using, persistent, and collaborative systems across digital and physical settings.
See all 510 papers