API Reference
Stabletrust API
Private payment infrastructure over HTTP. POST JSON to HTTPS endpoints no SDK or setup required. Designed for AI agents and server-side integrations.
https://stabletrust-api.fairblock.networkQuickstart
Base SepoliaUSDCGet a wallet
You need an EVM wallet and its private key. Create one with MetaMask if you don't have one then go to Account details → Export private key.
Get testnet funds
You need two things before you can transact:
ETH for gas Alchemy Base Sepolia faucet
USDC : Circle faucetmake sure to select Base Sepolia as the network
Open a terminal
Mac press ⌘ Space, type Terminal, press Enter.
Windows press Win+R, type cmd, press Enter. Or search PowerShell in the Start menu.
Check that curl is installed
Paste this and press Enter:
curl --versionIf you see a version number you're set. If not Mac: brew install curl. Windows: download from curl.se.
Export your private key
This sets your key for the current session only it won't be written to disk.
export PRIVATE_KEY=0xYourPrivateKeyHere
# Windows (cmd): set PRIVATE_KEY=0xYourPrivateKeyHere
# Windows (PS): $env:PRIVATE_KEY="0xYourPrivateKeyHere"Check your balance
curl -X POST https://stabletrust-api.fairblock.network/balance \
-H "Content-Type: application/json" \
-d '{"privateKey":"'"$PRIVATE_KEY"'","tokenAddress":"0x036CbD53842c5426634e7929541eC2318f3dCF7e"}'Deposit USDC
Amounts are in base units 1 USDC = 1,000,000. This deposits 1 USDC.
curl -X POST https://stabletrust-api.fairblock.network/deposit \
-H "Content-Type: application/json" \
-d '{"privateKey":"'"$PRIVATE_KEY"'","tokenAddress":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","amount":"1000000","waitForFinalization":true}'Transfer USDC
Replace 0xRecipientAddress with the recipient's wallet address.
curl -X POST https://stabletrust-api.fairblock.network/transfer \
-H "Content-Type: application/json" \
-d '{"privateKey":"'"$PRIVATE_KEY"'","recipientAddress":"0xRecipientAddress","tokenAddress":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","amount":"1000000","waitForFinalization":true}'Withdraw USDC
Moves funds back to your public wallet as standard ERC-20 USDC.
curl -X POST https://stabletrust-api.fairblock.network/withdraw \
-H "Content-Type: application/json" \
-d '{"privateKey":"'"$PRIVATE_KEY"'","tokenAddress":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","amount":"1000000","waitForFinalization":true}'Authentication
All requests require a privateKey field the agent's EVM wallet private key, used for transaction signing and client-side balance decryption.
There are no API tokens or bearer headers. Store the key in an environment variable and never expose it client-side.
Endpoints
/depositShield ERC-20 tokens into the confidential layer. Once deposited, the balance is encrypted onchain and invisible to block explorers.
Request body
| Parameter | Type | Description |
|---|---|---|
privateKeyrequired | string | Agent wallet private key for signing and decryption |
tokenAddressrequired | string | ERC-20 contract address to deposit |
amountrequired | string | Token amount in base units (e.g. 1000000 = 1 USDC) |
waitForFinalization | boolean | Wait for onchain confirmation. Default: true |
Example
curl -X POST https://stabletrust-api.fairblock.network/deposit \
-H "Content-Type: application/json" \
-d '{
"privateKey": "0xYourPrivateKey",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amount": "1000000",
"waitForFinalization": true
}'Response
{
"receipt": {
"hash": "0xabc123..."
}
}/balanceQuery the decrypted balance of a confidential account. Decryption happens client-side using the private key the raw onchain value remains encrypted.
Request body
| Parameter | Type | Description |
|---|---|---|
privateKeyrequired | string | Agent wallet private key for balance decryption |
tokenAddressrequired | string | ERC-20 contract address to query |
address | string | Optional: query a specific address. Defaults to the key's address |
Example
curl -X POST https://stabletrust-api.fairblock.network/balance \
-H "Content-Type: application/json" \
-d '{
"privateKey": "0xYourPrivateKey",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
}'Response
{
"balance": {
"total": "100",
"available": "100",
"pending": "0"
}
}/transferSend tokens privately from one confidential account to another. Both the amount and recipient address are encrypted onchain.
Request body
| Parameter | Type | Description |
|---|---|---|
privateKeyrequired | string | Sender's wallet private key |
recipientAddressrequired | string | Recipient's EVM wallet address (must have an initialized account) |
tokenAddressrequired | string | ERC-20 contract address |
amountrequired | string | Amount in token base units |
useOffchainVerify | boolean | Use off-chain verification. Default: false |
waitForFinalization | boolean | Wait for onchain confirmation. Default: true |
Example
curl -X POST https://stabletrust-api.fairblock.network/transfer \
-H "Content-Type: application/json" \
-d '{
"privateKey": "0xYourPrivateKey",
"recipientAddress": "0xRecipientAddress",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amount": "50000000",
"useOffchainVerify": false,
"waitForFinalization": true
}'Response
{
"receipt": {
"hash": "0xdef456..."
}
}/withdrawConvert encrypted confidential tokens back to standard public ERC-20 tokens.
Request body
| Parameter | Type | Description |
|---|---|---|
privateKeyrequired | string | Wallet private key for signing |
tokenAddressrequired | string | ERC-20 contract address |
amountrequired | string | Amount in token base units |
useOffchainVerify | boolean | Use off-chain verification. Default: false |
waitForFinalization | boolean | Wait for onchain confirmation. Default: true |
Example
curl -X POST https://stabletrust-api.fairblock.network/withdraw \
-H "Content-Type: application/json" \
-d '{
"privateKey": "0xYourPrivateKey",
"tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
"amount": "25000000",
"useOffchainVerify": false,
"waitForFinalization": true
}'Response
{
"receipt": {
"hash": "0xghi789..."
}
}AI agent integration
The API is designed for autonomous agents no SDK, no browser wallet, just standard HTTP with a private key in the environment:
// AI agent payment example (Node.js)
const API = 'https://stabletrust-api.fairblock.network';
async function sendConfidentialPayment(recipient: string, amount: string) {
const res = await fetch(`${API}/transfer`, {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({
privateKey: process.env.AGENT_PRIVATE_KEY,
recipientAddress: recipient,
tokenAddress: process.env.TOKEN_ADDRESS,
amount,
waitForFinalization: true,
}),
});
const { receipt } = await res.json();
return receipt.hash;
}Supported networks
| Network | Chain ID |
|---|---|
| Base | 8453 |
| Base Sepolia | 84532 |
| Ethereum Sepolia | 11155111 |
| Arbitrum Sepolia | 421614 |
| Arc | 1244 |
| Stable | 2201 |
| Tempo | 42431 |
SDK Documentation
Prefer TypeScript? Use the SDK for full cryptographic control.