nfunc

v0.1.0

The suite’s remote signer: it keeps your key at home, encrypted, and signs for the apps you have paired with it — so they never see the key.

Not released yet: there are no downloads, and the source is not public yet.

What it is

A small program that holds a Nostr key and answers signing requests over NIP-46. An app such as nview asks; nsign decides by that app’s policy, signs or refuses, and writes the decision to a log. When a request falls outside the policy it can ask a person, through nbridge, instead of refusing.

Status: pairing, policy, signing, the log and approvals through nbridge all work, tested end to end, and it is in daily use on a Raspberry Pi 5.

Made for a small machine at home

Always on
Designed to run all the time on a low-powered device of its own.
Hardware
A Raspberry Pi 5 — what it is built and tested on — with a minimal headless system on its SD card.
Nothing comes in
It only connects out, to relays, and listens. Nothing connects to it, so it can sit behind a home router with no ports opened.
How it works
Two keys
The identity is the key it signs as. The service key is the one it talks with: the bunker:// string, the relay traffic and anyone watching see only the service key, never your npub. Both are stored encrypted (NIP-49) and unlocked together by one passphrase.
Starts locked
It signs nothing until someone gives it the passphrase. There is no automatic unlock; after a restart, a person unlocks it.
Pairing works once
A pairing prints a bunker:// string with a one-time secret. The first app to connect with it is bound to its own key, and the string is spent.
Default deny kind:0
A paired app may get its public key, check the signer is there, and have the kinds it was paired with signed — nothing else. A profile, a contact list and a relay list always need a person’s approval and cannot be allowed in advance. Encrypting and decrypting, which would read messages, are refused.
A log, never content
One line per request: time, app, method, kind, decision. Never what was signed.
Using it
nsign init --relay wss://relay.example.com   # a new identity; or --import an nsec
nsign pair nview --kinds 7,5                 # prints a single-use bunker:// string
nsign serve                                  # asks for the passphrase, then runs
nsign apps                                   # paired apps, and their counts
nsign log                                    # recent requests
nsign revoke nview

State lives in $NSIGN_DIR, else $XDG_DATA_HOME/nsign, else ~/.local/share/nsign, readable by its owner only.

Back up the two .ncryptsec files and the passphrase, offline — not a disk image.

How Nostr does it

Signing requests and replies are NIP-46, encrypted between each app and the service key. The approval channel to nbridge is the suite’s own convention, not a Nostr standard, described in ndisc’s SUITE.md.

Event kinds

  • kind:24133 a remote-signing request or reply (NIP-46)
  • kind:4133 an approval request or answer — the suite’s own convention

NIPs in play

  • NIP-46 remote signing — the apps’ requests
  • NIP-49 the keys, encrypted with the passphrase
  • NIP-44 encryption of requests and approvals