- Dynamic signs the user in and secures their wallet.
- Unlink holds the user’s private balance and breaks the on-chain link.
- Circle Gateway sends gasless x402 nanopayments from an EOA.
- Arc Testnet settles fast and uses USDC as its gas token.
By the end you will have signed a user in with Dynamic, created and registered
a Dynamic-bound Unlink account on
arc-testnet, funded it, withdrawn a smaller
amount to a payer EOA, and paid an x402 resource through Circle Gateway, with
the payer EOA unlinkable from the original funding wallet.Prerequisites
- A Dynamic account or sandbox from the Dynamic dashboard, with an environment ID. Enable Arc in Dynamic’s chains list if your app switches wallets to Arc.
- An Unlink API key for
arc-testnet, created in the Quickstart and stored asUNLINK_API_KEYon your backend only. - Arc Testnet USDC for the payer EOA from the Circle faucet. Arc uses USDC as its gas token, so the payer needs USDC for both the Gateway deposit and the payment. See Supported chains.
- Packages:
@unlink-xyz/sdk@canaryand@circle-fin/x402-batching. - The payer EOA’s keypair (
payerAddress,payerPrivateKey) and an Arc RPC URL (rpcUrl), which you supply in the final Gateway step.
usdc is the Arc USDC token address configured for your environment.
Sign the user in with Dynamic
Dynamic signs users in and secures their wallet.
Create a Dynamic app or sandbox in the
Dynamic dashboard, sign the user in, and read the
session token. The Dynamic user id (the JWT
sub) becomes the Unlink user id.Create and register the Unlink account
Use the Dynamic user id as the Unlink Implement
userId. Recover or create the
encrypted recovery envelope, then create the client and register the private
account on arc-testnet.recoverOrCreateUnlinkMnemonic in your app: create a temporary
Unlink client with the Dynamic sub as userId, use client.userStorage to
store only an encrypted recovery envelope, decrypt locally, and return the
mnemonic. Treat the envelope as wallet material. Encrypt it with a key derived
locally, never from the Dynamic JWT or user id, and follow Dynamic’s
storage best practices.
See Accounts and keys for the envelope
shape and key-safety rules.Authorize the account on your backend
Mount the Unlink auth routes behind Dynamic JWT verification. This is the
Dynamic-flavored version of the routes in
Custody models: authenticate with the verified
Dynamic Storage tokens must authorize only the matching Dynamic user id.
sub, and authorize user storage only for the matching id.Fund the private account
Seed the private account with Arc USDC using the faucet helper, then confirm
with The faucet
getBalances.tx_id is not pollable, so balances are the confirmation signal.
See Faucet.Transfer privately (optional)
Optionally move funds privately between Unlink accounts before withdrawing. A
private hop strengthens unlinkability. See Transfer for multiple
recipients and parameters.
Withdraw to the payer EOA
Withdraw a smaller amount privately to the payer EOA. Unlink amounts are in
base units. See Withdraw for the parameter reference.
For privacy hygiene, avoid a same-size deposit and withdrawal in the same
payment flow. Amount and timing correlation can weaken unlinkability. Keep a
larger balance in the private pool, optionally transfer privately, then
withdraw smaller payer amounts later.
Pay an x402 resource through Circle Gateway
After the payer EOA receives the withdrawal, deposit into Circle Gateway and
pay. Gateway deposit amounts are decimal USDC, while Unlink withdrawals are
base units.The Gateway payer must be a plain EOA. Do not use an Unlink execution account
or smart account as the payer. Keep some withdrawn USDC on the payer EOA
because USDC is also the gas token for the Gateway deposit transaction. In
Unlink, Arc Testnet is the SDK environment
arc-testnet; in Circle Gateway it
is the chain name arcTestnet. See Circle’s
nanopayments buyer guide
and
supported chains.What you built
You signed a user in with Dynamic, created and registered a Dynamic-bound Unlink account on Arc Testnet, funded it, withdrew a smaller amount to a payer EOA, and paid an x402 resource through Circle Gateway. The payer EOA cannot be linked back to the original funding wallet.Get funds on Arc Testnet
Fund testnet wallets with Arc USDC.
Enable Arc in Dynamic
Optional if your app switches Dynamic wallets to Arc.