Jagaro signs callbacks with the operator webhook secret. Obtain the secret through your agreed protected channel and keep it on your server. Never place it in an iframe, browser code or log. HTTP header names are case-insensitive.
Headers
| Header | Value |
|---|---|
X-REQUEST-SIGNATURE | Lowercase hexadecimal HMAC-SHA256 of the exact compact JSON body bytes. |
X-REQUEST-TIMESTAMP | Sender timestamp in Unix milliseconds, as a decimal string. |
X-REQUEST-NONCE | Fresh 16-byte random nonce encoded as 32 hexadecimal characters. |
X-REQUEST-SIGNATURE-V2 | Lowercase hexadecimal HMAC-SHA256 of canonical body, timestamp and nonce. |
X-REQUEST-ID | Identifier of this HTTP attempt; use for diagnostics, not financial idempotency. |
The legacy signature remains available alongside the additive V2 headers. The name is X-REQUEST-SIGNATURE, not X-REQUEST-SIGN. Signatures cover the request, not the response.
Legacy verification
expected = HMAC_SHA256_HEX(secret, rawRequestBody)
Capture the raw UTF-8 body before your framework parses it. Do not sort keys, add whitespace or parse and re-serialize it for legacy verification. Compare digests in constant time after validating that the received digest has exactly 64 hexadecimal characters. Reject invalid signatures without a wallet effect.
V2 verification and replay protection
message = canonicalize(parsedBody) + "." + timestampHeader + "." + nonceHeader
expected = HMAC_SHA256_HEX(secret, message)
Canonicalisation recursively sorts object keys using JavaScript key ordering and serialises compact JSON; array order stays unchanged. This is the Jagaro algorithm, not a claim of RFC 8785 compliance. A JavaScript reference implementation is:
function sortKeysDeep(value) {
if (Array.isArray(value)) return value.map(sortKeysDeep);
if (value !== null && typeof value === "object") {
return Object.keys(value).sort().reduce((out, key) => {
out[key] = sortKeysDeep(value[key]);
return out;
}, {});
}
return value;
}
const canonicalize = value => JSON.stringify(sortKeysDeep(value));
Verify the signature and enforce your agreed timestamp tolerance and an atomic nonce cache. The cache must be scoped to the operator and cover the accepted timestamp window across all wallet instances. Keep clocks synchronised. Require V2 consistently once adopted; do not silently fall back to legacy verification when a V2 check fails.
V2 replay protection does not replace financial idempotency: a legitimate retry has fresh signing headers but the same financial transactionId. Never use the signature, nonce or X-REQUEST-ID as the transaction key.
Public test vector
All values below are invalid public fixtures. The timestamp is intentionally old; use it only for an offline HMAC test, not a live freshness check. The raw body is one line with no trailing newline.
{"action":"init","authToken":"INVALID_EXAMPLE_TOKEN","data":{"operatorId":"INVALID_EXAMPLE_OPERATOR","currency":"USD","game":"lucky-chicken"}}
secret: PUBLIC_TEST_SECRET_DO_NOT_USE
timestamp: 1700000000000
nonce: 00000000000000000000000000000000
legacy: 777353c3277f955473577061c795a53a7b4b9c22e7778979a7cb2606952e21fd
v2: 880b91e4e031aae125f6c1186bedf904a3f04ccefd1142a02b1d3ff2ed3c084b