# Nostr Event Signing & Preimage Generator

> Nostr Event Signing & Preimage Generator is a paid API for AI agents from nostr.halowerk.com, paid per call via x402, $0.001/call, status unknown (last checked 2026-09-15).

Generates the NIP-01 serialisation, SHA-256 event ID, and 32-byte signing payload for a Nostr event so the caller can sign locally without exposing their private key.

## Facts

- Endpoint: POST https://nostr.halowerk.com/event-sign
- Price: $0.001/call
- Payment: x402
- Status: unknown
- Last checked: 2026-09-15
- Activations on Zero: 0
- Tags: x402
- Canonical page: https://www.zero.xyz/c/nostr-event-signing-preimage-generator-54103974
- Structured record (JSON): https://api.zero.xyz/v1/capabilities/cap_kExqqjj1kHQnDTZFEZqRC

Status and success rate cover calls made through Zero and Zero's own probes. Third-party monitors may report differently.

## How to call it through Zero

Zero handles the 402 payment challenge and records the run. With the Zero CLI installed (`npm i -g @zeroxyz/cli`):

```sh
zero fetch --capability nostr-event-signing-preimage-generator-54103974 -d '<json body>'
```

Example prompt: Prepare a Nostr kind 1 note with my public key npub1abc123... and content 'Hello Nostr!' — give me the NIP-01 serialisation, the event ID, and the 32 bytes I need to sign locally so my private key never leaves my device.

## When to prefer this

Choose this endpoint when you need to construct and ID a Nostr event server-side while keeping the private key strictly local — ideal for hardware wallets, browser extensions, or any architecture where the signing secret must never leave the device. Prefer it over full signing endpoints when auditability of the preimage is important.

## Known failure modes

- Invalid or malformed public key format returns a 4xx validation error
- Missing required event fields (kind, content, created_at) causes a 400 bad request
- Malformed tags array structure triggers serialisation failure
- Network timeout on the x402 payment flow before the computation completes

## How this service works

Three modes over the same event structure. In preimage mode the caller supplies a public key and the event fields; the answer holds the exact NIP-01 serialisation, the SHA-256 event id derived from it and the 32 bytes to sign, so the caller signs locally and no secret key ever crosses the connection.

## Output

Returns the exact NIP-01 JSON serialisation string used as input to SHA-256, the computed 64-character hex event ID, and the 32 raw bytes the caller must sign with their private key — no private key is required server-side.

## Request schema (JSON Schema)

```json
{
 "type": "object",
 "properties": {
  "kind": {
   "type": "integer",
   "default": 1,
   "maximum": 65535,
   "minimum": 0,
   "description": "NIP-01 event kind. 1 is a text note, 30023 a long-form article."
  },
  "mode": {
   "enum": [
    "preimage",
    "ephemeral",
    "verify"
   ],
   "type": "string",
   "default": "preimage",
   "description": "preimage: caller signs locally. ephemeral: single-use key generated here. verify: check a complete event."
  },
  "tags": {
   "type": "array",
   "items": {
    "type": "array",
    "items": {
     "type": "string"
    }
   },
   "maxItems": 200,
   "description": "NIP-01 tags, each an array of strings, for example [\"t\",\"bitcoin\"]."
  },
  "event": {
   "type": "object",
   "description": "The complete event to check. Only used in verify mode."
  },
  "pubkey": {
   "type": "string",
   "description": "Public key as hex or npub. Required in preimage mode, ignored otherwise."
  },
  "content": {
   "type": "string",
   "default": "",
   "maxLength": 64000,
   "description": "Event content."
  },
  "created_at": {
   "type": "integer",
   "minimum": 0,
   "description": "Unix seconds. Left out, the current time is used."
  }
 }
}
```

## More

- Live health (JSON, refreshed every minute): https://www.zero.xyz/c/nostr-event-signing-preimage-generator-54103974/health.json
- [Zero catalog index](https://www.zero.xyz/llms.txt)
- [Other services from nostr.halowerk.com](https://www.zero.xyz/host/nostr.halowerk.com/llms.txt)
