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

# Create a wallet

> Create an HD wallet with an Ethereum account from a server, an iOS app, an Android app, or plain HTTP.

02 / QUICKSTART

A [wallet](https://docs.0xkey.io/concepts/wallets.md) is an HD seed that never leaves the enclave. Each wallet derives one or more **accounts** (addresses); you sign with an account address.

**Before you start:** finish [Account setup](https://docs.0xkey.io/getting-started/quickstart.md) so you have `ZEROXKEY_ORG_ID`, `ZEROXKEY_API_PUBLIC_KEY` and `ZEROXKEY_API_PRIVATE_KEY`.

> [!NOTE]
>
> **Where the wallet lives.** The TypeScript and cURL examples use your API key and create the wallet in **your organization**. The Swift and Kotlin examples run in an app after the end user signs in, and create the wallet in **that user's [sub-organization](https://docs.0xkey.io/concepts/sub-organizations.md)**. Never ship your API private key in a client app.

## Create the wallet

```ts TypeScript {12-15} theme={"theme":{"light":"github-light","dark":"github-dark"}}
// npm install @0xkey-io/sdk-server
import { ZeroXKey, DEFAULT_ETHEREUM_ACCOUNTS } from "@0xkey-io/sdk-server";

const zeroXKey = new ZeroXKey({
  apiBaseUrl: "https://api.0xkey.io",
  apiPublicKey: process.env.ZEROXKEY_API_PUBLIC_KEY!,
  apiPrivateKey: process.env.ZEROXKEY_API_PRIVATE_KEY!,
  defaultOrganizationId: process.env.ZEROXKEY_ORG_ID!,
});
const api = zeroXKey.apiClient();

const { walletId, addresses } = await api.createWallet({
  walletName: "Main",
  accounts: DEFAULT_ETHEREUM_ACCOUNTS, // one Ethereum account at m/44'/60'/0'/0/0
});
console.log(walletId, addresses[0]);
```

```swift Swift theme={"theme":{"light":"github-light","dark":"github-dark"}}
// After ZeroXKeyContext.configure(...) and sign-in; see the Swift SDK page.
import ZeroXKey

let ctx = ZeroXKeyContext.shared
let walletId = try await ctx.createWallet(walletName: "Main") // Ethereum + Solana accounts
let wallets = try await ctx.refreshWallets()
```

```kotlin Kotlin theme={"theme":{"light":"github-light","dark":"github-dark"}}
// After ZeroXKeyContext.init(...) and sign-in; see the Kotlin SDK page.
import io.zeroxkey.core.ZeroXKeyContext
import io.zeroxkey.types.*

val result = ZeroXKeyContext.createWallet(
    walletName = "Main",
    accounts = listOf(
        V1WalletAccountParams(
            curve = V1Curve.CURVE_SECP256K1,
            pathFormat = V1PathFormat.PATH_FORMAT_BIP32,
            path = "m/44'/60'/0'/0/0",
            addressFormat = V1AddressFormat.ADDRESS_FORMAT_ETHEREUM,
        ),
    ),
    mnemonicLength = 12,
)
val walletId = result.walletId
val address = result.addresses.first()
```

```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
BODY='{
  "type": "ACTIVITY_TYPE_CREATE_WALLET",
  "timestampMs": "'"$(date +%s)000"'",
  "organizationId": "'"$ZEROXKEY_ORG_ID"'",
  "parameters": {
    "walletName": "Main",
    "accounts": [{
      "curve": "CURVE_SECP256K1",
      "pathFormat": "PATH_FORMAT_BIP32",
      "path": "m/44'"'"'/60'"'"'/0'"'"'/0/0",
      "addressFormat": "ADDRESS_FORMAT_ETHEREUM"
    }]
  }
}'

# STAMP is your API key's signature over the exact bytes of $BODY; see Stamps.
curl -s https://api.0xkey.io/public/v1/submit/create_wallet \
  -H "Content-Type: application/json" \
  -H "X-Stamp: $STAMP" \
  -d "$BODY"
```

With cURL, the IDs are in `activity.result.createWalletResult` (`walletId`, `addresses`). Raw HTTP requests must be [stamped](https://docs.0xkey.io/developer-reference/api-overview/stamps.md) yourself; the SDKs do it for you.

Creating a wallet is an [activity](https://docs.0xkey.io/concepts/activities.md). If a policy requires approvals, the activity waits for them instead of completing.

## Add more accounts

One wallet can hold accounts on several chains. Add accounts later with `create_wallet_accounts` (`createWalletAccounts` in the SDKs), passing the `walletId` and the account parameters. See [Wallets](https://docs.0xkey.io/concepts/wallets.md) and [Networks](https://docs.0xkey.io/networks/overview.md) for supported address formats.

## Next

> [card] [Sign a transaction](https://docs.0xkey.io/getting-started/sign-transaction.md)
>
> Sign an Ethereum transaction with the account you just created


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.