Accounts
Modular Accounts are smart contract wallets that serve as deposit addresses for users. They are deterministic, meaning the same user always gets the same address across all supported chains.Get User Account
Retrieve the Modular Account details for a user. Endpoint:GET /api/users/:userId/account
Authentication: Required (API Key)
Request
Headers:| Parameter | Type | Description |
|---|---|---|
userId | string | User identifier |
Response
Status:200 OK
| Field | Type | Description |
|---|---|---|
userId | string | User identifier |
modularAccountAddress | string | Smart contract wallet address (same on all chains) |
canonicalChainId | number | Chain where account was first provisioned |
canonicalChainKey | string | Human-readable canonical chain identifier |
supportedChains | number[] | List of chain IDs where this account exists |
Example
Error Responses
Not Found Status:404 Not Found
401 Unauthorized
Create Account (Advanced)
Provision a Modular Account for a user without creating a Deposit Intent. Endpoint:POST /api/accounts
Authentication: Required (API Key)
Note: Most integrations don’t need this endpoint. Accounts are automatically created when you create a Deposit Intent via POST /api/deposit-intents.
Request
Headers:| Field | Type | Required | Description |
|---|---|---|---|
ownerAddress | string | Yes | User identifier (typically same as userId) |
chainKey | string | Yes | Chain to provision on (e.g., “base”, “ethereum”) |
label | string | No | Optional label for the account |
Response
Status:201 Created
Example
POST /api/deposit-intents instead, which creates both an account and a deposit intent in one call.
Understanding Modular Accounts
What is a Modular Account?
A Modular Account is a smart contract wallet (ERC-4337/ERC-6900 compatible) that:- Acts as the deposit address for a user
- Is controlled by Bridgfy on behalf of the user
- Executes cross-chain transfers automatically based on Deposit Intents
- Has the same address on all supported EVM chains
- Deterministic: Same address for a user across all chains
- Non-custodial: Only acts on predefined Deposit Intents
- Secure: Cannot be controlled by anyone except the Bridgfy system
Account Lifecycle
Flow:- You create a Deposit Intent for a user
- If the user doesn’t have an account, one is provisioned automatically
- The account is deployed on the canonical chain (typically Base)
- The same address is available on all supported chains
- Future Deposit Intents for the same user reuse the same account
Address Determinism
The Modular Account address is derived from:- User ID
- Bridgfy’s account factory configuration
- Chain-specific salt
- Same
userId→ Same address - Address is predictable and stable
- Can be safely stored and reused
- Works across all supported chains
Supported Chains
Modular Accounts work on all Bridgfy-supported chains:| Chain | Chain ID | Key |
|---|---|---|
| Base | 8453 | base |
| Ethereum | 1 | ethereum |
| Polygon PoS | 137 | polygon |
| Arbitrum One | 42161 | arbitrum |
| Avalanche C-Chain | 43114 | avalanche |
Canonical Chain
ThecanonicalChainId is the chain where the account was first provisioned. This is typically:
- Base (8453) for most accounts
- Or the first chain where a Deposit Intent was created
- Determines where the account is “anchored”
- May affect gas costs for first-time setup
- Has no impact on functionality (account works the same on all chains)
Use Cases
1. Check if User Has Account
Before showing deposit options:2. Display Deposit Address
Show users their deposit address for a specific chain:3. Verify Account Exists on Chain
The account address is the same on all chains, but you can verify it’s the same:4. Link to Block Explorer
Show users their account on a block explorer:Best Practices
Don’t Call Unnecessarily
Accounts are created automatically when you create Deposit Intents. In most cases, you don’t need to:- Call
POST /api/accounts(usePOST /api/deposit-intentsinstead) - Call
GET /api/users/:userId/accountbefore creating an intent
- Displaying account info in user profile
- Verifying an account exists before advanced operations
- Building account management features
Store the Address
Once you have a user’s deposit address:- Store it in your database
- Reuse it for displaying to users
- Don’t fetch repeatedly - the address never changes
Handle Missing Accounts
If a user doesn’t have an account yet:Security Considerations
Important:- The Modular Account is controlled by Bridgfy, not the user
- It only executes transfers based on Deposit Intents
- Users cannot manually withdraw funds from the account
- Funds are automatically routed according to the user’s intent
- Don’t tell users they can “withdraw” from this address
- Explain it’s a “deposit-only” address for cross-chain routing
- Make it clear funds are automatically forwarded to their destination
Display Best Practices
When showing the deposit address to users:Next Steps
- Create Deposit Intents to configure routing
- Track Executions to monitor transfers
- Learn about How It Works for architecture details