Sign an event with the account's custodied key
POST /v1/auth/npub/sign- quién puede llamarla
- Una sesión
- la sesión de una cuenta
- 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 1. The event comes unsigned (pubkey may be left empty; id and sig are set on the way back). It passes the same door as POST /v1/community/publish first (kinds 1111, 1985 and 5; the window; the size; NIP-73 subjects; the proof-of-work floor, mined by the client against the key's pubkey; bans), then the signer signs it within its own limits (30 a minute and 300 an hour per key). The signed event goes back to the caller, who publishes it through POST /v1/community/publish. 404 for an account without a custodied key; 409 when its key is its own; 503 signing_off while features.signing is false.
Parámetros
| Nombre | Dónde | Tipo | Obligatorio | Qué hace |
|---|---|---|---|---|
event | cuerpo | object | obligatorio | A Nostr event as NIP-01 serialises it. Signed on the way out of POST /v1/auth/npub/sign; unsigned on the way in (id and sig absent, pubkey optional). |
El cuerpo es application/json.
esquema
eventNostrEvent obligatorio — A Nostr event as NIP-01 serialises it. Signed on the way out ofPOST /v1/auth/npub/sign; unsigned on the way in (idandsigabsent,pubkeyoptional).idstring — The event's id, 64 hex: the SHA-256 of its NIP-01 serialisation.POST /v1/auth/npub/signsets it.pubkeystring — The author's public key, 64 hex. On an event sent to be signed it may be left out, and must otherwise be the account's custodied key.created_atinteger obligatorio — Unix seconds.kindinteger obligatorio — The event's kind.tagsarray de array de string obligatorio — The event's tags.contentstring obligatorio — The event's text.sigstring — The author's Schnorr signature of the id, 128 hex. Never on an event sent to be signed.
Qué responde
The signed event.
| Campo | Tipo | Qué lleva |
|---|---|---|
event | object | A Nostr event as NIP-01 serialises it. Signed on the way out of POST /v1/auth/npub/sign; unsigned on the way in (id and sig absent, pubkey optional). |
esquema
eventNostrEvent obligatorio — A Nostr event as NIP-01 serialises it. Signed on the way out ofPOST /v1/auth/npub/sign; unsigned on the way in (idandsigabsent,pubkeyoptional).idstring — The event's id, 64 hex: the SHA-256 of its NIP-01 serialisation.POST /v1/auth/npub/signsets it.pubkeystring — The author's public key, 64 hex. On an event sent to be signed it may be left out, and must otherwise be the account's custodied key.created_atinteger obligatorio — Unix seconds.kindinteger obligatorio — The event's kind.tagsarray de array de string obligatorio — The event's tags.contentstring obligatorio — The event's text.sigstring — The author's Schnorr signature of the id, 128 hex. Never on an event sent to be signed.
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. |
| 422 | event_rejected | The event was refused at the door (event_rejected): the message carries the relay's NIP-01 prefix — unbound: (not this caller's key), invalid: (shape, subject, window, size, signature), pow: (below the floor), blocked: (kind, banned, read-only). |
| 429 | quota_exceeded | quota_exceeded: the caller's tier ran out of requests for the minute or the day. Retry-After says when to try again; every rate-limited answer carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset and X-RateLimit-Tier. While the deployment runs in log-only mode the decision is logged instead and X-RateLimit-Policy: log-only is set. |
| 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.