Skip to main content
Hash-based message authentication codes (HMAC) provide both data integrity and authenticity: only a holder of the secret key can produce a valid signature, and any change to the message invalidates it. Bitnob API v2 signs every request with HMAC-SHA256, see Authentication for the full scheme.

Generate an HMAC-SHA256 signature

Pick your tool and run it locally. All three produce the same hex-encoded output for the same key and message.

Sign a Bitnob API v2 request

Bitnob’s canonical message is CLIENT_ID:TIMESTAMP:NONCE:PAYLOAD, signed with your client secret:
Sign the exact bytes you send. If your HTTP client re-serializes the JSON body (reorders keys, changes whitespace), the signature will not match: send the same string you signed.

Verify a webhook signature

Bitnob signs webhook deliveries with the x-bitnob-signature header. Recompute the HMAC over the raw request body and compare in constant time:
See Verifying events for the full webhook reference.

Security practices

  • Keep secret keys confidential and server-side.
  • Use strong, random secret keys.
  • Prefer HMAC-SHA256 or stronger over HMAC-SHA1.
  • Compare signatures with a constant-time function, never ==.