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.

Base URLhttps://stabletrust-api.fairblock.network

Quickstart

Base SepoliaUSDC
1

Get 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.

2

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

3

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.

4

Check that curl is installed

Paste this and press Enter:

bash
curl --version

If you see a version number you're set. If not Mac: brew install curl. Windows: download from curl.se.

5

Export your private key

This sets your key for the current session only it won't be written to disk.

bash
export PRIVATE_KEY=0xYourPrivateKeyHere

# Windows (cmd):   set PRIVATE_KEY=0xYourPrivateKeyHere
# Windows (PS):    $env:PRIVATE_KEY="0xYourPrivateKeyHere"
6

Check your balance

bash
curl -X POST https://stabletrust-api.fairblock.network/balance \
  -H "Content-Type: application/json" \
  -d '{"privateKey":"'"$PRIVATE_KEY"'","tokenAddress":"0x036CbD53842c5426634e7929541eC2318f3dCF7e"}'
7

Deposit USDC

Amounts are in base units 1 USDC = 1,000,000. This deposits 1 USDC.

bash
curl -X POST https://stabletrust-api.fairblock.network/deposit \
  -H "Content-Type: application/json" \
  -d '{"privateKey":"'"$PRIVATE_KEY"'","tokenAddress":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","amount":"1000000","waitForFinalization":true}'
8

Transfer USDC

Replace 0xRecipientAddress with the recipient's wallet address.

bash
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}'
9

Withdraw USDC

Moves funds back to your public wallet as standard ERC-20 USDC.

bash
curl -X POST https://stabletrust-api.fairblock.network/withdraw \
  -H "Content-Type: application/json" \
  -d '{"privateKey":"'"$PRIVATE_KEY"'","tokenAddress":"0x036CbD53842c5426634e7929541eC2318f3dCF7e","amount":"1000000","waitForFinalization":true}'
Stuck on any step? Hit Open in → above to ask Claude or ChatGPT.

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

MethodEndpointDescription
POST/depositShield tokens into a confidential account
POST/balanceQuery decrypted balance
POST/transferSend tokens privately
POST/withdrawUnshield tokens to public ERC-20

POST/deposit

Shield ERC-20 tokens into the confidential layer. Once deposited, the balance is encrypted onchain and invisible to block explorers.

Request body

ParameterTypeDescription
privateKeyrequired
stringAgent wallet private key for signing and decryption
tokenAddressrequired
stringERC-20 contract address to deposit
amountrequired
stringToken amount in base units (e.g. 1000000 = 1 USDC)
waitForFinalization
booleanWait for onchain confirmation. Default: true

Example

bash
curl -X POST https://stabletrust-api.fairblock.network/deposit \
  -H "Content-Type: application/json" \
  -d '{
    "privateKey": "0xYourPrivateKey",
    "tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e",
    "amount": "1000000",
    "waitForFinalization": true
  }'

Response

json
{
  "receipt": {
    "hash": "0xabc123..."
  }
}

POST/balance

Query the decrypted balance of a confidential account. Decryption happens client-side using the private key the raw onchain value remains encrypted.

Request body

ParameterTypeDescription
privateKeyrequired
stringAgent wallet private key for balance decryption
tokenAddressrequired
stringERC-20 contract address to query
address
stringOptional: query a specific address. Defaults to the key's address

Example

bash
curl -X POST https://stabletrust-api.fairblock.network/balance \
  -H "Content-Type: application/json" \
  -d '{
    "privateKey": "0xYourPrivateKey",
    "tokenAddress": "0x036CbD53842c5426634e7929541eC2318f3dCF7e"
  }'

Response

json
{
  "balance": {
    "total": "100",
    "available": "100",
    "pending": "0"
  }
}
total = available + pending. Pending funds are in-flight and not yet spendable.

POST/transfer

Send tokens privately from one confidential account to another. Both the amount and recipient address are encrypted onchain.

Request body

ParameterTypeDescription
privateKeyrequired
stringSender's wallet private key
recipientAddressrequired
stringRecipient's EVM wallet address (must have an initialized account)
tokenAddressrequired
stringERC-20 contract address
amountrequired
stringAmount in token base units
useOffchainVerify
booleanUse off-chain verification. Default: false
waitForFinalization
booleanWait for onchain confirmation. Default: true

Example

bash
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

json
{
  "receipt": {
    "hash": "0xdef456..."
  }
}

POST/withdraw

Convert encrypted confidential tokens back to standard public ERC-20 tokens.

Request body

ParameterTypeDescription
privateKeyrequired
stringWallet private key for signing
tokenAddressrequired
stringERC-20 contract address
amountrequired
stringAmount in token base units
useOffchainVerify
booleanUse off-chain verification. Default: false
waitForFinalization
booleanWait for onchain confirmation. Default: true

Example

bash
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

json
{
  "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:

agent.ts
// 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

NetworkChain ID
Base8453
Base Sepolia84532
Ethereum Sepolia11155111
Arbitrum Sepolia421614
Arc1244
Stable2201
Tempo42431

SDK Documentation

Prefer TypeScript? Use the SDK for full cryptographic control.