{"uid":"cap_kExqqjj1kHQnDTZFEZqRC","slug":"nostr-event-signing-preimage-generator-54103974","name":"Nostr Event Signing & Preimage Generator","description":"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.","url":"https://nostr.halowerk.com/event-sign","method":"POST","headers":{},"bodySchema":{"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."}}},"responseSchema":null,"example":null,"exampleRequest":null,"tags":["x402"],"displayCostAmount":"0.001","displayCostAsset":"USDC","priceDynamic":false,"priceHint":null,"priceStatus":"priced","priceSource":"probe","requiresHandshake":false,"reviewCount":0,"rating":{"score":"0.00","successRate":"0.00","reviews":0,"stars":null,"state":"unrated"},"availabilityStatus":"unknown","priceObserved":null,"sessionDeposit":null,"pricing":{"kind":"static","summary":"$0.001/call","primary":{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"},"accepted":[{"kind":"static","protocol":"x402","network":"base","amountUsd":"0.001","per":"call","confidence":"exact"}]},"paymentMethods":[{"uid":"pm_CmRrzN47fCXLbBnE9lKBN","protocol":"x402","methodType":"crypto","chain":"base","mode":"charge","costAmount":"0.001","costPer":"request","priority":0,"asset":"0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913","unit":"request","depositMicros":null,"planRef":null}],"brandName":null,"brandSlug":null,"brandBaseUrl":null,"brandDocsUrl":null,"whatItDoes":"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.","exampleAgentPrompt":"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.","exampleUseCases":[{"title":"Offline signing for a Nostr client","prompt":"I want to publish a Nostr text note from my public key npub1xyz... with content 'Just shipped my new app!' and the current timestamp — give me the serialised event and the exact bytes I need to sign so I can sign it locally with my hardware wallet."},{"title":"Build a Nostr kind 4 encrypted DM","prompt":"Construct a Nostr kind 4 direct message event for my pubkey npub1abc... targeting pubkey npub1def..., with the encrypted content already prepared — I need the NIP-01 serialisation and SHA-256 event ID so I can sign it myself."},{"title":"Verify event ID before broadcasting","prompt":"I've assembled a Nostr kind 0 metadata event with my public key npub1ghi... and profile JSON — compute the canonical NIP-01 serialisation and SHA-256 event ID so I can verify it matches what my client produced before I sign and publish."}],"resultDescription":"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.","failureModes":["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"],"whenToPreferThis":"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.","instructions":null,"reviewSummary":null,"reviewSummaryHighlights":null,"reviewSummaryConcerns":null,"reviewSummaryGeneratedAt":null,"activationCount":0,"lastUsedAt":null,"lastSuccessfullyRanAt":null,"lastHealthCheckAt":"2026-09-15T06:40:16.277Z","isFirstParty":false}