Skip to content

Feature request: Ability to reuse bunker URL for remote signers #69

Description

@aaccioly

Nak already supports signing events by providing a bunker connection token.

https://github.com/fiatjaf/nak/?tab=readme-ov-file#sign-an-event-using-a-remote-nip-46-bunker

However, at least when using it with a token generated by Amber, nak only works once.Afterwards, using the same token as a parameter for --sec returns an error stating that Nak is already connected.

Ideally, Nak should not error out. It should "remember" the signer credentials (e.g. via a file or environment variable) and allow the user to run multiple operations in a row with the same signer/connection token.

It would be great if there were an equivalent to the NOSTR_SECRET_KEY environment variable for remote signers (e.g., NOSTR_NIP46_TOKEN) that users could set once, just like they do with Nostr clients.

Moonshot Ask 1

It would be nice if Nak could also generate its own nostrconnect token and display it with a QR code à la ngit.

Moonshot Ask 2

Multiple bunker tokens (for different npubs)

It would be brilliant if I could pass a list of multiple bunker tokens (for different pubkeys) and then select which "profile" I want to use to sign a specific event (e.g. by npub).

Example:

export NOSTR_NIP46_TOKENS="bunker://<remote-signer-pubkey1-url>;bunker://<remote-signer-pubkey2-url>"

Then allow users to select which key to use for signing via the remote signer or user pubkey/npub.

Example:

nak event --sec <pubkey1> -c 'Posting as user 1' nos.lol
nak event --sec <pubkey2> -c 'Posting as user 2' nos.lol
nak event -c 'Posting as user 1 again' # Defaults to first token

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions