Skip to Content
PlatformAccount Abstraction

Account Abstraction

How EmbarkAI uses ERC-4337 account abstraction for smart wallet functionality.

EmbarkAI smart wallets are built on the ERC-4337 Account Abstraction standard. Instead of relying on externally owned accounts (EOAs) controlled by a single private key, every EmbarkAI wallet is a smart contract with programmable transaction logic, gas sponsorship, and batched calls.

What is Account Abstraction?

Account Abstraction (AA) decouples transaction validation from Ethereum’s native protocol. With ERC-4337, smart contract accounts can define their own signature schemes, pay gas on behalf of users, and execute multiple operations atomically — all without changes to the consensus layer.

Key Concepts

ConceptDescription
Smart AccountA smart contract that acts as a user’s wallet, with custom validation logic
UserOperationA pseudo-transaction object that describes what the smart account should execute
EntryPointA singleton contract that validates and executes UserOperations on-chain
BundlerAn off-chain service that collects UserOperations and submits them to the EntryPoint
PaymasterAn optional contract that sponsors gas fees on behalf of the user

UserOperations Explained

A UserOperation replaces the traditional Ethereum transaction. Instead of signing a transaction directly, users sign a UserOperation that the EntryPoint contract processes.

// Sending a UserOperation with the EmbarkAI SDK import { createServerWalletManager, MemoryKeyshareStorage } from '@embarkai/core' const manager = createServerWalletManager({ apiKey: process.env.EMBARK_API_KEY!, chainId: 994873017, storage: new MemoryKeyshareStorage(), }) const wallet = await manager.getWallet('my-wallet') // The SDK constructs, signs, and submits the UserOperation internally const userOpHash = await wallet.sendUserOperation( '0xRecipientAddress', '1000000000000000000', // 1 LUMIA in wei )

Behind the scenes, the SDK:

  1. Constructs a UserOperation with the correct nonce, gas limits, and calldata
  2. Signs the operation using the DKLS23 threshold signature protocol
  3. Submits it to the Bundler
  4. The Bundler validates and sends it to the EntryPoint contract on-chain

The EntryPoint Contract

The EntryPoint is a singleton contract deployed at a well-known address on every supported chain. It is responsible for:

  • Validating each UserOperation’s signature via the smart account’s validateUserOp method
  • Executing the call defined in the UserOperation
  • Handling gas payments — either from the smart account’s deposit or via a Paymaster
  • Emitting events that allow off-chain indexing of UserOperation results

EmbarkAI uses EntryPoint v0.7, which is automatically configured for all supported chains.

The Bundler

The Bundler is an off-chain service that aggregates UserOperations and submits them to the EntryPoint in a single on-chain transaction. EmbarkAI runs managed Bundler infrastructure so you do not need to operate your own.

The Bundler performs several checks before inclusion:

  • Validates the UserOperation signature
  • Simulates execution to ensure it will succeed
  • Estimates gas requirements
  • Submits the bundle to the blockchain

Paymaster: Gas Sponsorship

A Paymaster contract can pay gas fees on behalf of users, enabling gasless transactions. When a Paymaster is configured, users never need to hold native tokens to transact.

const manager = createServerWalletManager({ apiKey: process.env.EMBARK_API_KEY!, chainId: 994873017, storage: new MemoryKeyshareStorage(), paymasterAddress: '0xYourPaymasterAddress', // Enable gas sponsorship })

See the Paymaster documentation for details on configuring gas sponsorship.

Smart Account Lifecycle

EmbarkAI smart accounts follow a counterfactual deployment model:

1. Wallet Creation (Off-chain)

When you call createWallet(), the SDK runs the DKG protocol to generate a key pair and computes the counterfactual address — the deterministic address where the smart account will be deployed. No on-chain transaction occurs at this stage.

2. First Transaction (Deployment)

The first UserOperation sent from the wallet includes an initCode field that deploys the smart account contract. The EntryPoint uses the AA factory contract to deploy the account and then executes the operation — all in one transaction.

3. Active

After deployment, the smart account is a live contract on-chain. Subsequent UserOperations skip the initCode step and execute directly against the deployed account.

Advantages Over EOA Wallets

FeatureEOA WalletEmbarkAI Smart Account
Key managementSingle private keyMPC threshold signatures (no single point of failure)
Gas paymentMust hold native tokensPaymaster can sponsor gas
Batch operationsOne tx at a timeMultiple calls in a single UserOperation
Account recoverySeed phrase onlyVault backup with password encryption
Custom validationECDSA onlyProgrammable signature verification
Deployment costFree (built-in)Deferred to first transaction (counterfactual)

How EmbarkAI Implements AA

EmbarkAI combines Account Abstraction with MPC security:

  1. Key generation uses the DKLS23 2-of-2 threshold protocol — no single party holds the full private key
  2. Smart accounts are deployed via a deterministic factory contract per chain
  3. Bundler infrastructure is fully managed — you interact only with the SDK
  4. Gas sponsorship is opt-in via Paymaster configuration
  5. Batch operations are supported natively through sendBatchUserOperation

Next Steps

Last updated on