Account Abstraction
Looking to use account abstraction for your backend operations?
Consider using Smart Backend Wallets instead. They combine EOA and smart account management into a single wallet, with automatic deployment and simplified integration:
- No need to deploy or manage account factories
- No separate account and backend wallet addresses to track
- Works with all existing Engine endpoints without modification
- Built-in transaction batching and recovery
- Automatic gas management with paymaster
Smart backend wallets are recommended when you need account abstraction for your own backend operations. Use the approach described below when you need to manage smart accounts for your users.
Use Engine to deploy, manage, and transact with smart accounts on behalf of your users.
To deploy smart accounts (referred to as "accounts" from here on), deploy an AccountFactory
contract. This contract handles deploying individual Account
contracts for your users.
Endpoint: POST /deploy/<chain>/deployer.thirdweb.eth/AccountFactory
Payload:
Once the factory is set up, deploy accounts for your users.
Endpoint: POST /contract/<chain>/<account_factory_address>/account-factory/create-account
Body:
This adds the adminAddress
as the primary admin that can act on behalf of the newly deployed account.
To control the account with a backend wallet, specify the backend wallet in the adminAddress
field.
Grant & revoke admins on an account with the /contract/<chain>/<account_address>/account/admins
endpoints.
Grant & revoke sessions on an account which allow specific wallets to interact with specified contracts for a given period of time with the /contract/<chain>/<account_address>/account/sessions
endpoints.
Make write calls with a smart account by calling a write endpoint and specify the x-backend-wallet-address
and x-account-address
headers.
The x-backend-wallet-address
should be set to the engine backend wallet that is an admin over the account.
The x-account-address
should be set to the deployed account address itself.
Write calls made using these headers will initiate a UserOperation
sent from the specified account.