Every depositing user needs a registered smart account. You can let the service create one (managed) or bring your own (user-owned).
Choose an account type
Managed accounts are recommended for most integrations — simpler setup, no SDK
dependency for registration. User-owned accounts are for cases where deposits
should go to an existing smart account the user already controls.
All examples below use these shared constants:
Register an account
Managed account
User-owned account
The service creates a Nexus smart account deterministically from your API key and a salt you provide. The same API key + salt always produces the same deposit address, so you can safely re-register if needed.Pick a salt
Use a stable, unique identifier per user — for example, an internal user ID. Hash it for privacy: Call /register-managed
The response includes two deposit addresses:Both addresses route to the same target chain and token. Verify registration
sources lists every chain the account can receive deposits from, each with its deposit address — EVM chains share the evmDepositAddress, Solana carries the solanaDepositAddress. For this flow, you create a Rhinestone smart account via the SDK, configure session keys so the deposit service can sign bridging transactions, and register the account with its factory data and session details.Install the SDK
These examples target SDK 3.0.0, which is not released yet. The install command
below requires its publication; the current v2 package does not support these APIs.
Create the account
Run these examples in a trusted backend with userSigner, a viem account controlled by the user. Never expose API_KEY in browser code. The following blocks continue this setup. Build session details
The deposit service uses a session key to sign bridging transactions on the user’s behalf. Build session details for every chain you accept deposits from, plus the target chain — a deposit arriving on a chain with no session can’t be bridged. See supported chains and tokens for the current set.This unscoped setup grants the service signer unrestricted execution and
ERC-1271 signing on each listed chain, with no separate claim policies. It is
not limited to bridging. The policy override matches the service’s per-chain
session reconstruction; changing it invalidates the enable signature. Confirm
chain support and the production signer address before signing.
The example pins Nexus 1.2.1. The service also recognizes Nexus 1.2.0, Startale 1.0.0, Safe, and Kernel factories; do not assume other factories or validator configurations are compatible. Restricted swap sessions require the service’s matching stored scope and are not covered by this example. Call /register
The JSON replacer (_, v) => typeof v === "bigint" ? v.toString() : v is needed because sessionDetails.hashesAndChainIds contains bigint chain IDs that JSON.stringify can’t serialize by default.
Adding source chains
To accept deposits from chains that weren’t included in the original registration, add new session details:Managed accounts automatically support all available source chains — this
step is only needed for user-owned accounts.
To select the destination token from the source chain, token, or symbol, configure token routing during registration.