From 1232a80cc8d4a147a90234d1c0eb0d7a1164fc1d Mon Sep 17 00:00:00 2001 From: jwinterm Date: Sun, 5 Jul 2026 08:04:32 -0400 Subject: [PATCH] feat(capabilities): advertise features.nostr_native_auth (npub register available) The wallet gates its bootstrap on this: when true it registers via NIP-98 (no BTC signature); a legacy backend that omits the flag gets the BTC path. Shares the NIP-98 infra requirement (PUBLIC_API_URL) with nostr_identity. --- openapi.json | 5 +++++ src/api/capabilities.rs | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/openapi.json b/openapi.json index ad70336..f35abc4 100644 --- a/openapi.json +++ b/openapi.json @@ -2469,6 +2469,7 @@ "grin_relay", "prices", "nostr_identity", + "nostr_native_auth", "nostr_relay", "premium_relay", "feed", @@ -2487,6 +2488,10 @@ "type": "boolean", "description": "Nostr-native identity (NIP-98 login/link, NIP-05 directory)." }, + "nostr_native_auth": { + "type": "boolean", + "description": "npub-native registration: a wallet can register + authenticate from its\nseed-derived Nostr key alone (POST /auth/nostr/register), no BTC signature.\nThe wallet uses this to choose the NIP-98 bootstrap over the legacy BTC one." + }, "nostr_relay": { "type": "boolean", "description": "First-party Nostr relay (encrypted DM inbox). See `messaging` for details." diff --git a/src/api/capabilities.rs b/src/api/capabilities.rs index 41edd5c..f75c765 100644 --- a/src/api/capabilities.rs +++ b/src/api/capabilities.rs @@ -45,6 +45,10 @@ pub struct FeatureCapabilities { pub prices: bool, /// Nostr-native identity (NIP-98 login/link, NIP-05 directory). pub nostr_identity: bool, + /// npub-native registration: a wallet can register + authenticate from its + /// seed-derived Nostr key alone (POST /auth/nostr/register), no BTC signature. + /// The wallet uses this to choose the NIP-98 bootstrap over the legacy BTC one. + pub nostr_native_auth: bool, /// First-party Nostr relay (encrypted DM inbox). See `messaging` for details. pub nostr_relay: bool, /// Paid premium tier for general Nostr posting to the relay. See `premium`. @@ -227,6 +231,9 @@ pub fn effective_capabilities(config: &Config) -> CapabilitiesResponse { // Nostr identity needs the canonical PUBLIC_API_URL. nostr_identity: config.features.nostr_identity && config.identity.public_api_url.is_some(), + // npub-native register shares the same NIP-98 infra requirement. + nostr_native_auth: config.features.nostr_identity + && config.identity.public_api_url.is_some(), // Relay advertised only when enabled AND a URL is configured (config // presence downgrade — never advertise a relay clients can't reach). nostr_relay: relay_advertised(config),