# Light Account • Getting started

> Getting started with Light Account in Wallet APIs

> For the complete documentation index, see [llms.txt](/docs/llms.txt).

Getting started with Light Account is straightforward. Below you'll create a `LightAccount` (and the multi-owner variant) from `@alchemy/smart-accounts` and use them with viem's bundler client.

<Tip title="Most projects should use @alchemy/wallet-apis">
  `@alchemy/wallet-apis` defaults to Modular Account V2, but it can provision a Light Account too — pass `creationHint: { accountType: "la-v2" }` to `requestAccount`. `createSmartWalletClient` then bundles account creation, gas estimation, and the bundler client behind a single call. See the [Wallet APIs quickstart](/docs/wallets/quickstart). This page covers the lower-level path: instantiating `LightAccount` directly from `@alchemy/smart-accounts` and pairing it with viem's bundler client. Use it when you need fine-grained control over the wiring.
</Tip>

### Install packages

**Prerequisites**

* minimum Typescript version of 5

**Installation**

<CodeBlocks>
  ```bash npm
  npm i @alchemy/smart-accounts @alchemy/aa-infra viem
  ```

  ```bash yarn
  yarn add @alchemy/smart-accounts @alchemy/aa-infra viem
  ```
</CodeBlocks>

### Create an account and send a transaction

<CodeBlocks>
  ```ts light-account.ts
  import { createBundlerClient } from "viem/account-abstraction";
  import { createClient } from "viem";
  import { privateKeyToAccount, generatePrivateKey } from "viem/accounts";
  import { sepolia } from "viem/chains";
  import { alchemyTransport } from "@alchemy/common";
  import { toLightAccount } from "@alchemy/smart-accounts";
  import { estimateFeesPerGas } from "@alchemy/aa-infra";

  const ALCHEMY_API_KEY = "your-api-key";
  const transport = alchemyTransport({ apiKey: ALCHEMY_API_KEY });
  const rpcClient = createClient({ chain: sepolia, transport });

  const account = await toLightAccount({
    client: rpcClient,
    owner: privateKeyToAccount(generatePrivateKey()),
    version: "v2.0.0",
  });

  const bundlerClient = createBundlerClient({
    account,
    client: rpcClient,
    chain: sepolia,
    transport,
    userOperation: { estimateFeesPerGas },
  });

  const hash = await bundlerClient.sendUserOperation({
    calls: [{ to: "0x0000000000000000000000000000000000000000", value: 0n, data: "0x" }],
  });
  ```

  ```ts multi-owner-light-account.ts
  import { createBundlerClient } from "viem/account-abstraction";
  import { createClient } from "viem";
  import { privateKeyToAccount, generatePrivateKey } from "viem/accounts";
  import { sepolia } from "viem/chains";
  import { alchemyTransport } from "@alchemy/common";
  import { toMultiOwnerLightAccount } from "@alchemy/smart-accounts";
  import { estimateFeesPerGas } from "@alchemy/aa-infra";

  const ALCHEMY_API_KEY = "your-api-key";
  const transport = alchemyTransport({ apiKey: ALCHEMY_API_KEY });
  const rpcClient = createClient({ chain: sepolia, transport });

  const account = await toMultiOwnerLightAccount({
    client: rpcClient,
    owners: [privateKeyToAccount(generatePrivateKey())],
  });

  const bundlerClient = createBundlerClient({
    account,
    client: rpcClient,
    chain: sepolia,
    transport,
    userOperation: { estimateFeesPerGas },
  });

  const hash = await bundlerClient.sendUserOperation({
    calls: [{ to: "0x0000000000000000000000000000000000000000", value: 0n, data: "0x" }],
  });
  ```
</CodeBlocks>

<Tip title="Address calculation">
  For `LightAccount`, the address is derived from the `version`, owner, and an optional `salt` (default `0n`). Same inputs → same address. `MultiOwnerLightAccount` follows the same rule but takes an array of owners and is locked to `v2.0.0` (no `version` param). Pass `accountAddress` to connect to an existing account whose contract-derived address doesn't match the signer.

  Reference: [EIP-4337 — first-time account creation](https://eips.ethereum.org/EIPS/eip-4337#first-time-account-creation).
</Tip>