Skip to content

Smart Accounts

A Smart Account is a smart contract that acts as a user’s wallet. Unlike a standard EOA (Externally Owned Account) like MetaMask — controlled by one private key, paid for in the chain’s native token — a Smart Account defines its rules in code: which keys can sign, how gas is paid, who can recover the account.

0xGasless uses the ERC-4337 standard to enable this, with two SDKs depending on where the signing key lives:

You want…Use
Browser app, user signs from an embedded wallet (no extension)@0xgasless/coreOxGasClient wraps embedded wallet + smart account
Server bot or agent that signs autonomously@0xgasless/coreOxGasServerWallet (EOA, no smart account needed)
Bring-your-own signer (local key, viem, ethers, hardware)@0xgasless/smart-account — the low-level SDK

EOAs are notoriously difficult for mainstream users:

  • Gas. You need ETH to do anything. Want to send USDC? You need ETH first.
  • Batching. Approving a token and calling a contract takes two separate transactions, two separate signatures.
  • Key loss. If you lose your seed phrase, you lose your wallet — there’s no recovery built into the protocol.

Smart Accounts fix these problems by moving validation and execution into a contract you control:

  1. Gasless transactions. A Paymaster sponsors gas. Users transact for free.
  2. Pay gas with ERC-20s. If you don’t sponsor, users can pay gas in USDC instead of ETH.
  3. Batched transactions. Approve and swap in a single click.
  4. Session keys. Grant an app permission to act on the user’s behalf for a fixed window without re-signing.
  5. Account recovery. Set up guardians to restore access if the primary key is lost.

Instead of broadcasting a normal Ethereum transaction, the user signs a UserOperation — a data structure describing what they want to do.

  1. The user signs the UserOperation.
  2. Your app sends it to a Bundler.
  3. The Bundler groups multiple UserOperations into one normal transaction and submits it to the global EntryPoint contract.
  4. The EntryPoint validates the signature via the user’s Smart Account.
  5. If a Paymaster is involved, the EntryPoint charges the Paymaster for gas.
  6. The EntryPoint tells the Smart Account to execute the call.
User signs Your app Bundler EntryPoint Smart Account
────────── ──────── ─────── ────────── ─────────────
UserOp ─────────► sendUserOp ───────────► bundles
into a tx ─────────► validates sig ──► validateUserOp
│ ◄────── OK │
│ (Paymaster?) │
│ ──────────────► execute
Section titled “@0xgasless/core (recommended for browser apps)”

OxGasClient from @0xgasless/core ties authentication, the embedded wallet’s KMS signer, smart-account creation, and gasless transactions into one object. Start here if your users live in the browser.

import { OxGasClient } from '@0xgasless/core';
const client = new OxGasClient({
apiKey: 'your-api-key',
chainId: 11155111,
bundlerUrl: 'https://bundler.0xgasless.com/11155111',
paymasterUrl: 'https://paymaster.0xgasless.com/v1/11155111/rpc/your-api-key',
});
await client.login();
await client.setupSmartAccount();
await client.sendTransaction({ to: '0x...', value: 0n, data: '0x' });

See Embedded Wallets → Smart Account Integration for the full flow.

If you already have a signer — privateKeyToAccount from viem, an ethers Wallet, a hardware device — use @0xgasless/smart-account directly to wrap it in an ERC-4337 smart account.

See the Quickstart for the standalone setup.