A bunker link to use the custodied key in another app
POST /v1/auth/npub/bunker- quién puede llamarla
- Una sesión
- la sesión de una cuenta · con un segundo factor
- cuán reciente
- Nunca en caché
- cada respuesta lleva la altura del índice y la del nodo
- Herramienta MCP
- Ninguna
En esta página
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.
Parámetros
| Nombre | Dónde | Tipo | Obligatorio | Qué hace |
|---|---|---|---|---|
name | cuerpo | string | opcional | What the account calls the app, at most 80 characters. It shows in GET /v1/auth/npub/clients. |
perms | cuerpo | array | opcional | 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. |
El cuerpo es application/json, y puede omitirse.
esquema
namestring — What the account calls the app, at most 80 characters. It shows inGET /v1/auth/npub/clients. · como mucho 80 caracterespermsarray de string — What the app may ask the signer for:sign_event:<kind>,sign_eventfor every kind,nip44_encrypt,nip44_decrypt,nip04_encrypt,nip04_decrypt. The signer's defaults when left out.
Qué responde
201 · application/json
The link; the QR payload is bunker_url.
| Campo | Tipo | Qué lleva |
|---|---|---|
bunker_url | string | 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 | The custodied key's public key, 64 hex: the signer the app talks to. |
npub | string | That key as an npub. |
relay | string | The relay the app and the signer talk through. |
perms | array | What the app may ask for, sorted: the defaults when none were sent. |
expires_at | string | When the link lapses unless an app connects with it: ten minutes from now. |
esquema
bunker_urlstring obligatorio — 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.pubkeystring obligatorio — The custodied key's public key, 64 hex: the signer the app talks to.npubstring obligatorio — That key as an npub.relaystring obligatorio — The relay the app and the signer talk through.permsarray de string obligatorio — What the app may ask for, sorted: the defaults when none were sent.expires_atstring (date-time) obligatorio — When the link lapses unless an app connects with it: ten minutes from now.
Errores
| Estado | Código | Cuándo |
|---|---|---|
| 400 | invalid_input | Malformed input (invalid_input). |
| 401 | unauthorized | unauthorized: 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. |
| 403 | forbidden | forbidden: 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. |
| 404 | not_found | not_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. |
| 409 | conflict | conflict: 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. |
| 501 | not_configured | not_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. |
| 503 | signing_off, unavailable | signing_off: the custodied signer is switched off (SIGNING_ENABLED), keys stay encrypted and exportable later; or unavailable: the signer service is not answering. |
Cada uno llega en el sobre de error único, y ninguno se guarda en caché: un error lleva Cache-Control: no-store.
Ejemplo
Sin fragmento. Esta ruta pide una sesión iniciada (la cookie que pone btcintel.io) o una firma NIP-98 de tu firmante Nostr, nunca una clave, así que ningún fragmento puede ejecutarla desde una shell. Ver Identidad.