btcintel

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
qué cuesta
1 petición de la cuota
niveles y claves
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

NombreDóndeTipoObligatorioQué hace
eventcuerpoobjectobligatorioA 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
  • event NostrEvent 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).
    • id string — The event's id, 64 hex: the SHA-256 of its NIP-01 serialisation. POST /v1/auth/npub/sign sets it.
    • pubkey string — 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_at integer obligatorio — Unix seconds.
    • kind integer obligatorio — The event's kind.
    • tags array de array de string obligatorio — The event's tags.
    • content string obligatorio — The event's text.
    • sig string — The author's Schnorr signature of the id, 128 hex. Never on an event sent to be signed.

Qué responde

The signed event.

CampoTipoQué lleva
eventobjectA 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
  • event NostrEvent 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).
    • id string — The event's id, 64 hex: the SHA-256 of its NIP-01 serialisation. POST /v1/auth/npub/sign sets it.
    • pubkey string — 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_at integer obligatorio — Unix seconds.
    • kind integer obligatorio — The event's kind.
    • tags array de array de string obligatorio — The event's tags.
    • content string obligatorio — The event's text.
    • sig string — The author's Schnorr signature of the id, 128 hex. Never on an event sent to be signed.

Errores

EstadoCódigoCuándo
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.
422event_rejectedThe 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).
429quota_exceededquota_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.
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.

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.