Smart Deposit Addresses in WDK: One Address, Every EVM Chain
15 minutes read

By the end of this post, you'll understand what WDK Smart Deposit Address (SDA) modules are, how Candide's forwarding addresses turn one address into a deposit inbox on every supported EVM chain, and how to ship a deposit screen that discovers routes, activates an address and tracks delivery.
What we've built so far
This series introduces complex blockchain interactions and makes them simple with WDK. In More Than Transfers: Swaps, Bridges, Lending, and Fiat in WDK, you separated wallet accounts from protocol modules. In Swap and Bridge in WDK, you moved funds that the user's wallet already holds. And in Fiat in WDK, you brought money in from a bank card.
The wallet basics:
- Introduction to WDK: what WDK is and how modules fit together
- Build, Sign, and Send Your First Transaction: seeds, accounts and native sends
- Sending USD₮ in WDK: token transfers on EVM and TRON
New to WDK protocol modules? Read More Than Transfers first, then come back.
There is one funding path we haven't covered yet: money that arrives from somewhere you don't control. That might be a withdrawal from an exchange, a payment from another wallet, or a customer paying an invoice.
- User: "I'm sending you 25 USD₮ from my exchange account."
- App: "Great. Which chain?"
- User: "…Ethereum? Is that OK?"
- App: "We only settle on Arbitrum. Please bridge first."
- User: "Deposit abandoned".
The user can't sign a bridge transaction from an exchange. They can only paste an address and press withdraw. So the only way through is a detour: withdraw to a personal wallet, bridge or swap there, then send the funds on to your app. Every hop adds a fee, and another chance to paste the wrong address or pick the wrong chain. Many users give up halfway, and some lose their funds.
Smart Deposit Addresses fix that. You give the user one address. They send an ordinary transfer to it from any supported chain, and the provider forwards the funds to the chain and recipient you chose.
We'll move from concept to code in eight steps:
- Understand how Smart Deposit Addresses work
- Get your Candide credentials
- Register the module
- Discover routes at runtime
- Quote the deposit
- Activate the address
- Renew when expiry is close
- Track delivery
WDK supports two SDA providers so far: Candide and Rhino.fi. Step 1 compares them, and the practical examples use Candide.
Tested with (2026-11-18)
@candidelabs/wdk-protocol-sda-candide 1.0.0-beta.1
@tetherto/wdk-wallet 1.0.0-beta.26
Node.js 22.23.5
Wallet app: the WDK React Native starter in the iOS Simulator
Step 1: Understand How Smart Deposit Addresses Work
An SDA module does not sign or send anything for the depositor. The flow is:
- Your backend asks the provider for a deposit address and says where funds must end up (destination chain and recipient).
- You show that address to the user.
- The user sends an ordinary token transfer to it from their wallet or exchange, on any supported source chain.
- The provider detects the deposit, routes it (bridging when needed), and delivers the equivalent token to the recipient on the destination chain.
- Your app tracks the forward until it completes.

The depositor only ever sees one address. Everything that needs a secret, from activation to renewal, happens between your backend and the provider.
WDK standardises this as the SdaProtocol interface in @tetherto/wdk-wallet. Every provider implements the same methods: getSupportedRoutes(), quoteDeposit(), createDepositAddress(), getDepositAddress(), getTransfers(), getTransfer().
Providers can also implement optional ones such as deriveDepositAddress(), renewDepositAddress() and recoverDepositAddress(). An optional method a provider doesn't support throws UnsupportedOperationError.
The interface is shared, but the custody model is not. That's the first thing to decide:
Candide Forwarding Address | Rhino.fi Smart Deposit Address | |
|---|---|---|
npm package |
|
|
Latest version | 1.0.0-beta.1 | 1.2.0 |
Custody | Self-custodial contract at a deterministic (CREATE2) address | Trusted operator: Rhino.fi issues and sweeps the address |
Who can withdraw stuck funds | Recipient immediately; optional recovery withdrawer after a timelock | Rhino.fi (refunds via its own flow) |
One address for many chains | ✅ One address on every supported EVM source chain | ✅ for EVM chains; other families get one address per chain |
Chains | EVM only | EVM and non-EVM (e.g. Stellar with memo) |
Client-side derivation | ✅ | ❌ |
Address lifetime | Monitoring expires; renew with | Live on creation, monitored for ten years |
Pause an address | ❌ (expires on its own) | ✅ |
Tracking | Poll | Signed webhooks, |
Auth | apiUrl (embeds your team API key) for reads; policySecret for activation and renewal | One apiKey; a |
Chain naming | Lowercase names ('ethereum', 'polygon') or numeric ids | Rhino.fi keys ('ETHEREUM', 'ARBITRUM') or numeric ids |
Which one should you pick? Choose Candide when you want a self-custodial, verifiable address on EVM chains, and you can renew monitoring from your backend. Choose Rhino.fi when you need non-EVM sources, long-lived addresses and webhooks, and you're comfortable with a trusted operator handling funds in transit.
This post uses Candide as the primary example. Its address is derived from inputs you choose, so you can check the address yourself before you show it to anyone.
Note: Both modules are community modules, developed and maintained independently by Candide and Rhino.fi. Tether and the WDK team do not endorse or assume responsibility for their code, security, or maintenance.
Step 2: Get Your Candide Credentials
Candide needs two values, both from the Candide dashboard. Keep both on your backend:
Value | Config field | Where it lives | What it can do |
|---|---|---|---|
Forwarding Address API URL | apiUrl | Server only | Routes, quotes, derivation, lookups, history. It embeds your team API key, which is used for billing. It cannot activate addresses or move funds |
Forwarding policy secret | policySecret | Server only | Activate, renew and reactivate addresses ( |
Your app never calls Candide directly. It calls your backend, and your backend calls Candide.
Copy the API URL exactly as the dashboard shows it. The snippets in this post read these environment variables. The names are only a convention, so use your own if you prefer:
CANDIDE_FORWARDING_API_URL=<api-url-from-dashboard>
CANDIDE_FORWARDING_POLICY_SECRET=<policy-secret-from-dashboard>
CANDIDE_RECOVERY_WITHDRAWER=<your-company-recovery-wallet>
CANDIDE_SALT_SECRET=<random-32-byte-hex>
SEED_PHRASE=<development-seed-phrase>
ETH_RPC_URL=<ethereum-rpc-url>⚠ Important: Treat both values as secrets. The API URL carries your billing key, so anyone who holds it can run routes, quotes and lookups on your bill. The policy secret authorises activations, which cost money. Keep both on your backend, out of any mobile or web app, and don't log the full API URL or raw error causes.
The dashboard is also where you turn on fee sponsorship for a forwarding policy. When it's on, the user receives the full deposit, and the forwarding fees are billed to your policy instead. It's the same Candide dashboard you used for gas sponsorship in our EVM gasless guide, but this setting covers forwarding fees, not gas.
Step 3: Register the Module
Install the module in your backend project. It runs on Node.js 20+ and also ships a Bare entry point.
npm install @tetherto/wdk @tetherto/wdk-wallet-evm @candidelabs/wdk-protocol-sda-candide@tetherto/wdk-wallet is a peer dependency (^1.0.0-beta.19), so the module shares the WDK base classes your app already uses. Register it like any other protocol module and get it from the account:
import WDK from '@tetherto/wdk'
import WalletManagerEvm from '@tetherto/wdk-wallet-evm'
import CandideForwardingProtocol from '@candidelabs/wdk-protocol-sda-candide'
// Only for development and testing. Never hard-code a seed phrase in production.
const wdk = new WDK(process.env.SEED_PHRASE)
.registerWallet('ethereum', WalletManagerEvm, {
provider: process.env.ETH_RPC_URL
})
.registerProtocol('ethereum', 'candide', CandideForwardingProtocol, {
apiUrl: process.env.CANDIDE_FORWARDING_API_URL,
policySecret: process.env.CANDIDE_FORWARDING_POLICY_SECRET,
recoveryWithdrawer: process.env.CANDIDE_RECOVERY_WITHDRAWER || undefined // optional; an empty string throws //Optional
})
const account = await wdk.getAccount('ethereum', 0)
const sda = account.getSdaProtocol('candide')What's happening:
registerProtocol()recognises the class as an SDA protocol because it extends SdaProtocol, and stores it under the label 'candide'.account.getSdaProtocol('candide')builds the protocol with that account bound. The account's address becomes the default recipient, so later calls don't need destinationAddress.- Nothing here signs a transaction. The bound account is only read, so a read-only account works too.
apiUrlis the only required option. policySecret is only needed for activation and renewal.recoveryWithdraweris a company wallet that can recover stuck funds after a timelock. If you leave it out, it defaults to the recipient and the address is fully self-custodial.
The setup above fits a wallet app, where each user has their own WDK account. A backend that issues addresses for many users doesn't need a wallet of its own, so it holds no seed phrase. Create the module directly, pass undefined where a wallet account would go, and give destinationAddress on every call. You can also split read-only work from activation, so only one part of your backend holds the policy secret:
// Read-only instance: routes, quotes, derivation, lookups, history. No secret.
const reader = new CandideForwardingProtocol(undefined, {
apiUrl: process.env.CANDIDE_FORWARDING_API_URL,
recoveryWithdrawer: process.env.CANDIDE_RECOVERY_WITHDRAWER || undefined
})
// Activation instance: the same, plus createDepositAddress / renewDepositAddress / recoverDepositAddress.
const activator = new CandideForwardingProtocol(undefined, {
apiUrl: process.env.CANDIDE_FORWARDING_API_URL,
policySecret: process.env.CANDIDE_FORWARDING_POLICY_SECRET,
recoveryWithdrawer: process.env.CANDIDE_RECOVERY_WITHDRAWER || undefined
})Both instances run on your backend. If the read-only instance calls createDepositAddress(), the module throws a ValueError before any request is sent, because no policy secret is configured.
Step 4: Discover Routes at Runtime
Candide decides which chains and tokens it currently forwards. Never hardcode them. Routes are discovered per source chain, so sourceChain is required:
const routes = await sda.getSupportedRoutes({
sourceChain: 'ethereum',
destinationChain: 'arbitrum'
})
const usdt = routes
.flatMap((route) => route.inputTokens)
.find((token) => token.symbol === 'USDT')
if (!usdt) throw new Error('No USD₮ route from Ethereum to Arbitrum right now')
console.log(usdt.token, usdt.decimals, '→', usdt.destinationTokenAddress)What's happening:
- Chains can be numeric ids (1) or the names the SDK knows ('ethereum', 'polygon', 'arbitrum', 'optimism', 'plasma' and others). Results always use numeric ids.
- Each route has
inputTokens. token is the source-chain ERC-20 contract (lowercased), anddestinationTokenAddressis what gets delivered. Each token is forwarded as its own equivalent, so USD₮ on Ethereum arrives as USD₮0 on Arbitrum. - The
outputAssetfilter from the WDK interface isn't applied by this provider yet. To filter by output, usedestinationTokenAddress. - In production, check token and decimals against your own allowlist. A symbol alone doesn't authenticate a token.
Every bridge has a minimum. Pass sourceToken to get it:
const [tokenRoute] = await sda.getSupportedRoutes({
sourceChain: 'ethereum',
destinationChain: 'arbitrum',
sourceToken: usdt.token
})
const minimum = tokenRoute?.limits?.min // bigint, input-token base units, may be undefinedlimits.min is the smallest minimum across the bridges Candide can use. It moves with gas and token prices. Leave a margin above it, and re-quote before you show it to users.
⚠ Important: Unsupported tokens, and supported tokens below the minimum, are not forwarded. They stay in the forwarding contract. The recipient can always withdraw them, and a later deposit of the same token can top the balance up past the minimum.
Step 5: Quote the Deposit
quoteDeposit() gives a non-binding estimate of what a deposit would deliver:
const inputAmount = 25_000_000n // 25 USD₮ (6 decimals)
const quote = await sda.quoteDeposit({
sourceChain: 'ethereum',
inputToken: usdt.token,
destinationChain: 'arbitrum',
inputAmount
})
console.log('Bridge:', quote.bridge)
console.log('Delivers:', quote.outputAmount, quote.outputAssetSymbol)
for (const fee of quote.fees) {
console.log(fee.type, fee.amount, fee.included ? '(deducted)' : '(not deducted)')
}What's happening:
inputTokenmust be an ERC-20 address from the route. A symbol such as 'USDT' throwsInvalidTokenError.inputAmountis a bigint in base units, and must be greater than zero.quote.feeshas two entries, both in the input token: the Candide relayer fee (type: 'protocol') and the bridge fee (type: 'network'). included: true means it's already deducted fromoutputAmount. Don't subtract it again.outputAmountis in the destination token's base units. Input and output tokens can have different decimals, so normalise them before you compare.bridgetells you which route the estimate assumed (for example, often for USD₮0). The actual forward can use another bridge that accepts the amount.
The sender also pays their own source-chain gas for the transfer. That's outside the SDK, because the depositor's wallet or exchange sends it.
Step 6: Activate the Address
Now create the address. This is the call that needs the policy secret, so it runs on your backend:
const [deposit] = await sda.createDepositAddress({
sourceChains: ['ethereum', 'polygon'],
destinationChain: 'arbitrum'
})
console.log('Deposit address:', deposit.address)
console.log('Monitored on chains:', deposit.sourceChains) // [1, 137, 42161]
console.log('Active until:', new Date(deposit.expiry * 1000).toISOString())What's happening:
- The result is a one-element array. That one address covers every source chain, and the destination chain is added automatically, so
sourceChainscomes back as [1, 137, 42161]. destinationAddresswas omitted, so the bound account's address is the recipient. Without a bound account you must pass it.deposit.idequalsdeposit.address. Store the address, the recipient, the recovery withdrawer, the destination chain and the salt.expiryis in Unix seconds. Monitoring is deliberately short-lived: about 24 hours per activation (see Step 7).supportedInputTokenslists every token the address forwards, per source chain.- With
verifyAddresses(default true), the SDK derives the address itself and refuses to return one that disagrees with the API (CandideForwardingError, reasonADDRESS_MISMATCH).
The address is CREATE2(factory, salt, proxyCreationCode ++ (beacon, initialize(recipient, allowedRelayer, recoveryWithdrawer, destinationChainId))). Two things follow:
- The same inputs always give the same address, on every chain. Changing the recipient, recovery withdrawer, destination chain or salt gives a different one. Changing the source chains doesn't.
- You can compute it without activating it.
deriveDepositAddress()takes the same options and needs no secret:
const derived = await reader.deriveDepositAddress({
sourceChains: ['ethereum', 'polygon'],
destinationChain: 'arbitrum',
destinationAddress: await account.getAddress()
})
// derived === deposit.addressTo give each user or order their own address that settles into one treasury, vary the salt. It's a 32-byte hex value. Derive it from a server-side secret, not from the order ID itself:
import { createHmac } from 'node:crypto'
// HMAC-SHA256(serverSecret, orderId): unique per order, unguessable without the secret
const saltFor = (orderId) => '0x' + createHmac('sha256', process.env.CANDIDE_SALT_SECRET)
.update(String(orderId))
.digest('hex')
const [orderDeposit] = await activator.createDepositAddress({
sourceChains: ['ethereum', 'polygon'],
destinationChain: 'arbitrum',
destinationAddress: process.env.TREASURY_ADDRESS,
salt: saltFor(1042)
})Why not use the order ID directly? A sequential salt makes addresses predictable. Anyone who knows your treasury and recovery withdrawer could derive the addresses for orders 1043, 1044 and so on, then watch or correlate your customers' deposits. Hashing with a secret keeps each address unique without making it guessable. Store the salt with the order, so you can always derive the address again, even if you rotate the secret later.
Once the address exists, ask for a policy-aware quote. It reflects sponsorship:
const addressQuote = await sda.quoteDeposit({
sourceChain: 'ethereum',
inputToken: usdt.token,
destinationChain: 'arbitrum',
inputAmount,
depositAddress: deposit.address
})
console.log('Sponsored:', addressQuote.sponsored)When sponsored is true, outputAmount equals the input, and both fees come back with included: false.
Trust model: Forwarding addresses delegate to an upgradeable beacon administered by Candide. Address verification proves the derivation inputs and the resulting address. It doesn't prove what implementation sits behind the beacon, or that it won't change. The SDK pins the factory, beacon and proxy bytecode. If the API reports different ones, it throws DEPLOYMENT_CHANGED instead of trusting them. Review Candide's contract and recovery model before you accept funds.But what if the user sent from an exchange?
An exchange withdrawal has no key on the source chain. If something goes wrong, for example an unsupported token or an amount below the minimum, the depositor can't withdraw it themselves. That's what recoveryWithdrawer is for:
- The recipient can withdraw any token from the address immediately, on the source chain.
- The recovery withdrawer can withdraw after a 48-hour timelock, which Candide's forwarding contract enforces (see the Candide Forwarding Address docs). The recipient can veto it.
Decide this before you create the address. The recovery withdrawer is a derivation input, so changing it later changes the address. On-chain withdrawals happen through Candide's recovery frontend, not through the SDK.
Step 7: Renew When Expiry Is Close
Monitoring is what detects deposits, and it lasts about 24 hours per activation. Each activation and renewal is billed to your forwarding policy, so don't renew every time the deposit screen opens. Renew only in the last 2 hours before expiry, and never show an address that isn't being monitored.
Renewal needs the policy secret, so the flow is: your app asks your backend for the address, your backend renews it with Candide if needed, and returns it.
// Backend handler behind your app's "show deposit address" request
const RENEW_WITHIN_SECONDS = 2 * 60 * 60 // monitoring lasts about 24 h; renew in the last 2 h
async function getLiveDepositAddress (address) {
const now = Math.floor(Date.now() / 1000)
let current = await activator.getDepositAddress(address)
if (!current.expiry || current.expiry - now < RENEW_WITHIN_SECONDS) {
current = await activator.renewDepositAddress(address)
}
if (!current.expiry || current.expiry <= now) {
throw new Error('Monitoring is not active: do not show this address')
}
return {
address: current.address,
expiry: current.expiry,
accepts: current.supportedInputTokens.map((token) => `${token.symbol} on chain ${token.chain}`)
}
}What's happening:
getDepositAddress()is a lookup: it doesn't need the policy secret and doesn't re-activate anything. On a descriptor you look up, expiry is the earliest per-chain expiry, so a past value means at least one chain needs renewing.renewDepositAddress()re-activates the address on every chain it was ever activated on, expired ones included, using the stored derivation inputs. It's idempotent, so a retry after a timeout is safe.- Before it renews, the SDK re-derives the address from the stored inputs and refuses to continue on a mismatch.
- Show the expiry next to the address. A deposit that lands after expiry is safe: it stays at the address and is forwarded once you renew.
If an address lapsed with funds already waiting, recoverDepositAddress({ address }) re-activates it so the next monitoring sweep picks the balance up. It returns { status: 'reindexed', … }. It sends no transaction and moves no funds.
Step 8: Track Delivery
Poll the forwards that went through the address from your backend:
const transfers = await reader.getTransfers(deposit.address, { limit: 20 })
for (const transfer of transfers) {
console.log(
transfer.id,
transfer.status, // WDK status: completed, processing, refunded, ...
transfer.providerStatus, // Candide's raw status: delivered, pending, ...
transfer.sourceChainId,
transfer.destinationTxHash ?? '-'
)
}
const inFlight = await reader.getTransfers(deposit.address, { status: 'processing' })What's happening:
- Results come newest first. skip, limit and status are applied after the SDK pages through the provider for you.
- Use
getTransfersByRecipient(destinationChain, recipient)for one recipient's history across all of their addresses, andgetTransfer(id)for a single forward. - One forward can combine several deposits.
sourceAddresseslists the contributing senders and amounts, largest first. It can be absent, null, or contain a "redacted" dust entry. sourceTxHashis the forwarding transaction on the source chain, not the depositor's original transfer.
Candide's statuses map onto the WDK SdaTransferStatus like this:
Candide (providerStatus) | WDK (status) |
|---|---|
delivered | completed |
pending, unknown | processing |
failed + failureReason: 'refunded' | refunded |
failed + failureReason: 'expired' | expired |
failed (other) | failed |
anything else | pending |
⚠ Important: To list in-flight forwards, filter on processing, not pending. WDK pending only appears for a status this SDK version doesn't recognise, so treat it as non-terminal.
An empty history isn't proof that nobody sent funds. History only contains detected forwards. Each poll is a request on your team API key, so poll only while a deposit is expected: for example every 30 seconds with backoff, and stop after a timeout. Keep both status and providerStatus.
Common Errors
ValueError: Candide discovers routes per source chain: you calledgetSupportedRoutes()withoutsourceChain. Pass it.InvalidTokenErrorfromquoteDeposit():inputTokenwas a symbol. Use the token address fromgetSupportedRoutes().ValueErrormentioningpolicySecret: activation, renewal or recovery was called on an instance without the secret. Make that call from the instance that holds it.ValueErrorfor an amount: below the bridge minimum or above its maximum. Re-read limits.min and leave a margin.SdaErrorwith reason:'ROUTE_NOT_SUPPORTED': the route isn't currently offered. Pick one fromgetSupportedRoutes().ProviderErrorwithUNAUTHORIZEDorFORBIDDEN: wrong secret, a disabled policy, or the address cap was reached. Check the policy in the dashboard.CandideForwardingErrorwithADDRESS_MISMATCH: the API's address and the module's local derivation disagree. Don't fund either address. Investigate first, because the API may already have activated one.CandideForwardingErrorwithDEPLOYMENT_CHANGED: Candide redeployed the factory or beacon. Upgrade the SDK, or pass independently verifieddeployParams.
Key Insights
- An SDA turns "which chain?" into a non-question. The depositor makes one ordinary transfer to one address. Routing and settlement are the provider's job.
- Same WDK interface, different custody.
registerProtocol→getSdaProtocol→getSupportedRoutes→quoteDeposit→createDepositAddress→getTransfersworks with both providers. Who holds funds in transit doesn't stay the same. - Candide's address is yours to verify. It's a
CREATE2address derived from inputs you choose. The SDK re-derives it on every activation and renewal, and pins the bytecode it trusts. - Monitoring expires, so renew from your backend when expiry is close. Show expiry next to the address. Late deposits are safe and are forwarded after renewal.
- Choose the recovery withdrawer before you create the address. It's a derivation input, and it's what rescues funds that a user sent from an exchange.
- Both modules are community modules. Candide and Rhino.fi maintain them independently. Tether does not endorse or audit them. Check the version you install.
What's next
You now have a funding path for money that starts outside your app: one address, any supported chain, delivered where you settle.
Before you go to production, check that:
- The API URL and policy secret live only on your backend, and neither is logged.
- Salts are derived with HMAC-SHA256(serverSecret, id) and stored with each order.
- The recovery withdrawer is a company wallet you control, chosen before the first address.
- Your backend renews monitoring when expiry is close, and the app never shows an expired address.
- Deposit tokens are checked against your own allowlist, with a margin above limits.min.
- Polling has a backoff and a timeout.
In the next post, Privacy in WDK: Shielded Balances with Bermuda and Hinkal, everything a deposit address receives is still public. We'll give every WDK wallet a shielded balance next to its public one, and show how to shield, pay and withdraw USD₮0 privately.
Follow WDK's official X account for announcements, and join us on Discord to ask questions and get help directly from the team.
Resources:
Receive the latest WDK news
Click to subscribe to the WDK newsletter and stay updated!
Latest Articles & Guides



Swap and Bridge in WDK: A Guide to Five Routers
Compare five WDK routers, find routes, get a quote, track a cross-chain transfer, and understand what changes when you switch providers.
