> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Account Abstraction

> Implement ERC-4337 and EIP-7702 Account Abstraction with Para Server SDK

export const Link = ({href, label, newTab = false}) => {
  const [isHovered, setIsHovered] = useState(false);
  return <a href={href} target={newTab ? '_blank' : '_self'} rel={newTab ? 'noopener noreferrer' : undefined} className="not-prose inline-block relative text-black font-semibold cursor-pointer border-b-0 no-underline" onMouseEnter={() => setIsHovered(true)} onMouseLeave={() => setIsHovered(false)}>
      {label}
      <span className={`absolute left-0 bottom-0 w-full rounded-sm bg-gradient-to-r from-orange-600 to-purple-600 transition-all duration-300 ${isHovered ? 'h-0.5' : 'h-px'}`} />
    </a>;
};

## Account Abstraction

Account abstraction (AA) replaces traditional externally owned accounts (EOAs) with programmable smart contract accounts. This unlocks capabilities that EOAs alone cannot provide:

* **Gas sponsorship** — let users transact without holding native tokens for gas fees
* **Batched transactions** — bundle multiple operations into a single atomic transaction
* **Session keys** — grant temporary, scoped permissions without exposing the primary key
* **Custom authorization** — implement multi-factor auth, spending limits, or recovery logic at the account level
* **Programmable accounts** — create accounts with built-in rules for corporate or multi-user scenarios

Two standards are currently in use for AA on EVM-based chains:

|                     | EIP-4337                                                        | EIP-7702                                                   |
| ------------------- | --------------------------------------------------------------- | ---------------------------------------------------------- |
| **How it works**    | UserOperations processed by bundlers via an EntryPoint contract | EOA delegates to a smart contract via a type-4 transaction |
| **Account address** | New smart contract address (different from EOA)                 | Same as your EOA                                           |
| **Chain support**   | All EVM chains                                                  | Requires chain-level support                               |
| **Infrastructure**  | Bundler + Paymaster                                             | Provider-dependent                                         |
| **Gas overhead**    | Higher (extra validation steps)                                 | Lower (native execution)                                   |
| **Maturity**        | Production-ready                                                | Emerging                                                   |
| **Best for**        | Maximum compatibility, dedicated smart wallet                   | Keeping EOA address, simpler flows                         |

Both standards support **gas sponsorship** and **batched transactions**.

<Tip>
  Learn more about [EIP-4337](https://eips.ethereum.org/EIPS/eip-4337) and [EIP-7702](https://eips.ethereum.org/EIPS/eip-7702) on the Ethereum Improvement Proposals site.
</Tip>

## Para Integrations

Para acts as the **signer** (EOA) that controls smart contract wallets — it is not a smart wallet itself. Para handles secure key management via MPC, while the AA provider deploys and manages the smart contract account on-chain. This means your users' private keys remain secure and under their control regardless of which provider you choose.

Para wraps each provider in a shared `SmartAccount` interface. Whether you use EIP-4337 or EIP-7702 mode, your application code stays the same — you can swap providers or switch between standards without rewriting transaction logic.

Every provider integration is available as an **action function** (`createXxxSmartAccount`) — an imperative async function you can call anywhere, including outside React components, inside custom hooks, or in server-side code. React applications also get a **hook** (`useXxxSmartAccount`) — a declarative wrapper powered by React Query that handles initialization, caching, and automatic re-creation when config changes.

Both return the same `SmartAccount` object:

```typescript theme={null}
import type { Chain, Hex, LocalAccount, TransactionReceipt } from "viem";

interface SmartAccount {
  smartAccountAddress: Hex;              // On-chain account address
  signer: LocalAccount;                 // Para viem signer
  chain: Chain;                          // Configured chain
  mode: "4337" | "7702";                // Account type
  provider: string;                      // Provider name

  // Send a single transaction and wait for receipt
  sendTransaction(params: {
    to: Hex;
    value?: bigint;
    data?: Hex;
  }): Promise<TransactionReceipt>;

  // Send batched transactions atomically
  sendBatchTransaction(calls: Array<{
    to: Hex;
    value?: bigint;
    data?: Hex;
  }>): Promise<TransactionReceipt>;

  client: any;                           // Provider-specific client for advanced usage
}
```

When using `mode: "7702"`, the return type narrows to include an optional `delegationAddress` field — the smart
contract the EOA delegates to. When using `mode: "4337"`, `smartAccountAddress` is the counterfactual smart
contract address (different from `signer.address`).

## Provider Comparison

| Provider                                                      | 4337 | 7702 | External Wallets | Chain Restrictions                        | Key Feature                                       |
| ------------------------------------------------------------- | :--: | :--: | :--------------: | ----------------------------------------- | ------------------------------------------------- |
| [Alchemy](https://accountkit.alchemy.com/react/quickstart)    |   ✓  |   ✓  |         ✓        | Alchemy-supported chains                  | Modular accounts, gas policies                    |
| [ZeroDev](https://docs.zerodev.app/)                          |   ✓  |   ✓  |         ✓        | Any EVM chain                             | Kernel accounts, session keys, plugins            |
| [Pimlico](https://docs.pimlico.io/)                           |   ✓  |   ✓  |         ✓        | Any EVM chain                             | Permissionless SDK, flexible paymaster            |
| [Biconomy](https://docs.biconomy.io/)                         |   ✓  |   ✓  |         ✓        | MEE-supported chains                      | Cross-chain orchestration via MEE                 |
| [Thirdweb](https://portal.thirdweb.com/)                      |   ✓  |   ✓  |         ✓        | Any EVM chain                             | Smart wallets, gas sponsorship                    |
| [Gelato](https://docs.gelato.network/)                        |      |   ✓  |                  | Any EVM chain                             | Native 7702, built-in gas sponsorship             |
| [Porto](https://porto.sh)                                     |      |   ✓  |                  | [Multiple chains](https://porto.sh/relay) | 7702-native relay, merchant-based gas sponsorship |
| [Safe](https://docs.safe.global/)                             |   ✓  |      |         ✓        | Any EVM chain                             | Multi-sig, modular accounts                       |
| [Rhinestone](https://docs.rhinestone.wtf/)                    |   ✓  |      |         ✓        | Any EVM chain                             | Cross-chain orchestration                         |
| [Coinbase Developer Platform](https://docs.cdp.coinbase.com/) |   ✓  |      |                  | Base, Base Sepolia only                   | Coinbase smart accounts                           |

## Provider Guides

Server-side AA uses the same `createXxxSmartAccount` action functions as the React SDK — no hooks needed. Select a provider below for installation and usage instructions.

<Note>
  You'll need a Para Server SDK session before calling any `createXxxSmartAccount` function. See the <Link label="Server Setup Guide" href="/v3/server/setup" /> for details on initializing Para and importing sessions.
</Note>

<Tabs>
  <Tab title="Alchemy">
    <Link label="Alchemy Account Kit" href="https://www.alchemy.com/account-kit" /> provides modular smart accounts with built-in gas sponsorship via Alchemy's Gas Manager. Create and manage smart accounts, submit gasless transactions, and execute batched UserOperations. Supports both EIP-4337 and EIP-7702 modes.

    ### Setup

    1. Create an <Link label="Alchemy account" href="https://dashboard.alchemy.com/signup" /> and obtain your **API key** and **Gas Policy ID** from the Alchemy dashboard.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-alchemy viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-alchemy viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-alchemy viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript alchemy-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createAlchemySmartAccount } from "@getpara/aa-alchemy";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createAlchemySmartAccount({
      para,
      apiKey: process.env.ALCHEMY_API_KEY!,
      chain: sepolia,
      gasPolicyId: process.env.ALCHEMY_GAS_POLICY_ID, // optional: for gas sponsorship
      mode: "4337", // or "7702"
    });

    // Get the smart wallet address (different from Para EOA in 4337 mode)
    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    // Send a single transaction
    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    // Send batched transactions atomically
    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      Alchemy requires chains from `@account-kit/infra` (e.g. `sepolia`, `baseSepolia`). Plain viem chains are automatically mapped if an Alchemy equivalent exists. For gasless transactions, set up a Gas Manager Policy in your <Link label="Alchemy Dashboard" href="https://dashboard.alchemy.com" /> and pass the policy ID as `gasPolicyId`.
    </Note>
  </Tab>

  <Tab title="ZeroDev">
    <Link label="ZeroDev" href="https://docs.zerodev.app/" /> is an embedded AA wallet powering many smart accounts across EVM chains. Known for its extensive feature set including gas sponsorship, session keys, recovery, multisig, and <Link label="chain abstraction" href="https://docs.zerodev.app/sdk/advanced/chain-abstraction" />. Supports both EIP-4337 and EIP-7702 modes.

    ### Setup

    1. Create a <Link label="ZeroDev account" href="https://dashboard.zerodev.app/" /> and obtain your **Project ID** from the ZeroDev dashboard.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-zerodev viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-zerodev viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-zerodev viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript zerodev-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createZeroDevSmartAccount } from "@getpara/aa-zerodev";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createZeroDevSmartAccount({
      para,
      projectId: process.env.ZERODEV_PROJECT_ID!,
      chain: sepolia,
      mode: "4337", // or "7702"
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      You can optionally pass `bundlerUrl` and `paymasterUrl` to use custom infrastructure instead of ZeroDev's defaults. For more on managing your ZeroDev project and RPC endpoints, see the <Link label="ZeroDev RPC documentation" href="https://docs.zerodev.app/meta-infra/rpcs" />.
    </Note>
  </Tab>

  <Tab title="Pimlico">
    <Link label="Pimlico" href="https://docs.pimlico.io/" /> provides account abstraction infrastructure via <Link label="permissionless.js" href="https://docs.pimlico.io/permissionless" />, a TypeScript library built on viem with no extra dependencies and a small bundle size. Supports multiple account implementations. Supports both EIP-4337 and EIP-7702 modes.

    ### Setup

    1. Create a <Link label="Pimlico account" href="https://dashboard.pimlico.io/" /> and obtain your **API key** from the Pimlico dashboard.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-pimlico viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-pimlico viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-pimlico viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript pimlico-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createPimlicoSmartAccount } from "@getpara/aa-pimlico";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createPimlicoSmartAccount({
      para,
      apiKey: process.env.PIMLICO_API_KEY!,
      chain: sepolia,
      mode: "4337", // or "7702"
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      The Pimlico bundler/paymaster URL is automatically constructed from your API key and chain name. You can override it with a custom `rpcUrl`. Pimlico's permissionless.js also supports other account types (Safe, Kernel, Biconomy, SimpleAccount) — see the <Link label="permissionless.js tutorial" href="https://docs.pimlico.io/permissionless/tutorial/tutorial-1" />.
    </Note>
  </Tab>

  <Tab title="Biconomy">
    <Link label="Biconomy" href="https://docs.biconomy.io/" /> is a full-stack AA toolkit built on ERC-4337 that provides smart accounts, paymasters, and bundlers. Its Multi-chain Execution Environment (MEE) enables cross-chain orchestration of transactions. Supports both EIP-4337 and EIP-7702 modes.

    ### Setup

    1. Create a <Link label="Biconomy account" href="https://dashboard.biconomy.io/" /> and obtain your **API key** from the Biconomy dashboard.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-biconomy viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-biconomy viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-biconomy viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript biconomy-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createBiconomySmartAccount } from "@getpara/aa-biconomy";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createBiconomySmartAccount({
      para,
      apiKey: process.env.BICONOMY_API_KEY!,
      chain: sepolia,
      mode: "4337", // or "7702"
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      Biconomy transactions are executed via the MEE (Multi-chain Execution Environment). You can optionally pass a custom `meeUrl` to use your own MEE node.
    </Note>
  </Tab>

  <Tab title="Thirdweb">
    <Link label="Thirdweb" href="https://portal.thirdweb.com/" /> provides smart wallets with built-in gas sponsorship. Supports both EIP-4337 and EIP-7702 modes.

    ### Setup

    1. Create a <Link label="Thirdweb account" href="https://thirdweb.com/dashboard" /> and obtain your **Client ID** from the Thirdweb dashboard.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-thirdweb viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-thirdweb viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-thirdweb viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript thirdweb-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createThirdwebSmartAccount } from "@getpara/aa-thirdweb";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createThirdwebSmartAccount({
      para,
      clientId: process.env.THIRDWEB_CLIENT_ID!,
      chain: sepolia,
      sponsorGas: true, // enable gas sponsorship (default)
      mode: "4337", // or "7702"
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      Set `sponsorGas: false` to disable gas sponsorship. In EIP-4337 mode, you can optionally provide `factoryAddress` and `accountAddress` for custom smart wallet deployments.
    </Note>
  </Tab>

  <Tab title="Gelato">
    <Link label="Gelato" href="https://docs.gelato.network/" /> provides native EIP-7702 smart accounts with built-in gas sponsorship via relay infrastructure. Gelato only supports EIP-7702 mode.

    ### Setup

    1. Create a <Link label="Gelato account" href="https://app.gelato.network/" /> and obtain your **API key** from the Gelato dashboard.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-gelato viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-gelato viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-gelato viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript gelato-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createGelatoSmartAccount } from "@getpara/aa-gelato";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createGelatoSmartAccount({
      para,
      apiKey: process.env.GELATO_API_KEY!,
      chain: sepolia,
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      Gelato only supports EIP-7702 mode. Gas sponsorship is built into Gelato's relay infrastructure — no separate paymaster configuration is needed.
    </Note>
  </Tab>

  <Tab title="Porto">
    <Link label="Porto" href="https://porto.sh/docs" /> provides 7702-native smart accounts with a built-in relay — no bundler or paymaster needed. Porto only supports EIP-7702 mode.

    ### Setup

    1. No API key or third-party account is needed. Porto uses its own relay RPC.

    2. **Gas sponsorship:** On testnets, Porto's relay sponsors gas by default — no setup needed.
       For **mainnet**, you must set up a <Link label="Porto merchant account" href="https://porto.sh/sdk/guides/sponsoring" /> to cover gas fees for your users. Run `pnpx porto onboard --admin-key` to create a merchant
       account, deploy a server-side merchant route using `porto/server`, and pass your endpoint URL
       as `merchantUrl` in the config below.

    3. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-porto viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-porto viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-porto viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript porto-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createPortoSmartAccount } from "@getpara/aa-porto";
    import { parseEther } from "viem";
    import { base } from "viem/chains";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    // Testnets: gas is sponsored by default, no merchantUrl needed.
    // Mainnet: merchantUrl is required for gas sponsorship.
    const smartAccount = await createPortoSmartAccount({
      para,
      chain: base,
      merchantUrl: process.env.PORTO_MERCHANT_URL, // required for mainnet
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      Porto only supports EIP-7702 mode. The Porto relay supports <Link label="multiple chains" href="https://porto.sh/relay" /> including Base, Optimism, Arbitrum, Ethereum, and several testnets. On testnets, gas fees are sponsored by default. For mainnet, a <Link label="merchant account" href="https://porto.sh/sdk/guides/sponsoring" /> is required — pass `merchantUrl` to enable gas sponsorship.
    </Note>
  </Tab>

  <Tab title="Safe">
    <Link label="Safe" href="https://docs.safe.global/" /> (formerly Gnosis Safe) provides multi-signature smart contract wallets with ERC-4337 compatibility. The user's Para EOA serves as the signer, while the Safe smart contract wallet holds assets and submits transactions. Powered by Pimlico's bundler and paymaster infrastructure. Safe only supports EIP-4337 mode.

    ### Setup

    1. Create a <Link label="Pimlico account" href="https://dashboard.pimlico.io/" /> and obtain your **API key** — Safe uses Pimlico for bundler and paymaster services.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-safe viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-safe viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-safe viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript safe-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createSafeSmartAccount } from "@getpara/aa-safe";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createSafeSmartAccount({
      para,
      pimlicoApiKey: process.env.PIMLICO_API_KEY!,
      chain: sepolia,
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      Safe only supports EIP-4337 mode. You can optionally pass `safeVersion` (default: `"1.4.1"`) and `saltNonce` for deterministic address generation.
    </Note>
  </Tab>

  <Tab title="Rhinestone">
    <Link label="Rhinestone" href="https://docs.rhinestone.wtf/" /> provides cross-chain smart accounts with intent-based transactions, automatic bridging, and gas abstraction across multiple EVM chains. Transactions are routed through Rhinestone's orchestrator which handles cross-chain execution automatically. Rhinestone only supports EIP-4337 mode.

    ### Setup

    1. Obtain your **Rhinestone API key** and optionally a **Pimlico API key** for bundler/paymaster infrastructure.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-rhinestone viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-rhinestone viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-rhinestone viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript rhinestone-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createRhinestoneSmartAccount } from "@getpara/aa-rhinestone";
    import { sepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createRhinestoneSmartAccount({
      para,
      chain: sepolia,
      rhinestoneApiKey: process.env.RHINESTONE_API_KEY!,
      pimlicoApiKey: process.env.PIMLICO_API_KEY!, // optional but recommended
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      Rhinestone only supports EIP-4337 mode. Both `rhinestoneApiKey` and `pimlicoApiKey` are optional but recommended for production use. For advanced cross-chain use cases with automatic bridging, see the <Link label="Rhinestone documentation" href="https://docs.rhinestone.dev" />.
    </Note>
  </Tab>

  <Tab title="Coinbase Developer Platform">
    <Link label="Coinbase Developer Platform" href="https://docs.cdp.coinbase.com/" /> provides Coinbase smart accounts on Base. Uses viem's built-in `toCoinbaseSmartAccount` — no additional bundler packages required. CDP only supports EIP-4337 mode on Base and Base Sepolia.

    ### Setup

    1. Create a <Link label="CDP account" href="https://portal.cdp.coinbase.com/" /> and obtain your **RPC token** from the paymaster URL in the CDP dashboard.

    2. Install the required dependencies:

    <CodeGroup>
      ```bash npm theme={null}
      npm install @getpara/server-sdk @getpara/aa-cdp viem
      ```

      ```bash yarn theme={null}
      yarn add @getpara/server-sdk @getpara/aa-cdp viem
      ```

      ```bash pnpm theme={null}
      pnpm add @getpara/server-sdk @getpara/aa-cdp viem
      ```
    </CodeGroup>

    ### Usage

    ```typescript cdp-server.ts theme={null}
    import { Para as ParaServer, Environment } from "@getpara/server-sdk";
    import { createCDPSmartAccount } from "@getpara/aa-cdp";
    import { baseSepolia } from "viem/chains";
    import { parseEther } from "viem";

    const para = new ParaServer(Environment.BETA, process.env.PARA_API_KEY!);
    await para.importSession(serializedSession);

    const smartAccount = await createCDPSmartAccount({
      para,
      rpcToken: process.env.CDP_RPC_TOKEN!,
      chain: baseSepolia,
    });

    console.log("Smart wallet address:", smartAccount.smartAccountAddress);

    const receipt = await smartAccount.sendTransaction({
      to: "0xRecipient",
      value: parseEther("0.01"),
    });
    console.log("Transaction hash:", receipt.transactionHash);

    const batchReceipt = await smartAccount.sendBatchTransaction([
      { to: "0xRecipientA", value: parseEther("0.01") },
      { to: "0xContractAddress", data: "0xencodedCallData" },
    ]);
    console.log("Batch tx hash:", batchReceipt.transactionHash);
    ```

    <Note>
      CDP only supports EIP-4337 mode and is limited to **Base** and **Base Sepolia** chains. No additional bundler packages are needed — CDP uses viem's built-in `toCoinbaseSmartAccount`.
    </Note>
  </Tab>
</Tabs>

<Warning>
  In EIP-4337 mode, funds must be sent to `smartAccount.smartAccountAddress` — not to the Para EOA address. The smart wallet is the entity that holds funds and executes transactions on-chain.
</Warning>

## Troubleshooting

<AccordionGroup>
  <Accordion title="Transaction Failures">
    If transactions fail, verify that the Para session is valid and that the smart account address has sufficient funds (in 4337 mode). For gas-sponsored transactions, confirm your policy ID and that the transaction meets the policy requirements.
  </Accordion>

  <Accordion title="Smart Wallet Deployment Issues">
    First-time use of an AA wallet requires contract deployment, which can be more expensive. Ensure you have sufficient funds in the Para EOA for this initial deployment.
  </Accordion>

  <Accordion title="Gas Sponsorship Problems">
    If using gas sponsorship, verify your policy ID and settings in the AA provider's dashboard. Also check that the transaction meets the policy requirements (value limits, allowed functions, etc.).
  </Accordion>
</AccordionGroup>

## Examples

<CardGroup cols={2}>
  <Card title="Alchemy Account Kit Example" imgUrl="/images/v3/aa-alchemy.png" href="https://github.com/getpara/examples-hub/blob/3.0.0/server/with-node/src/routes/signWithAlchemy.ts" description="Complete example of implementing Account Abstraction on a Node.js server" horizontal />

  <Card title="ZeroDev AA Example" imgUrl="/images/v3/aa-zerodev.png" href="https://github.com/getpara/examples-hub/blob/3.0.0/server/with-node/src/routes/signWithZerodev.ts" description="Complete example of implementing Account Abstraction on a Node.js server" horizontal />
</CardGroup>
