Safeheron API

Why do we need Safeheron API?

Safeheron API is used to integrate Safeheron MPC-TEE technologies into multiple applications/platforms.

For functionality, with Safeheron API you can enjoy almost all the core functions, such as managing wallets, creating transactions and retrieving transactions. Additionally, you can automate your transaction approval, signing and other functions with API Co-Signer.

For application scenarios, not only creating transactions, but the API also enables contract interactions with such as DeFi, DEX, GameFi, contract owner and token mint permission management, data signature for all kinds of Web3 scenarios, and other business scenarios.

What Safeheron API can do?

Create API Account

A member with Manage API permission logs into Safeheron Web Console, and then navigates to Settings -> API to create an API account (which is also called API Key).

Create API Key

Once the API account is created, you can access Safeheron API with the API Key.

  1. Generate the RSA private key via OpenSSL (api_private.pem is your API RSA private key):

openssl genpkey -out api_private.pem -algorithm RSA -pkeyopt rsa_keygen_bits:4096

  1. Generate corresponding public key to your RSA private key via OpenSSL (api_public.pem is your API RSA public key):

openssl rsa -in api_private.pem -out api_public.pem -pubout

  1. Visit Safeheron Web Console, go to Settings -> API and then click Create API Key.

How to Import RSA Key

1. Copy + Paste it but without its header as below:

2. Upload the RSA Key file. The system will automatically remove its header.

IP Whitelist

When calling the API, you need to whitelist the public IP address of the host which initiates the API call, or Safeheron will reject the API requests.

Similarly, when utilizing the API Co-Signer, you need to whitelist the public IP address of the host housing the API Co-Signer.

API SDK

We provide the API SDK in the following languages:

How to Ensure Safeheron API Security?

To guarantee the security of our API:

  • Permissions for API accounts: You can assign different permissions to different API accounts. When creating the API account, please remember that always give minimal permissions.

  • Restricted Access: Only members with Manage API permission can set up or change API, and any modifications shall be approved by your team to take effect.

  • IP Whitelisting, Data Encryption & Signing Scheme: IP whitelisting with CDN provider makes sure IP addresses cannot be forged as the source is always safe. During data transmission, all the data cannot be hijacked and tampered with under the safeguard of data encryption and signing scheme, all the data is handled securely.

  • Policy: You can set certain policies for the API account, governing how to approve transactions created by the API account.

To have trusted reliable security is a joint work by Safeheron and you. Please keep all your API account-related data safe, such as your API Key, your public and private key pair, and your Safeheron public key.

Last updated