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. These are PEM formatted public keys with escaped newlines.
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 authorizationKeys. Defaults to 0 if not passed.
ts
const {id, address, chainType} = await privy.walletApi.create({chainType: 'ethereum'});

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.

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. These are PEM formatted public keys with escaped newlines.
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 authorizationKeys. Defaults to 0 if not passed.

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 request

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"
}

Example request with 2 of 3 quorum signatures

A sample request to create a new EVM wallet with quorum approvals (2 of 3) 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",
  "authorization_key_ids": [
    "onz3itqhcx667gz3lyxjofui",
    "j0uov7pqoy7bnqrt7612prr0",
    "eexjdc5g72vfzzqdl7sb1vbj",
  ],
  "authorization_threshold": 2,
}'

A successful response will look like the following:

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