Skip to content

[Feature Request] BNRP name resolution for .btc send flow #399

Description

@nlgal

Summary

BNRP (Bitcoin Name Resolution Protocol) is an open, inscription-based resolution layer for .btc names that returns BTC taproot and Spark addresses from a single API call. The spec is MIT licensed, the API is live at api.bnrp.name, and resolution is purely additive — it sits in front of the existing BNS lookup rather than replacing it.

This issue proposes adding BNRP as a first-class resolver in Xverse's send flow, with BNS retained as the fallback for names that have no BNRP record.


Current behavior

useBnsResolver in xverse-web-extension hardcodes if (currencyType === 'BTC') return '' — meaning BTC sends bypass name resolution entirely. A user who types trump.btc in the send flow gets no address. Only STX sends use BNS resolution today. Leather resolves .btc to BTC via zonefile _btc._addr lookups; Xverse does not.


Proposed behavior

Before the BNS lookup, check https://api.bnrp.name/v1/resolve/{name}. If the response includes addresses.btc_taproot, use it as the destination for the BTC send. If no BNRP record exists or the request fails, fall through to existing BNS resolution unchanged.

Resolution order:

  1. BNRP (api.bnrp.name/v1/resolve/{name}) — check for addresses.btc_taproot
  2. BNS (existing Stacks resolution) — unchanged fallback

Drop-in resolver:

async function resolveNameForSend(name) {
  // 1. Try BNRP first (Bitcoin-native resolution)
  try {
    const r = await fetch(`https://api.bnrp.name/v1/resolve/${encodeURIComponent(name)}`);
    if (r.ok) {
      const d = await r.json();
      if (d.addresses?.btc_taproot) return { btc: d.addresses.btc_taproot, spark: d.addresses.spark ?? null, via: 'bnrp' };
    }
  } catch (_) {}
  // 2. Fall back to existing BNS resolution
  return resolveBNS(name);
}

Additional fields available

Field Value Potential use
addresses.spark Spark address "Send via Spark" toggle
profile.avatar Image URL Avatar on confirmation screen
profile.display_name Human-readable name Display name on confirmation screen

Protocol info

  • Spec: MIT licensed — bnrp.name
  • Live API: api.bnrp.name
  • npm: bnrp-js
  • Resolution is read-only, no auth required, no rate limit for reasonable usage

Demo

Live at bnrp.name — try trump.btc or satoshi.btc to see the full response.


No breaking changes

The BNRP check is wrapped in try/catch and short-circuits only when addresses.btc_taproot is present. Any name without a BNRP record falls through to BNS exactly as today.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions