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

# Create an account

> Create a deterministic smart account and configure its owner.

A smart account is a contract account controlled by one or more signers. Creating one computes its address; it does not deploy a contract or submit a transaction.

## Create the account

This server-side example uses one ECDSA owner. Keep both environment variables private.

```ts {17,19-20} theme={null}
import { RhinestoneSDK } from '@rhinestone/sdk'
import type { Hex } from 'viem'
import { privateKeyToAccount } from 'viem/accounts'

const apiKey = process.env.RHINESTONE_API_KEY
const ownerPrivateKey = process.env.OWNER_PRIVATE_KEY

if (!apiKey || !ownerPrivateKey) {
  throw new Error('RHINESTONE_API_KEY and OWNER_PRIVATE_KEY are required')
}

const owner = privateKeyToAccount(ownerPrivateKey as Hex)
const rhinestone = new RhinestoneSDK({
  auth: { mode: 'apiKey', apiKey },
})

const account = await rhinestone.createAccount({
  owners: {
    type: 'ecdsa',
    accounts: [owner],
  },
})

const address = account.getAddress()
```

The SDK uses Nexus when you omit `account.type`. It deploys the account lazily on each chain when the account first sends a transaction there. Receiving funds does not deploy it.

<Warning>
  The smart account address differs from its owner address. Send funds to the address returned by `account.getAddress()` when you intend to fund the smart account.
</Warning>

## Restore the account

Call `createAccount` again with the same account implementation, owners, and provider-specific salt or nonce. The same configuration produces the same address for a given SDK version.

Keep the complete configuration with the signer material. Changing an owner, threshold, account implementation, salt, or nonce can produce a different address.

## Choose the configuration

<CardGroup cols={2}>
  <Card title="Choose a signer" icon="key" href="/wallets/custom-signer/account-setup/choose-a-signer">
    Select ECDSA, passkeys, an embedded wallet, an external wallet, multisig, or MFA.
  </Card>

  <Card title="Choose an account provider" icon="wallet" href="/wallets/custom-signer/account-setup/account-types-and-providers/smart-account-providers">
    Use the default Nexus account or choose another supported implementation.
  </Card>
</CardGroup>
