Developer Guide

Integrate BNRP

Add .btc name resolution to any wallet, explorer, or dApp. REST API, no key required. 8 endpoints, one standard.

Who should integrate

BNRP adds a human-readable identity layer to any Bitcoin product. Here are the four main integration patterns.

Bitcoin wallets

Show satoshi.btc instead of bc1p.... Resolve when the user types a name in the send field. Reverse-resolve on the receive screen to confirm identity.

Ordinals explorers

Display the name, avatar, and profile card on any inscription page. Link every UTXO owner to their verified .btc identity without any off-chain trust.

Lightning apps

Use /.well-known/lnurlp/{name} to accept .btc names as Lightning payment targets. Compatible with any LNURL-pay wallet out of the box.

dApps & apps

Sign in with Bitcoin (SIWB) gives you PSBT-challenge auth with no passwords and no OAuth. Agent namespace resolution handles machine-to-machine identity on Bitcoin.

Quick start

No API key. No SDK required. Three patterns to get started in under 5 minutes.

A — Resolve a name (fetch) JavaScript
// Resolve satoshi.btc
const res  = await fetch('https://api.bnrp.name/v1/resolve/satoshi.btc');
const data = await res.json();

// data.addresses.btc_taproot  → "bc1p..."
// data.addresses.lnurlp       → "satoshi@getalby.com"
// data.profile.avatar         → "ord:a8b2c1...i0"
B — Reverse resolve (fetch) JavaScript
const res  = await fetch('https://api.bnrp.name/v1/reverse/bc1p...');
const data = await res.json();

// data.name → "satoshi.btc"
C — BNRP SDK JavaScript / TypeScript
import { resolve, reverse } from '@btc-native/bnrp';

const { addresses, profile } = await resolve('satoshi.btc');
const { name }              = await reverse('bc1p...');

API Reference

8 endpoints. No authentication. All responses are JSON.

Base URL https://api.bnrp.name
GET
/v1/resolve/{name}
Full name resolution. Returns addresses, profile, avatar, Lightning, and agent fields.
Example request
GET https://api.bnrp.name/v1/resolve/satoshi.btc
Example response
{
  "name":           "satoshi.btc",
  "owner":          "bc1p...",
  "inscription_id": "a8b2c1...i0",
  "addresses": {
    "btc_taproot":  "bc1p...",
    "btc_segwit":   null,
    "btc_p2sh":     null,
    "btc_legacy":   null,
    "eth":           null,
    "sol":           null,
    "spark":         null,
    "agent_address": null,
    "lnurlp":        "satoshi@getalby.com",
    "nostr_pubkey":  "npub1...",
    "did":           "did:btc:satoshi.btc"
  },
  "profile": {
    "display":             "Satoshi",
    "description":         "Bitcoin pioneer",
    "avatar":              "ord:a8b2c1...i0",
    "url":                 "https://satoshi.org",
    "com.twitter":         "satoshi",
    "com.github":          "satoshi",
    "com.nostr":           "npub1...",
    "com.telegram":        "satoshi",
    "com.discord":         "satoshi#1234",
    "com.farcaster":       "satoshi",
    "agent_instructions":  null,
    "payment_policy":      null
  },
  "messaging":  null,
  "via":         "bnrp-inscription",
  "resolved_at": "2026-05-16T21:00:00.000Z"
}
GET
/v1/reverse/{address}
Reverse resolve a Bitcoin address to its primary .btc name. Anti-spoofing verified — forward resolution must confirm the address before the name is returned.
Example request
GET https://api.bnrp.name/v1/reverse/bc1p...
Example response
{
  "name":         "satoshi.btc",
  "verified":     true,
  "resolved_at":  "2026-05-16T21:00:00.000Z"
}
POST
/v1/batch
Batch resolve up to 50 names in a single request. Ideal for address books, leaderboards, or any list of names.
Request body
POST https://api.bnrp.name/v1/batch
Content-Type: application/json

{
  "names": ["satoshi.btc", "ordinals.btc", "bitmap.sats"]
}
Example response
{
  "results": [
    { "name": "satoshi.btc",  "addresses": { ... }, "profile": { ... } },
    { "name": "ordinals.btc", "addresses": { ... }, "profile": { ... } },
    { "name": "bitmap.sats",  "error": "not_found" }
  ]
}
GET
/v1/skill/{name}
Machine-readable agent skill file for AI consumption. Returns the capability declarations and payment policy for agent names (BNRP-IP-11).
Example request
GET https://api.bnrp.name/v1/skill/agent.company.btc
Example response
{
  "name":           "agent.company.btc",
  "pubkey":         "npub1...",
  "capabilities":   ["payments", "signing"],
  "payment_address": "bc1p...",
  "instructions":  "You are a payment agent for Company X...",
  "payment_policy": { "max_sat": 100000, "require_approval": true }
}
GET
/.well-known/lnurlp/{name}
LNURL-pay endpoint (LUD-16). Returns a payRequest JSON that any LNURL-pay compatible wallet can use to pay a .btc name directly over Lightning.
Example request
GET https://api.bnrp.name/.well-known/lnurlp/satoshi
Example response
{
  "tag":             "payRequest",
  "callback":        "https://api.bnrp.name/v1/lnurlp/satoshi/callback",
  "minSendable":     1000,
  "maxSendable":     100000000000,
  "metadata":        "[[\"text/plain\",\"Pay satoshi.btc\"]]",
  "commentAllowed":  255
}
GET
/v1/lnurlp/{name}/callback
LNURL-pay callback. Pass the amount in millisats via the ?amount= query parameter. Returns a BOLT11 invoice.
Example request
GET https://api.bnrp.name/v1/lnurlp/satoshi/callback?amount=21000
Example response
{
  "pr":     "lnbc210n1...",
  "routes": []
}
POST
/v1/siwb/challenge
Sign in with Bitcoin (BNRP-IP-10). Creates a PSBT challenge for the wallet to sign. Returns a message string and nonce.
Request body
POST https://api.bnrp.name/v1/siwb/challenge
Content-Type: application/json

{
  "domain":   "yourapp.com",
  "address":  "bc1p...",
  "btcName":  "satoshi.btc",
  "uri":      "https://yourapp.com/login"
}
Example response
{
  "message": "yourapp.com wants you to sign in with Bitcoin\n\nURI: https://yourapp.com/login\nNonce: a3f8b2...\nIssued At: 2026-05-16T21:00:00.000Z",
  "nonce":   "a3f8b2..."
}
POST
/v1/siwb/verify
Verify a SIWB signature. Pass the signed message, signature, address, and btcName. Returns verified status and the resolved identity.
Request body
POST https://api.bnrp.name/v1/siwb/verify
Content-Type: application/json

{
  "message":   "yourapp.com wants you to sign in...",
  "signature": "H9f2k...",
  "address":   "bc1p...",
  "btcName":   "satoshi.btc"
}
Example response
{
  "verified":  true,
  "name":      "satoshi.btc",
  "address":   "bc1p...",
  "profile":   { "display": "Satoshi", "avatar": "ord:..." }
}

Protocol Extensions

Five improvement proposals extending the core resolve schema. Each is a live spec with an open API endpoint and a demo page on btcnative.name.

SDK Reference

Official packages and helpers. The core SDK wraps all 8 endpoints with full TypeScript types.

Core SDK npm

Wraps all 8 REST endpoints with TypeScript types, caching, and error handling. Works in Node.js, browsers, and edge runtimes.

npm install @btc-native/bnrp
npm: @btc-native/bnrp
MetaMask Snap v1.0.1

Bring .btc name resolution into MetaMask. Lets users resolve names and sign SIWB challenges from the MetaMask extension.

npm install @btc-native/bnrp-snap
@btc-native/bnrp-snap v1.0.1
SIWB helpers

Server-side helpers to create challenges and verify wallet signatures. Drop into any Node.js or edge function.

import { createChallenge, verifySignature }
  from '@btc-native/bnrp/siwb';
CDN / browser

Load the SIWB helper from CDN and use it as window.SIWB in any plain HTML project, no bundler required.

<script src="https://btcnative.name/siwb.js"></script>
// window.SIWB.createChallenge(...)
// window.SIWB.verifySignature(...)