API Interface
Overview
Domain and API Key
Production Environment Domain (https://openapi.chainup.com/) | Not applicable to the testing environment |
---|---|
app_id: | Obtain after creating a wallet |
rsa_wallet_pub: | Custody system public key; Obtain from Custody system after creating a wallet |
rsa_third_prv: | Client private key; Generated and saved independently |
rsa_third_pub: | Client public key; Generated independently; Configure in Custody system after creating a wallet |
rsa_co_signer_pri: | Co-Signer private key; Generated using Co-Signer or generated and saved independently |
rsa_co_signer_pub: | Co-Signer public key; Generated using Co-Signer or generated independently; Configure in Custody system after creating a wallet |
RSA Public-Private Key Format
Password Length: 2048
Key Format: PKCS#8
openssl genrsa -out rsa_private_key.pem 2048
openssl rsa -in rsa_private_key.pem -pubout -out rsa_public_key_2048.pem
openssl pkcs8 -topk8 -inform PEM -in rsa_private_key.pem -outform pem -nocrypt -out private_pkcs8.pem
Noted:rsa_public_key_2048.pem
is public key file,private_pkcs8.pem
is private key file.
Interface Rules
Transmission Method: | https (temporary use of http in the testing environment) |
---|---|
Response Status Code: | 0 indicates processing success , non-0 indicates request error or system exception |
Request Address: | Domain + Interface Address |
Encryption Algorithm: | RSA |
Common Request Parameters
Param | Type | Required | Description |
---|---|---|---|
app_id | String | Required | Merchant unique identifier |
data | String | Optional | Data in JSON format Encrypted string; encrypted with the Client’s RSA private key, specific encryption information is described in the Request Parameter Data Structure of each interface |
curl -X GET \
--url 'https://openapi.chainup.com/api/mpc/wallet/open_coin?app_id=16a9f17fc2ad61ca4339fdd6a8a37f21&data=SWYYr-LBVAmaS0eq8n-CUT_nHkM3OBxyWOsImMTe41UaqAoYI2ZghmaphXHov-7hsRsVmOhyPqC-JFuRGvonJKFd2Jirxv6Vn_8V40r_MMYTkhqcviQbZWYW5xX8Ai8CIpqas9fIWVDIYA_NKBl0UCJpwGxscxLNpjq5Z8-BTyIYDsVBquM9zEQGBCfcA7szD9n2fN_loSkoexlwqV8wg9HIZO5yQ6utZ_Kt0lNDQQb8zn8BwfAvsEsbJlOINUAqhxh1vV_AJ4bXn2uYx8TaYcBht-n_ZcBdxIDt975dbOFUiH-oCzIuDi1oLDtb4EylfCvhU5E4ozel_lQ-6cyIG0Dqiiyx0RFFOCJzPSXIoV031pvoa8pTCpkWklh8mRw1rylBgeZtqSxpnJO2_u2RIlXq6Hs8Yly9CmhIXaSrUgPir0h6xVxlf4VC6PFVCkiiTlp0kZ_H_UbKm0nUis3v3U2sflWJ2C449waSrikhuxVrFAQ6PQmrFVCAE6MYXNrFXJQuam2HAIQNSGbFQjspw8b_bXyfyZMGZ3K2oBC4I_v3eETTdPe0pfSNJb-5g37K0tOAr_UFbWK8pkC8yl56fSjn8tcR3yCRWwoi8jxTcUBiswTtvXZtzgG4dyzkaHXjsZjSGiywXSqP76VZWlyOmAx6IDSViLcPLPISdU3ruCI'
Common Response Parameters
Param | Type | Required | Description |
---|---|---|---|
data | String | Required | Data in JSON format Encrypted string; encrypted with Custody’s RSA private key, specific encryption information is described in the Response Result Data Decryption Format |
{
"data": "ItMK-uGEuHC-d8RsrEM-LxKZzy-osF5JMsBAjioLTzU-YnACZm_ryS7ilW8MMpjBWpxx_DYE5T5w9G8pAy-X-Fxb8mJafpdRLDLi0U2i2tjDGWgaVd0bmmb2-1meSuyS-ggdsN2R9rZtK6SSbBlTG32I4fMhL0WrppREfnRF7IdzRYVveA1j0ZYKHYGZbu_aT4lft9KxJqTJfFyxAvV96iQ-WcWNe4aygyTueSM_HbRrvaozakCytpJi2R8jnHDyV_Y7KiF6Ucd_kV9eqvqlwGHyxPUJIrvtOhXF3No7flrvrEnLLjSxpiHPVgJwkIqPzG8ICB4ilVpJnKmqxZsJJw"
}
Decrypted Response Parameters
The original JSON data
parameter results format is as follows:
Param | Type | Required | Description |
---|---|---|---|
code | String | Yes | Status code, e.g., 100002 |
msg | String | Yes | Explanation of the response result, e.g., Request parameter error |
data | String | No | Specific response data; data structure defined in the Response Parameter Data Structure of each interface |
Encryption and Decryption Mode
The values of the request parameter data and the response field data are both encrypted with RSA and then encrypted with base64urlsafe.
In traditional base64 encoding, there are two symbols, + and /, which will be directly escaped by the URL. Therefore, if you want to transmit these encoded strings via URL, you need to do traditional base64 encoding first, and then replace + and / with - _ respectively. On the receiving end, do the opposite decoding action.
RSA encryption and decryption use segmented encryption
.
Was this page helpful?