btcintel

A bunker link to use the custodied key in another app

POST /v1/auth/npub/bunker
who may call it
A session
the session of an account · with a second factor
what it costs
1 request of the quota
tiers and keys
how fresh
Never cached
every answer carries the index's height and the node's
MCP tool
None
On this page

Needs aal 2. A one-time link, bunker://<pubkey>?relay=wss://relay.btcintel.io&secret=…, valid ten minutes, that Primal, Amethyst, Amber, nsec.app or any NIP-46 client connects with; the explorer shows it as a QR. name is what the account calls the app; perms are what the app may ask the signer for: sign_event:<kind> per kind, sign_event for every kind, nip44_encrypt, nip44_decrypt, nip04_encrypt, nip04_decrypt; the default is signing the Community kinds (0, 1, 1111, 1985, 5). One open link per key: a new one replaces the last. 409 when the account's key is its own; 501 when the signer runs without a relay; 503 signing_off while features.signing is false.

Parameters

NameWhereTypeRequiredWhat it does
namebodystringoptionalWhat the account calls the app, at most 80 characters. It shows in GET /v1/auth/npub/clients.
permsbodyarrayoptionalWhat the app may ask the signer for: sign_event:<kind>, sign_event for every kind, nip44_encrypt, nip44_decrypt, nip04_encrypt, nip04_decrypt. The signer's defaults when left out.

The body is application/json, and may be left out.

schema
  • name string — What the account calls the app, at most 80 characters. It shows in GET /v1/auth/npub/clients. · at most 80 characters
  • perms array of string — What the app may ask the signer for: sign_event:<kind>, sign_event for every kind, nip44_encrypt, nip44_decrypt, nip04_encrypt, nip04_decrypt. The signer's defaults when left out.

What it answers

201 · application/json

The link; the QR payload is bunker_url.

FieldTypeWhat it carries
bunker_urlstringThe one-time link the app connects with: bunker://, the key's pubkey, the relay and a secret. It is the QR's payload too.
pubkeystringThe custodied key's public key, 64 hex: the signer the app talks to.
npubstringThat key as an npub.
relaystringThe relay the app and the signer talk through.
permsarrayWhat the app may ask for, sorted: the defaults when none were sent.
expires_atstringWhen the link lapses unless an app connects with it: ten minutes from now.
schema
  • bunker_url string required — The one-time link the app connects with: bunker://, the key's pubkey, the relay and a secret. It is the QR's payload too.
  • pubkey string required — The custodied key's public key, 64 hex: the signer the app talks to.
  • npub string required — That key as an npub.
  • relay string required — The relay the app and the signer talk through.
  • perms array of string required — What the app may ask for, sorted: the defaults when none were sent.
  • expires_at string (date-time) required — When the link lapses unless an app connects with it: ten minutes from now.

Errors

StatusCodeWhen
400invalid_inputMalformed input (invalid_input).
401unauthorizedunauthorized: the request does not say who makes it, or what it offers does not verify: no key or session where one is needed, or a password, a code, a passkey or a signed event that does not check. The message says what is missing.
403forbiddenforbidden: the caller is known but may not do this: a key without the scope or the tier the action needs, a session without an npub, a second factor or a recent sign-in, an operator without the role or switched off, or a source that does not allow it. The message says which.
404not_foundnot_found: what the path names is not known: not in the index (for a transaction, not in the node's mempool either), or no such record. The message says which.
409conflictconflict: the state refuses the change, for example a dispute of this caller's already open, a dispute or a claim no longer open, an address that belongs to another account, or a thing done already. The message says which.
501not_configurednot_configured: this deployment does not run what the route needs, for example the mempool engine, accounts, the intel store or watchlists. The message names it.
503signing_off, unavailablesigning_off: the custodied signer is switched off (SIGNING_ENABLED), keys stay encrypted and exportable later; or unavailable: the signer service is not answering.

Each comes in the one error envelope, and none is cached: an error carries Cache-Control: no-store.

Example

No snippet. This route takes a signed-in session (the cookie btcintel.io sets) or a NIP-98 signature from your Nostr signer, never a key, so no snippet can run it from a shell. See Identity.