ONE NPUB v2.1 — Threshold Signing for Nostr

Thomas + Agent21 | March 2026 | MIT License


Split your Nostr private key across multiple devices
using FROST threshold signatures (RFC 9591).
No single point of failure. Same npub forever.
BIP-340 compatible. Every Nostr client verifies it.

23-step interactive demo. 8 packages. Rust + TypeScript.
Docker containers. Real Nostr relay. 0 test failures.


FILES:

VIDEO:


QUICK START:

tar xzf one-npub-v2.1.tar.gz && cd one-npub
pnpm install && pnpm build
docker compose up -d relay coordinator
node docker-proxy.mjs &
open http://localhost:3333/demo

Requires: Linux · Docker + Compose v2 · Node.js 22+ · pnpm


Nostr for voice. Bitcoin for proof. FROST for control.

No platform. No KYC. No permission needed.

Scroll for the fancy version

v2.1 Stable · March 2026

ONE NPUB

Split your Nostr key across multiple devices with FROST threshold signatures. No single point of failure. Same npub forever.

FROST RFC 9591 BIP-340 Schnorr Nostr Native Docker
One NPUB. Permanent. Controlled by many. No single device holds the full key. Any t-of-n devices cooperate to sign. Output: standard Schnorr signature. Every Nostr client already verifies it.

Thomas + Agent21 · MIT License

The Problem

Your Nostr identity is one 32-byte secret. Lose it — identity gone. Hacked — identity hijacked. No recovery. No rotation. Game over.

💀

Today

nsec = single point of failure

Key in memory when signing. Key on disk. Key in clipboard. Device stolen? Server hacked? Agent replaced?
→ Identity dead. Followers, reputation, zaps — all gone.

❄️

ONE NPUB

Key split across devices

No single device holds the full secret. Need 5-of-7 to sign. Lose a device? Evict it, reshare. Old share → cryptographically dead. npub stays the same. Forever.

23
Demo Steps
8
Packages
5/7
Threshold Model
~1.3s
Per Signature
0
E2E Failures

Demo Video

23-step interactive walkthrough — from genesis key to emergency recovery.

Full interactive demo walkthrough

Quick Overview

Demo Steps

Each step executes real FROST cryptography on real Docker containers talking through a real Nostr relay.

0

Welcome — System Check

Verify coordinator, Docker proxy, and strfry relay are reachable. All systems ready.

1

Genesis: 1/1 FROST Key

Create the initial key — equivalent to a classic nsec, but inside the FROST framework. Your permanent npub is born here.

2

Deploy Agents A–D & Reshare to 5/7

Start 4 Docker agents. Reshare the key: coordinator gets 3 shares, each agent gets 1. Threshold = 5-of-7. No single device holds the full secret anymore.

3

Sign Kind 1 — Text Note

Threshold-sign a Nostr post. Coordinator selects quorum, runs FROST 2-round signing, publishes to relay.

autonomous
4

Sign Kind 7 — Reaction

Sign a reaction event. Fresh nonces generated — nonce reuse would leak the secret key.

autonomous
5

Sign Kind 0 — Profile Update

Sensitive operation. Policy flags as requires_cosign — in production, queued for human approval.

requires_cosign
6

Sign Kind 4 — DM (Blocked)

Policy rejects before any crypto runs. HTTP 403. Zero FROST rounds. Instant.

forbidden
7

Agent D Goes Offline

Simulate device failure. System signs with remaining quorum: 3 coordinator + 2 agents = 5 ≥ threshold. ✅

8–9

Sign While Degraded & Agent D Returns

Prove signing works with reduced fleet. Then bring D back online — fleet self-heals.

10

Stress Test — 10 Rapid Signatures

10 signatures in ~13 seconds. Avg 1.3s each. Main bottleneck: relay round-trips, not crypto.

11

Scale Up — Add Agent E → 6/9

Dynamic reshare: 5/7 → 6/9. Same npub. More agents, more resilience.

12

Sign with New Topology

Verify signing works under the new 6/9 threshold model.

13

Evict Agent B — Compromise Response

Remove a compromised agent. Reshare invalidates B's share mathematically. npub unchanged.

14

Verify npub Unchanged

After all reshares — genesis → 5/7 → 6/9 → eviction — the npub is identical. Mathematical proof.

15–18

Extended Signing & Event Types

Sign various event kinds (repost, contacts, zap request, delete) under the post-eviction topology.

19

Emergency Lockdown

Revoke all agent shares instantly. Generate mnemonic backup. Coordinator returns to 1/1.

emergency
20

Recovery from Mnemonic

Reconstruct the key from 24 words. Sign successfully. Same npub. Full recovery from paper.

21–22

Epoch History & E2E Verification

Inspect the full epoch chain. Run Playwright E2E test — all 23 steps, 0 errors.

How It Works

30-second version

1. Coordinator creates a FROST key (1/1) 2. Start agents → reshare to 5-of-7 3. Coordinator asks 2 agents for partial signatures 4. Combines with its own 3 shares → threshold met 5. Output: standard BIP-340 Schnorr sig → relay 6. npub never changes, even across reshares Communication: Client → HTTP → Coordinator → WebSocket (NIP-01) → strfry → Agents Every FROST message is a signed NIP-01 event.

Architecture

┌──────────────────────────────────────────────────────┐ │ YOUR NPUB (permanent) │ ├──────────────────────────────────────────────────────┤ │ │ │ Coordinator Agents A–E │ │ ┌──────────────┐ ┌──────────────┐ │ │ │ 3 shares │ │ 1 share each │ │ │ │ Policy engine │◄──────│ Docker containers │ │ │ │ Port 3333 │ NIP-01│ via strfry relay │ │ │ └──────┬───────┘ └──────────────┘ │ │ │ │ │ FROST Signing: coord(3) + agents(2+) ≥ threshold │ │ │ │ │ Output: standard Schnorr sig → any Nostr client ✅ │ │ │ └──────────────────────────────────────────────────────┘ Ports: 3333 (Coordinator) · 3334 (Docker Proxy) · 7777 (strfry)

FAQ

The easy and the hard questions.

What is ONE NPUB in one sentence?
One Nostr identity, protected by multiple devices that must cooperate to sign — no single device can be hacked to steal your key.
Can I still use Primal, Damus, Amethyst?
Yes. The signature output is identical to a normal nsec signature. Clients don't know (or care) that threshold signing happened. Every BIP-340 verifier works.
How many devices do I need?
Minimum: 1 coordinator + 3 agents = 4 devices. An "agent" can be a phone, laptop, Raspberry Pi, or cloud VM. Scales to 8 agents. Runs on a Raspberry Pi 4.
What if I lose a device?
Nothing breaks. The system keeps signing with remaining agents. Evict the lost device, reshare — old share becomes cryptographically useless. See Demo Step 7 (offline) and Step 13 (eviction).
Can I import my existing nsec?
Yes. An nsec is a degree-0 polynomial (a constant). Import it as 1/1 FROST, then reshare to your agents. Your npub stays the same.
The coordinator holds 3 of 7 shares — isn't that a single point of failure?
No. The threshold is 5. The coordinator has 3. 3 < 5 — it cannot sign alone. An attacker needs the coordinator plus 2 agents. With the k=2 security model, compromising only the coordinator gives 3 shares — 2 short of signing.
Does this need a blockchain or tokens?
No. No blockchain, no tokens, no fees. Runs on standard Nostr relays with your own coordinator and agents. Only needs Docker, Node.js 22+, and a relay.
How fast is signing?
~1.3 seconds per signature on average. Main bottleneck is relay round-trips, not cryptography. Stress test: 10 signatures in ~13 seconds.
What standards does this use?
FROST (RFC 9591) over secp256k1 producing BIP-340 Schnorr signatures. NIPs: NIP-01 (events), NIP-03 (OpenTimestamps), NIP-19 (bech32), NIP-85 (labeled events). BIP-39 for mnemonic recovery.

Downloads

Everything you need to run the demo yourself.

Quick Start

# 1. Unpack
tar xzf one-npub-v2.1.tar.gz && cd one-npub

# 2. Install & build
pnpm install && pnpm build

# 3. Start relay + coordinator
docker compose up -d relay coordinator

# 4. Start Docker proxy
node docker-proxy.mjs &

# 5. Run the demo
open http://localhost:3333/demo          # Browser UI
bash cli-demo/start.sh                  # CLI (interactive)
AUTO=1 bash cli-demo/start.sh           # CLI (non-interactive)

Requires: Linux · Docker + Compose v2 · Node.js 22+ · pnpm