Our authentication method utilizes HMAC-SHA256 signing with API keys and a passphrase for secure access to zerohash API endpoints. Platforms must authenticate by including their public API key and signed request, along with a passphrase in the request headers.
These credentials are used to generate a signature for each request, ensuring its integrity and authenticity. Requests are then sent with the necessary authentication headers, allowing clients to securely access and interact with the API endpoints.
Request headers
To Authenticate with us, you will need to set the following headers:
| Header | Description |
|---|---|
| X-SCX-API-KEY | Your public key |
| X-SCX-SIGNED | Signature for your request |
| X-SCX-TIMESTAMP | Unix timestamp(number of seconds since the Unix Epoch.) |
| X-SCX-PASSPHRASE | Your passphrase |
Sample headers
"X-SCX-API-KEY": "h2yFu1uijCDEqkbdop4GAF",
"X-SCX-SIGNED": "PFMlg+bMFVjjAiGPLR/zJCStmiiOIeyz5NIOZEmpfH0=",
"X-SCX-TIMESTAMP": 1550175822,
"X-SCX-PASSPHRASE": "passphrase"
Request signing
To sign requests, Zero Hash uses a combination of the request parameters. All parameters that are included in the request signature must be sent in the same order as the request.
-
To build a signature, you need to concatenate the timestamp+method+route+request body values of your request to a string.
-
A request to the GET /accounts.
1714445421GET/accounts?account_owner=00SCXM&account_group=BBLGTW{}- For a
GETrequest, request body should be set to an empty JSON object{}. - Query parameters are included in the route input for the request signature.
- For a
-
A request to the POST /convert_withdraw/execute
1714445704POST/convert_withdraw/execute{'quote_id': 'UUID'}- Request bodies are passed on in the request body input on POST, PATCH and DELETE calls.
-
-
Generate an HMAC digest using your private key (using HMAC SHA-256).
- Private Key =
2mC4ZvVd4goRkuJm+rjr9byUiaUW1b6tVN4xy9QXNSE=
- Private Key =
-
Encode the HMAC digest in Base64.
- Using a private key, you will produce a base64 encoded digest
+p94Yo3z33zvTmoA+BFtzQIW+qJz1X8IZcnuudpX6A8=.
- Using a private key, you will produce a base64 encoded digest
