Skip to content

feat(cli): add NIP-46 remote signing bunker support - #1758

Closed
ldstreet wants to merge 1 commit into
block:mainfrom
ldstreet:agent/buzz-fea458b1
Closed

feat(cli): add NIP-46 remote signing bunker support#1758
ldstreet wants to merge 1 commit into
block:mainfrom
ldstreet:agent/buzz-fea458b1

Conversation

@ldstreet

@ldstreet ldstreet commented Jul 11, 2026

Copy link
Copy Markdown

Adds NIP-46 remote signing support to the Buzz CLI, enabling secure remote key management for production agent deployments.

Features

  • buzz bunker connect — Connect to a remote signer (client mode)
  • buzz bunker serve — Start a remote signer daemon (server mode)
  • Full NIP-46 protocol support: connect, get_public_key, sign_event, nip44_encrypt, nip44_decrypt, ping, logout
  • Client session tracking for security
  • Configurable inactivity timeout (default 3600s, 0=infinite)
  • Secret validation to prevent connection spoofing
  • Auto-approve mode for development environments

Implementation

  • Event kind 24133 (NIP-46 remote signing requests/responses)
  • NIP-44 encryption for all payloads
  • WebSocket communication via existing buzz-ws-client
  • Bunker URL parsing: bunker://<pubkey>?relay=<url>&secret=<optional>
  • Session-aware request rejection (clients must connect before signing)

Testing

  • End-to-end tested against production NIP-46 signer
  • All quality checks passing (fmt, clippy, unit tests)

Documentation

  • CLI README updated with usage examples
  • Security guidance added to README.md, SECURITY.md, and AGENTS.md
  • Positioned as production-recommended approach for agent deployments

Use Cases

Recommended for:

  • Production agents (keeps keys off runtime environment)
  • CI/CD pipelines
  • Multi-tenant agent platforms
  • Compliance environments requiring hardware-backed keys

@ldstreet
ldstreet force-pushed the agent/buzz-fea458b1 branch 3 times, most recently from eca8e48 to 295ff5f Compare July 11, 2026 23:52
Implements NIP-46 remote signing protocol for Buzz CLI, enabling secure
remote key management and signing operations.

Features:
- buzz bunker connect — connect to a remote signer (client mode)
- buzz bunker serve — start a remote signer daemon (server mode)
- Full NIP-46 protocol support: connect, get_public_key, sign_event,
  nip44_encrypt, nip44_decrypt, ping, logout
- Client session tracking with HashSet for security
- Configurable inactivity timeout (default 3600s, 0=infinite)
- Secret validation to prevent connection spoofing
- Auto-approve mode for development (with warning)
- Session-aware request rejection (all methods check connect status)

Implementation:
- Event kind 24133 (NIP-46 remote signing)
- NIP-44 encryption for request/response payloads
- WebSocket communication via buzz-ws-client
- JSON-RPC-like message structure per spec
- Bunker URL parsing (bunker://<pubkey>?relay=<url>&secret=<optional>)

Testing:
- End-to-end tested against production App Store signer
- Connect flow validated with secret verification
- All quality checks passing (fmt, clippy, unit tests)

Documentation:
- CLI README updated with usage examples
- Subcommand count updated (62 subcommands across 14 groups)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@ldstreet
ldstreet force-pushed the agent/buzz-fea458b1 branch from 295ff5f to aeb6832 Compare July 12, 2026 00:56
@ldstreet
ldstreet marked this pull request as ready for review July 12, 2026 01:07
@ldstreet
ldstreet requested a review from a team as a code owner July 12, 2026 01:07
@tlongwell-block

Copy link
Copy Markdown
Collaborator

Thanks for submitting this, @ldstreet! This is a great idea and will get into Buzz soon (July/August). We're looking at a comprehensive setup that will work for both humans and agents, with conventional remote bunkers as well as live-hardware-signing. I really like the simplicity of the cli subcommand here and I think that will be incorporated into the remote signing implementation.

For anything security-sensitive, we typically have e2e testing and a formal/verified security model. The review for this PR included modeling and it ends up requiring a rework of the implementation to get them all green, so I'm going to close this for now in favor of the upcoming, wider remote signing work.

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.

2 participants