Add NIP-46 app metadata with origin, icon and permissions #123

Merged
raucao merged 1 commits from chore/remote_signing_app_identity into master 2026-11-23 18:49:57 +00:00
Owner

Marco deployments on different origins all looked like the same "Marco" session in remote signer apps (e.g. Amber), and no app icon was shown. The origin was already sent as url in the nostrconnect:// URI, but NIP-46 only surfaces that on the approval screen; a signer's connection list renders just the app name and icon.

This adds proper NIP-46 client metadata:

  • buildNostrAppMetadata() returns name = "Marco (<host>)" (the host includes the port, so self-hosted instances and dev servers are distinguishable), the canonical url, and an absolute image URL pointing at /icons/icon-192.png.
  • The requested permissions are sent along via perms, so signers can pre-approve what Marco signs: kinds 5 (NIP-09 deletion), 360 (Place Photos), 9734 (zap request) and 24242 (Blossom auth).
  • The old description/icons fields are dropped; they came from the 2024 draft metadata format and are ignored by current NIP-46 implementations.

pnpm lint passes and pnpm test passes (468 tests, 0 failures, including four new unit tests covering the metadata and the generated URI).

Caveats: signers that predate these NIP-46 fields only show the name (Amber shows name, url and icon from 6.2.2 on), and icons are fetched over https from the user's device, so localhost/LAN origins show no icon.

Marco deployments on different origins all looked like the same "Marco" session in remote signer apps (e.g. Amber), and no app icon was shown. The origin was already sent as `url` in the `nostrconnect://` URI, but NIP-46 only surfaces that on the approval screen; a signer's connection list renders just the app name and icon. This adds proper NIP-46 client metadata: - `buildNostrAppMetadata()` returns `name = "Marco (<host>)"` (the host includes the port, so self-hosted instances and dev servers are distinguishable), the canonical `url`, and an absolute `image` URL pointing at `/icons/icon-192.png`. - The requested permissions are sent along via `perms`, so signers can pre-approve what Marco signs: kinds 5 (NIP-09 deletion), 360 (Place Photos), 9734 (zap request) and 24242 (Blossom auth). - The old `description`/`icons` fields are dropped; they came from the 2024 draft metadata format and are ignored by current NIP-46 implementations. `pnpm lint` passes and `pnpm test` passes (468 tests, 0 failures, including four new unit tests covering the metadata and the generated URI). Caveats: signers that predate these NIP-46 fields only show the name (Amber shows name, url and icon from 6.2.2 on), and icons are fetched over https from the user's device, so localhost/LAN origins show no icon.
raucao added 1 commit 2026-11-23 18:46:04 +00:00
Add NIP-46 app metadata with origin, icon and permissions
CI / Lint (pull_request) Successful in 1m18s
CI / Test (pull_request) Successful in 1m20s
Release Drafter / Update release notes draft (pull_request) Successful in 34s
c07b428509
Marco (host) as app name, absolute icon URL, requested signing kinds
raucao added the enhancementnostr labels 2026-11-23 18:48:29 +00:00
raucao merged commit 03d5d2787f into master 2026-11-23 18:49:57 +00:00
raucao deleted branch chore/remote_signing_app_identity 2026-11-23 18:49:58 +00:00
Sign in to join this conversation.