Stabletrust
Private payment infrastructure for EVM chains. Encrypt token balances and transfer amounts on-chain — invisible to block explorers, accessible only to the owner.
What is Stabletrust?
Stabletrust is a confidential payment layer for EVM chains. It wraps standard ERC-20 tokens in an encrypted balance system. Once tokens enter the confidential layer, their amounts are hidden on-chain and opaque to block explorers.
It uses twisted ElGamal homomorphic encryption and zero-knowledge proofs to enable private transfers without revealing balances or destinations. All cryptographic operations happen client-side via a WASM module bundled in the SDK.
The SDK ships two clients. Choose based on your privacy requirements.
Two clients
Confidential
ConfidentialTransferClient
Wallet address is visible on-chain, but amounts and balances are fully encrypted. Connects directly to any EVM RPC. No relay needed.
View docs
Anonymous
AnonymousTransferClient
Wallet address never appears on-chain. Transactions are routed through the Fairycloak relay, which pays gas. Only a short account ID is associated with on-chain activity.
View docs
Comparison
| Feature | Confidential | Anonymous |
|---|---|---|
| Identity on-chain | Wallet address visible | Account ID only |
| Amount visibility | Encrypted | Encrypted |
| Gas | User pays | Relay pays (except deposits) |
| Infrastructure | Direct RPC | Fairycloak relay required |
| Recipient | Must have a confidential account | Any account or public address |
| Best for | Encrypted amounts, known sender | Full sender anonymity |
Installation
Both clients ship in the same package:
npm install @fairblock/stabletrust ethersSupported networks
Both clients share the same contract on every chain. Pass the chain ID and the address resolves automatically.
| Network | Chain ID |
|---|---|
| Base Sepolia | 84532 |
| Stable Testnet | 2201 |
| Arc | 5042002 |
| Ethereum Sepolia | 11155111 |
| Arbitrum Sepolia | 421614 |
| Tempo | 42431 |
Testnet only. Do not use with mainnet assets.
REST API
No SDK required. POST JSON to HTTPS endpoints. Designed for AI agents and server-side integrations where you need to avoid bundling WASM.
View API referenceSecurity
Private keys
Never log or expose private keys. Store them in environment variables or encrypted vaults. The ElGamal private key returned by the anonymous client is equally sensitive — treat it the same as a wallet key.
Network
Use HTTPS-only RPC endpoints. Verify the contract address against the table in this page before initializing, especially on custom deployments.
Recipients
Confirm the recipient has an initialized account before transferring. For the confidential client, check with getAccountInfo(). For the anonymous client, check with getAnonymousAccountInfo().
Error handling
Catch errors from all SDK methods. Never include private key values in error logs or telemetry. Implement retry logic for transient network failures.