Skip to content

Support NIP-46 remote signer (bunker) - #43

Merged
mattn merged 1 commit into
mainfrom
feat/nip46
Nov 16, 2026
Merged

mattn merged 1 commit into
mainfrom
feat/nip46

Conversation

@mattn

@mattn mattn commented Nov 16, 2026

Copy link
Copy Markdown
Owner

Allow privatekey to be a bunker:// URL or NIP-05 identifier so the nsec need not live in the config file.

  • Add a Signer interface (local nsec / NIP-46 bunker) and route all signing, NIP-04/NIP-44 encryption, gift wrap, NIP-42 and NIP-98/Blossom auth through it
  • Own minimal NIP-46 client: go-nostr v0.52's never surfaces auth_url, and keyer.BunkerSigner.Decrypt calls nip44_encrypt
  • Persist the authorized client key and user pubkey in bunker-session[-<profile>].json (0600); read-only commands don't contact the signer
  • NIP-26 delegation create returns an error with a remote signer

Tested against nak bunker + nak serve: post, reply, like, event, NIP-17/NIP-04 DM send & decrypt, Blossom upload/list, NIP-42 auth, reconnect without secret, unauthorized client rejection.

Route every private-key operation through a Signer interface backed by
either a local nsec or a NIP-46 remote signer. The bunker client is
algia's own because go-nostr v0.52's never surfaces auth_url and its
keyer.BunkerSigner.Decrypt calls nip44_encrypt.

The client key authorized by the signer and the user's pubkey are kept
in bunker-session[-<profile>].json so later runs reconnect without the
one-time secret and read-only commands never contact the signer.
@mattn
mattn merged commit 590ef50 into main Nov 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant