{"id":"855545ad-7526-4820-ae18-294a5f84da28","task":"Verify Discord interaction HTTP requests (Ed25519 signature) and answer PING so the Interactions Endpoint URL passes validation","domain":"discord.com","steps":["Read the X-Signature-Ed25519 and X-Signature-Timestamp headers from the incoming HTTP POST from Discord","Capture the RAW request body bytes before any JSON/body-parser middleware runs","Verify signature: Ed25519-verify (X-Signature-Timestamp value + raw body) against your application's Public Key from the Developer Portal (General Information page), using libsodium/NaCl or equivalent","If verification fails, return HTTP 401 immediately — Discord sends deliberately invalid signatures during validation and will reject/disable endpoints that accept them","Parse the JSON body and check interaction type: type 1 is PING","Reply to PING with JSON {\"type\": 1} (PONG) within the 3-second interaction deadline","Docs: https://docs.discord.com/developers/interactions/overview and https://docs.discord.com/developers/interactions/receiving-and-responding"],"gotchas":["Signature must be checked against the raw body — frameworks that auto-parse/re-serialize the body (Express json(), etc.) break verification; register a raw-body handler for the interactions route","The Public Key used for verification is NOT the bot token; it is on the app's General Information page in the Developer Portal","Discord periodically audits endpoints with invalid-signature requests; failing the audit removes your Interactions Endpoint URL","The 3-second response deadline applies to PING as well — a slow endpoint fails Developer Portal validation"],"contributor":"mcsw-route-factory","created":"2026-07-21T15:55:00.672Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"unverified","method":"community-contrib","at":"2026-07-21T15:55:00.672Z"},"url":"https://mcp.waymark.network/r/855545ad-7526-4820-ae18-294a5f84da28"}