Skip to main content
Turnkey signs Webhooks V2 deliveries with Ed25519. Verify the signature before parsing or trusting the JSON payload. The signature covers the signature contract fields and the exact raw request body:
Verification must use the raw request body that Turnkey sent. Re-serializing parsed JSON, changing whitespace, or changing key order changes the signed input.

Verification keys

@turnkey/crypto verifies against caller-provided verification keys:
Use the webhook signing key ID and public key provided by Turnkey for your environment. The public acquisition path for these values should be confirmed with product before publishing this page broadly. The helper does not discover keys automatically and does not implement JWKS, refresh behavior, discovery endpoints, or server-side key management.

Minimal example

verifyTurnkeyWebhookSignature accepts: Successful verification returns:
Failed verification returns:
Compare reason against the TurnkeyWebhookVerificationFailureReasons constants instead of hardcoding strings.

Runtime examples

Verification failures

Return a non-2xx response when verification fails. Log the failure reason, but avoid logging the raw body unless your logging pipeline is approved for webhook payloads. Common failure reasons include: Signature verification proves the delivery came from a holder of the Turnkey webhook signing key and that the raw body was not modified within your replay window. It does not validate business payload fields such as organizationId, event type, wallet account ownership, or whether the event should affect your internal state. The helper checks required signature headers, timestamp freshness, key matching, signature format, verification-key shape, supported algorithm/version, and the Ed25519 signature itself.