Verification keys
@turnkey/crypto verifies against caller-provided verification keys:
Minimal example
verifyTurnkeyWebhookSignature accepts:
Successful verification returns:
reason against the TurnkeyWebhookVerificationFailureReasons constants instead of hardcoding strings.
Runtime examples
Next.js App Router
Next.js App Router
Fetch / Workers
Fetch / Workers
Express
Express
Fastify
Fastify
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.