<!-- tempo-docs-context -->
> Source: [/docs/accounts/create](https://tempo.xyz/developers/docs/accounts/create.md)
> Section: [Accounts](https://tempo.xyz/developers/docs/accounts.md). Create accounts, set up signing methods, policies, access keys, key rotation, and fees, and follow guides for users, automations, agents, and teams.
> [Documentation index](https://tempo.xyz/developers/llms.txt) · [Docs skill](https://tempo.xyz/developers/SKILL.md)

> Tempo MCP: Use `search`, `find_pages`, `read_page`, and `code` at `https://mcp.tempo.xyz` for Tempo and related documentation.
> If an indexed page is missing or reflects an older site, read this site’s [documentation index](https://tempo.xyz/developers/llms.txt) and Markdown pages directly.

# Create an Account

Create a Tempo account from a key, with no API call and no transaction.

## Overview

A single-key Tempo account's address comes from the key that approves its payments. Your app can create one as soon as it has a key. The address can receive stablecoins right away.

<span id="create-a-passkey-account" />

## Create a Single-Key Account

On mainnet and testnet today, an account is a [single-key account](https://tempo.xyz/developers/docs/development/single-key-accounts) (EOA). One key, such as a passkey, approves its payments and authorizes its [access keys](https://tempo.xyz/developers/docs/accounts/access-keys).

Create one on Moderato testnet from a passkey, a device key, or a private key.

<span id="try-a-passkey-account" />

In the interactive web page, create a single-key account on Moderato testnet from a passkey, a non-extractable P-256 device key, or a secp256k1 private key, kept in the tab. The address comes from the key with no transaction. Then get test stablecoins from the faucet and pay 1 test stablecoin with the key. Each payment is a real testnet transaction.

In code, create a passkey account on Moderato testnet and fund it from the testnet faucet.

```ts [passkey-account.ts]
import { tempoModerato } from 'viem/chains'
import { Account, createClient, WebAuthnP256 } from 'viem/tempo'

const credential = await WebAuthnP256.createCredential({ label: 'My Tempo account' }) // [!code hl]
export const account = Account.fromWebAuthnP256(credential) // [!code hl]
// Save credential.id and credential.publicKey with your user record.

const client = createClient({ chain: tempoModerato })
await client.faucet.fundSync({ account: account.address }) // test stablecoins
```

For a device key, use `Account.fromWebCryptoP256(await WebCryptoP256.createKeyPair())`. For a private key, use `Account.fromSecp256k1(privateKey)`.

For mainnet, use the `tempo` chain from `viem/chains` and fund the address with real stablecoins.

A single-key account can't change its key. Losing the key loses the account. Read [Passkeys](https://tempo.xyz/developers/docs/accounts/authentication/passkeys#passkey-limits) before customers fund one.

## Create a Configurable Account

:::warning
**Multiple signers arrive with the [T14 network upgrade](https://tempo.xyz/developers/docs/protocol/upgrades/t14).** Until T14 activates, an account with several signers and a threshold runs only on the [Tempo Accounts devnet](https://tempo.xyz/developers/docs/accounts/create#connect-to-the-devnet), not on mainnet or testnet, and may still change.
:::

A configurable account's signers can change while its address stays the same. Add a backup key, rotate keys, or require several approvals. Pick a first signer in the sandbox to create one on the devnet.

In the interactive web page, create a Tempo account on the Tempo Accounts devnet from its first signer: a passkey or a generated private key. Then get test funds, add signers, set weights and the threshold, authorize access keys with limits, and send payments. Every change is a real devnet transaction, so the page must be able to reach Tempo Accounts devnet.

<span id="how-account-creation-works" />

<span id="how-configurable-account-creation-works" />

### Configurable Account Creation

1. You choose a passkey, a device key, or a private key as the first signer. It approves alone, because its weight is 1 and so is the account's [threshold](https://tempo.xyz/developers/docs/accounts/policies/signing-thresholds).
2. Your app computes the address from that signer. The address can receive stablecoins right away. It stays the same when you change signers or add [access keys](https://tempo.xyz/developers/docs/accounts/access-keys).
3. The account's first transaction, such as a payment, registers it onchain. That transaction pays a network fee in a stablecoin. Fund the address first, or [sponsor the fee](https://tempo.xyz/developers/docs/accounts/fees/fee-sponsorship).

<span id="create-an-account-in-code" />

<span id="create-an-account-from-a-signing-key" />

<span id="create-a-configurable-account-in-code" />

### Create the Account in Code

```ts [account.ts]
import { generatePrivateKey } from 'viem/accounts'
import { Account } from 'viem/tempo'

const privateKey = generatePrivateKey() // Keep this secret: it approves the account's transactions.
const signer = Account.fromSecp256k1(privateKey) // [!code hl]
export const account = Account.fromConfig({ address: 'infer', owners: [signer] }) // [!code hl]

// Save account.address and account.config with your user record.
```

`address: 'infer'` tells [`Account.fromConfig`](https://viem.sh/tempo/accounts/account.fromConfig) to compute the address from the signer. Viem calls a signer an owner. You need the saved `account.config` to [add signers](https://tempo.xyz/developers/docs/accounts/account-configuration/configuration-updates#add-a-signer) later. Its `version` is a bigint, so store `AccountConfig.toRpc(account.config)` and read it back with `AccountConfig.fromRpc` ([Keep the current configuration](https://tempo.xyz/developers/docs/development/configurable-accounts#keep-the-current-configuration)).

For a passkey or device key, use [that signer](https://tempo.xyz/developers/docs/accounts/authentication) instead. To create a second account from the same key, pass a different 32-byte `salt`. If you already have a single-key account, [upgrade it in place](https://tempo.xyz/developers/docs/accounts/account-configuration/account-upgrade) to keep its address.

## Connect to the Devnet

The Accounts examples connect to the Tempo Accounts devnet, a test network that runs configurable accounts. The demos on these pages run against it with no setup.

Your own app needs an RPC key to reach the devnet. [Contact us](https://tempo.xyz/contact) for one, and set it as the `TEMPO_DEVNET_RPC_KEY` environment variable.

<span id="fund-an-account-on-devnet" />

To fund the address, call the devnet faucet, which sends test stablecoins, including pathUSD:

:::code-group
```ts [fund.ts]
import { account } from './account'
import { client } from './client'

await client.faucet.fundSync({ account: account.address }) // [!code hl]
```

```ts [client.ts]
import { http } from 'viem'
import { tempoDevnet } from 'viem/chains'
import { createClient } from 'viem/tempo'

// The Tempo Accounts devnet. Its RPC needs a key, which Tempo gives you.
const rpcKey = process.env.TEMPO_DEVNET_RPC_KEY

export const client = createClient({
  chain: tempoDevnet,
  transport: http('https://rpc-t14-checkpoint.devnet.tempoxyz.dev', {
    fetchOptions: { headers: { Authorization: `Basic ${btoa(`previews:${rpcKey}`)}` } },
  }),
})
```
:::

On Moderato testnet, the [testnet faucet](https://tempo.xyz/developers/docs/accounts/fund#get-test-funds) sends test funds. In production, [onramps and other chains](https://tempo.xyz/developers/docs/accounts/fund) fund the address.

## Next Steps

[Add Funds](https://tempo.xyz/developers/docs/accounts/fund): Use for funding the account from another account, an onramp, or another chain.

[Configuration Updates](https://tempo.xyz/developers/docs/accounts/account-configuration/configuration-updates): Use for adding a backup signer or rotating a key.

[Account Upgrade](https://tempo.xyz/developers/docs/accounts/account-configuration/account-upgrade): Use for adding signers to a single-key account at the same address.

[Access Keys](https://tempo.xyz/developers/docs/accounts/access-keys): Covers keys that sign for the account within limits.
