Skip to content

Creating wallets

Privy enables your app to easily create new wallets on any EVM network or Solana.

Using the SDK

To create a new wallet, use the Privy client's walletApi.create method. As parameters to the method, pass the following:

ParameterTypeDescription
chainType'ethereum' | 'solanaChain type of the wallet to create. 'Ethereum' supports any EVM-compatible network.
idempotencyKeystring(Optional) Idempotency key to identify a unique request.
authorizationKeyIdsstring[](Optional) List of authorization key IDs that should be allowed to approve transactions for the wallet.
authorizationThresholdnumber(Optional) The number of authorization key signatures required to approve a transaction. This number must be less than or equal to the number of length of authorizationKeyIds. If not specified, all keys in the authorizationKeyIds list are required.

Once invoked, walletApi.create will request Privy's API to create the desired wallet. The method returns a Promise for an object containing the following:

FieldTypeDescription
idstringUnique ID for the created wallet. Used when requesting signatures or transactions from the wallet in the future.
addressstringAddress of the created wallet.
chainType'ethereum' | 'solanaChain type of the created wallet.

Below is an example code snippet creating a wallet using the SDK

ts
const {id, address, chainType} = await privy.walletApi.create({chainType: 'ethereum'});

Using the REST API

To create a new wallet, make a POST request to:

sh
https://api.privy.io/v1/wallets

Body

In the request body, include the following:

FieldTypeDescription
chain_type'ethereum' | 'solanaChain type of the wallet to create. 'Ethereum' supports any EVM-compatible network.
idempotency_keystring(Optional) Idempotency key to identify a unique request.
authorization_key_idsstring[](Optional) List of authorization key IDs that should be allowed to approve transactions for the wallet.
authorization_thresholdnumber(Optional) The number of authorization key signatures required to approve a transaction. This number must be less than or equal to the number of length of authorization_key_ids. If not specified, all keys in the authorization_key_ids list are required.

Response

In the response, Privy will send back the following if successful:

FieldTypeDescription
idstringUnique ID of the created wallet. This will be the primary identifier when using the wallet in the future.
chain_type'ethereum' | 'solanaChain type of the created wallet.
addressstringAddress of the created wallet.

Example

As an example, a sample request to create a new EVM wallet might look like the following:

bash
$ curl --request POST https://api.privy.io/v1/wallets \
-u "<your-privy-app-id>:<your-privy-app-secret>" \
-H "privy-app-id: <your-privy-app-id>" \
-H "privy-authorization-signature: <authorization-signature-for-request>" \
-H 'Content-Type: application/json' \
-d '{
  "chain_type": "ethereum"
}'

A successful response will look like the following:

json
{
  "id": "fmfdj6yqly31huorjqzq38zc",
  "address": "0xf9f284C7Eaf97b0f9B5542d83Af7F785D12E803a",
  "chain_type": "ethereum"
}