fix(nip46): kind:0 profile + NIP-98 auth via signer trait#107
Merged
Conversation
Two commands hardcoded \`get_keys_and_client\` (which errors out for non-local signers), so remote-signer users couldn't: - Update their kind:0 profile metadata (display name, picture, bio, lud16, etc.) — \`publish_nostr_profile\` failed with "this operation requires local keys." - Authenticate image uploads via NIP-98 — \`create_nip98_auth\` failed with the same error, breaking image hosts (e.g. blossom) that rely on it. Both now route through \`get_signer_and_client\` and use \`NostrSigner::sign_event\` on an unsigned-event builder, the same pattern \`publish_market_comment\` and friends already use. Local nsec users are unaffected (the trait dispatches to local-keys sign); NIP-46 users now get the round-trip prompt to their bunker app like every other signed action. \`discovery::publish_profile\` signature changes from \`(keys: &Keys, ...)\` to \`(signer: &Arc<dyn NostrSigner>, ...)\`, fetching the author's pubkey through the signer for the kind:0 merge step. Smaller scope of the larger NIP-46 cleanup tracked in memory; the remaining items (logout-button-for-remote-signer, session detection) ship in a follow-up branch.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two commands were stuck on `get_keys_and_client` (which errors out for non-local signers), so remote-signer users couldn't:
Both commands now route through `get_signer_and_client` and sign via `NostrSigner::sign_event` on an unsigned-event builder, matching the pattern `publish_market_comment` and the social commands already use. Local nsec users are unaffected; NIP-46 users now get the round-trip prompt to their bunker app like every other signed action.
`discovery::publish_profile` signature changes from `(keys: &Keys, ...)` → `(signer: &Arc, ...)`. The kind:0 merge step fetches the author pubkey through the signer instead of dereffing keys directly.
Out of scope
This is a surgical fix for the two commands the user just hit. The broader NIP-46 cleanup (logout button for remote signers, session detection / heartbeat / online flag) is tracked in memory and ships in a follow-up branch.
Test plan