Create Server Wallet
curl --request POST \
--url https://api.tide.ag/api/wallets \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"userId": "user_123"
}
'import requests
url = "https://api.tide.ag/api/wallets"
payload = { "userId": "user_123" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({userId: 'user_123'})
};
fetch('https://api.tide.ag/api/wallets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tide.ag/api/wallets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => 'user_123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tide.ag/api/wallets"
payload := strings.NewReader("{\n \"userId\": \"user_123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tide.ag/api/wallets")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"user_123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tide.ag/api/wallets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"user_123\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"userId": "<string>",
"address": "<string>",
"walletId": "<string>",
"publicKey": "<string>"
}{
"error": "Missing userId"
}{
"error": "Failed to create wallet"
}Account
Create Server Wallet
Create a new MPC-secured server wallet for a user
POST
/
api
/
wallets
Create Server Wallet
curl --request POST \
--url https://api.tide.ag/api/wallets \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"userId": "user_123"
}
'import requests
url = "https://api.tide.ag/api/wallets"
payload = { "userId": "user_123" }
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({userId: 'user_123'})
};
fetch('https://api.tide.ag/api/wallets', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.tide.ag/api/wallets",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'userId' => 'user_123'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.tide.ag/api/wallets"
payload := strings.NewReader("{\n \"userId\": \"user_123\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.tide.ag/api/wallets")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"userId\": \"user_123\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.tide.ag/api/wallets")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"userId\": \"user_123\"\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"userId": "<string>",
"address": "<string>",
"walletId": "<string>",
"publicKey": "<string>"
}{
"error": "Missing userId"
}{
"error": "Failed to create wallet"
}Server Wallet Management
Create and manage server-side wallets secured with MPC (Multi-Party Computation) key management through Dynamic Labs. These wallets are used for all trading operations across supported exchanges.Create Wallet
Create a new server wallet for a user. The wallet is secured with a 2-of-2 MPC threshold scheme.Endpoint
POST /api/wallets
Request Body
{
"userId": "user_123"
}
| Field | Type | Required | Description |
|---|---|---|---|
userId | string | Yes | Unique identifier for the user |
Response
{
"success": true,
"userId": "user_123",
"address": "0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7",
"walletId": "29dd4dc0-1ff9-4df6-a19f-936f997cbc5a",
"publicKey": "04090ce18936a64a24c48624d5734edf96d33a5f3d79bb014f27ebfa2197a813cfc46009ac278f4de56afc3e48733d1adf1a6cf804e6b20ddf55a9f5d4f651104a"
}
Response Fields
| Field | Type | Description |
|---|---|---|
success | boolean | Operation status |
userId | string | User identifier (used for wallet lookup) |
address | string | Wallet address (0x…) - needed for deposits & transactions |
walletId | string | Wallet UUID - needed for API registration & signing |
publicKey | string | Public key for verification |
Example Request
curl -X POST https://api.tide.ag/api/wallets \
-H "Content-Type: application/json" \
-d '{"userId":"user_123"}'
const response = await axios.post('https://api.tide.ag/api/wallets', {
userId: 'user_123'
});
Get Wallet
Retrieve wallet information by userId, walletId, or wallet address.Endpoint
GET /api/wallets/:walletIdOrAddress
Path Parameters
| Parameter | Type | Description |
|---|---|---|
walletIdOrAddress | string | Can be userId, walletId (UUID), or address (0x…) |
Example Requests
# By userId
curl https://api.tide.ag/api/wallets/user_123
# By walletId
curl https://api.tide.ag/api/wallets/29dd4dc0-1ff9-4df6-a19f-936f997cbc5a
# By address
curl https://api.tide.ag/api/wallets/0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7
Response
{
"success": true,
"userId": "user_123",
"address": "0x173404aAAa4d6539e2C7dbcC1931Cf41b3A3D5c7",
"walletId": "29dd4dc0-1ff9-4df6-a19f-936f997cbc5a",
"publicKey": "04090ce18936a64a24c48624d5734edf96d33a5f3d79bb014f27ebfa2197a813cfc46009ac278f4de56afc3e48733d1adf1a6cf804e6b20ddf55a9f5d4f651104a"
}
Error Responses
400 Bad Request{
"error": "Missing wallet identifier"
}
{
"error": "Wallet not found"
}
Sign Message
Sign an arbitrary message using the server wallet’s MPC-managed key shares.Endpoint
POST /api/wallets/:walletIdOrAddress/sign
Path Parameters
| Parameter | Type | Description |
|---|---|---|
walletIdOrAddress | string | Can be userId, walletId (UUID), or address (0x…) |
Request Body
{
"message": "Hello, World!"
}
| Field | Type | Required | Description |
|---|---|---|---|
message | string | Yes | Message to sign |
Response
{
"success": true,
"signature": "0x5522633926941ce275ded2f02dec36b5c09532f0047542cbec35731338739403382ab7c700f01760238152ce9f594fe522ef79a86075a936f4e89a1f9baaa3f61c",
"message": "Hello, World!"
}
Example Request
curl -X POST https://api.tide.ag/api/wallets/user_123/sign \
-H "Content-Type: application/json" \
-d '{"message":"Hello, World!"}'
const response = await axios.post(
'https://api.tide.ag/api/wallets/user_123/sign',
{ message: 'Hello, World!' }
);
Error Responses
400 Bad Request{
"error": "Missing message"
}
{
"error": "Wallet not found"
}
{
"error": "Failed to sign message"
}
Security Features
- MPC Key Management: Wallets use 2-of-2 threshold signature scheme
- Encrypted Storage: Private key shares are encrypted at rest
- No Single Point of Failure: Key shares are distributed across multiple parties
- Secure Signing: All signing operations use MPC protocol
Use Cases
- Create wallets for new users joining the platform
- Retrieve wallet information for trading operations
- Sign messages for exchange API registration
- Sign transactions for deposits and withdrawals
Server wallets are managed by the platform. Never expose wallet credentials or private key shares to clients.
Store the
walletId and address returned from wallet creation. You’ll need these for all subsequent trading operations.Environment Configuration
Required environment variables:DYNAMIC_AUTH_TOKEN=<your_dynamic_auth_token>
DYNAMIC_ENV_ID=<your_dynamic_environment_id>
WALLET_PASSWORD=<secure_password>
Authorizations
Body
application/json
Unique identifier for the user
Example:
"user_123"