What it does
Deposit
Convert public ERC20 tokens into a confidential encrypted balance.
Transfer
Send tokens privately without leaking amounts or balances to the public.
Withdraw
Move funds from the confidential layer back to public ERC20 tokens.
What you can build
Privacy by default unlocks new use cases for open finance that institutions and enterprises require:- Confidential payroll - stream salaries to employees and contractors without publishing compensation onchain.
- Confidential merchants - let merchants accept fast, low-cost stablecoin payments without leaking revenue or supply chain counterparties.
- Confidential token launches and OTC - let participants receive or trade tokens confidentially.
- Web wallets with confidential transfers built in - give everyday users privacy by default for transactions and balances.
- Agentic confidential payments - enable fast, confidential micropayments for subscriptions, APIs, or AI agents.
- Treasury management - let enterprises, funds, and market makers move capital without broadcasting strategy to the market.
- Confidential RWAs - trade onchain stocks, tokenized funds, or bitcoin without leaking activity, similar to how private financial activity works offchain.
Installation
Install the Stabletrust SDK into your project:Supported Networks
The SDK currently supports confidential transfers on the following testnets:Quick Start: Code Snippets
The SDK revolves around theConfidentialTransferClient, which handles the cryptographic heavy lifting.
1
Initialize the client
Set up the client with your RPC URL and chain ID.
2
Ensure the account is set up
Before any confidential operation, make sure the user account is initialized onchain. This is a one-time step per user per chain.
3
Deposit tokens
Deposit tokens to make the balance confidential. Always parse amounts using the token’s decimals (e.g. 6 for USDC).
4
Transfer confidentially
Send tokens to any recipient. The transferred amount is encrypted and hidden from the public ledger.
5
Check the confidential balance
Fetch the user’s decrypted available and pending balance. Use the token’s decimals to format for display.
Resources
NPM Package
@fairblock/stabletrust
GitHub
stabletrust-sdk source code
Build a full app
Step-by-step Next.js tutorial.
Confidential Builders Program
Apply to build on the Stabletrust SDK.
Need to protect wallet addresses and relationships too? Unlinkable transfers route through the Fairycloak relay using numeric account IDs, fully decoupled from any public EVM address - with gasless transfers and withdrawals. See Unlinkable Transfers or reach out at hello@fairblock.network to request access.