Introduction
This article explains how BisonBlock’s Custodial Wallet service authenticates API clients. BisonBlock API Key authentication requires each request to be signed except public API interfaces. The data needs to be signed as the following:HTTP HOST
- Sandbox: https://sandbox-openapi.bisonblock.ai
- Production: https://openapi.bisonblock.ai
HTTP_METHOD
CapitalizedGET
or POST
. Please note: BisonBlock doesn’t accept form-data payloads in HTTP POST. Please use JSON.
HTTP_REQUEST_PATH
The PATH part of the URL request. For example:/api/v1/wallet/address
in https://openapi.bisonblock.ai/api/v1/wallet/address .
NONCE
The UNIX EPOCH timestamp when calling the API is in milliseconds. For example,1708329586393
.
PAYLOAD
If the POST body is:slip44=60&num=1
in URL request https://openapi.bisonblock.ai/api/v1/wallet/address?slip44=60&num=1
.
After sorting the key with alphabet: num=1
slip44=60
Because ‘n’ is sorted before ‘s’ in the alphabet, ‘num’ should be placed before ‘slip44’ and then connected as follows: num=1&slip44=60
API parameters are key-value string pairs. Parameters need to be normalized before signing. The rule is as follows:
- Sort parameters by keys alphabetically.
- Transform each parameter to a string in the format of
key=value
. - Connect the strings with
&
.
Example
For the following requests:Method | URL | Nonce |
---|---|---|
POST | https://openapi.bisonblock.ai/api/v1/withdrawal/send | 1708331439683 |
- private key:
6d59626f7ffffa64f8a6b36e9fcc9551b54a1dfebb973606d24578adecebfbaf
- public key:
02a3c02e0a220a00102b94c093fbea424c49743d47cefddd4a11c1035c92466445
- BIZ-API-KEY This field contains the API Key, which is the secp256k1 public key’s hex data.
- BIZ-API-SIGNATURE This field contains the signature.
- BIZ-API-NONCE This field contains the nonce.