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
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,
nakonly works once.Afterwards, using the same token as a parameter for--secreturns 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_KEYenvironment 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
nostrconnecttoken and display it with a QR code à langit.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:
Then allow users to select which key to use for signing via the remote signer or user pubkey/npub.
Example: