owner, which defines who controls the wallet.
- To create a user wallet, specify a user ID as an owner of the wallet. This ensures only the authenticated user has access to their wallet. All client-side SDKs create user wallets by default and automatically set the wallet owner as the authenticated user.
- Or, you can specify an authorization key as an
owneron a wallet. The holder of the authorization key, typically your application backend, controls the wallet. You must use a server-side SDK to create wallets owned by an authorization key.
- React
- React Native
- Swift
- Android
- Unity
- Flutter
- NodeJS
- NodeJS (server-auth)
- Java
- REST API
- Rust
The React SDK supports automatically creating embedded wallets for your users when they log in to your app. View this guide to learn more and configure automatic wallet creation.
- Ethereum
- Solana
- Other chains
To create a wallet with the React SDK, use the
createWallet method from the useCreateWallet hook:Report incorrect code
Copy
Ask AI
createWallet: async ({createAdditional?: boolean}) => Promise<Wallet>
Usage
Report incorrect code
Copy
Ask AI
import {useCreateWallet} from '@privy-io/react-auth';
const {createWallet} = useCreateWallet();
Parameters
Whether or not to create an additional Ethereum wallet for the user if they already have an existing Ethereum embedded wallet. Must be set to
true to create additional wallets. Defaults to false. Learn moreReturns
A
Promise for the linked account object for the created wallet.Callbacks
You can optionally register anonSuccess or onError callback on the useCreateWallet hook.Report incorrect code
Copy
Ask AI
const {createWallet} = useCreateWallet({
onSuccess: ({wallet}) => {
console.log('Created wallet ', wallet);
},
onError: (error) => {
console.error('Failed to create wallet with error ', e)
}
})
Optional callback to run after a user successfully creates a wallet.
Optional callback to run after there is an error during wallet creation.
To create a wallet with the React SDK, use the
createWallet method from the useCreateWallet hook:Report incorrect code
Copy
Ask AI
createWallet: async ({createAdditional?: boolean}) => Promise<Wallet>
Usage
Report incorrect code
Copy
Ask AI
import {useCreateWallet} from '@privy-io/react-auth/solana';
const {createWallet} = useCreateWallet();
Parameters
ThecreateWallet method optionally accepts as a parameter an opts object with the following fields:Whether or not to create an additional Solana wallet for the user if they already have an existing Solana embedded wallet. Must be set to
true to create additional wallets. Defaults to false. Learn moreReturns
The linked account object for the created wallet.
To create a wallet in any of the chains supported at the Tier 2 level
with the React SDK, use the
createWallet method from the useCreateWallet hook,
imported from @privy-io/react-auth/extended-chains:Report incorrect code
Copy
Ask AI
createWallet: async ({chainType: ExtendedChainType}) => Promise<{user: User; wallet: Wallet}>
Usage
Report incorrect code
Copy
Ask AI
import {useCreateWallet} from '@privy-io/react-auth/extended-chains';
const {createWallet} = useCreateWallet();
const {user, wallet} = await createWallet({chainType: 'cosmos'}); // or 'stellar', 'sui', etc.
Parameters
The chain type of the wallet to create. This could be any of the chains supported at the Tier 2 level.
Returns
The React Native SDK supports automatically creating embedded wallets for your users when they log in to your app. View this guide to learn more and configure automatic wallet creation.
- Ethereum
- Solana
- Other chains
To create a wallet with the React Native SDK, use the
create method from the useEmbeddedEthereumWallet hook:Report incorrect code
Copy
Ask AI
create: async ({createAdditional?: boolean}) => Promise<{user: User}>
Usage
Report incorrect code
Copy
Ask AI
import {useEmbeddedEthereumWallet} from '@privy-io/expo';
const {create} = useEmbeddedEthereumWallet();
Parameters
Thecreate method optionally accepts as a parameter an opts object with the following fields:Whether or not to create an additional Ethereum wallet for the user if they already have an existing Ethereum embedded wallet. Must be set to
true to create additional wallets. Defaults to false. Learn moreReturns
A
Promise for an object containing the updated user object for the user.To create a wallet with the React Native SDK, use the
create method from the useEmbeddedSolanaWallet hook:Report incorrect code
Copy
Ask AI
create: async ({createAdditional?: boolean}) => Promise<{user: User}>
Usage
Report incorrect code
Copy
Ask AI
import {useEmbeddedSolanaWallet} from '@privy-io/expo';
const {create} = useEmbeddedSolanaWallet();
Parameters
Thecreate method optionally accepts as a parameter an opts object with the following fields:Whether or not to create an additional Solana wallet for the user if they already have an existing Solana embedded wallet. Must be set to
true to create additional wallets. Defaults to false. Learn moreReturns
A
Promise for an object containing the updated user object.To create a wallet in any of the chains supported at the Tier 2 level
with the React Native SDK, use the
createWallet method from the useCreateWallet hook,
imported from @privy-io/expo/extended-chains:Report incorrect code
Copy
Ask AI
createWallet: async ({chainType: ExtendedChainType}) => Promise<{user: PrivyUser; wallet: Wallet}>
Usage
Report incorrect code
Copy
Ask AI
import {useCreateWallet} from '@privy-io/expo/extended-chains';
const {createWallet} = useCreateWallet();
const {user, wallet} = await createWallet({chainType: 'cosmos'}); // or 'stellar', 'sui', etc.
Parameters
The chain type of the wallet to create. This could be any of the chains supported at the Tier 2 level.
Returns
- Ethereum
- Solana
To create a wallet with the Swift SDK, use the
createEthereumWallet method from the PrivyUser instance:Report incorrect code
Copy
Ask AI
func createEthereumWallet(allowAdditional: Bool) async throws -> EmbeddedEthereumWallet
Parameters
ThecreateEthereumWallet method optionally accepts the following parameters:Whether or not to create an additional Ethereum wallet for the user if they already have an existing Ethereum embedded wallet. Must be set to
true to create additional wallets. Defaults to false.Returns
The newly created
EmbeddedEthereumWallet.- Ethereum
- Solana
To create a wallet with the Android SDK, use the
createEthereumWallet method from the PrivyUser instance:Report incorrect code
Copy
Ask AI
public suspend fun createEthereumWallet: (allowAdditional?: Boolean) => Result<EmbeddedEthereumWallet>
Parameters
ThecreateEthereumWallet method optionally accepts the following parameters:Whether or not to create an additional Ethereum wallet for the user if they already have an existing Ethereum embedded wallet. Must be set to
true to create additional wallets. Defaults to false.Returns
A
Result containing the EmbeddedEthereumWallet for the user.To create a wallet with the Android SDK, use the
createSolanaWallet method from the PrivyUser instance:Report incorrect code
Copy
Ask AI
public suspend fun createEthereumWallet: (allowAdditional?: Boolean) => Result<EmbeddedSolanaWallet>
Returns
A
Result containing the EmbeddedSolanaWallet for the user.- Ethereum
- Solana
To create a wallet with the Unity SDK, use the
CreateWallet method on your PrivyUser instance:Report incorrect code
Copy
Ask AI
Task<IEmbeddedEthereumWallet> CreateWallet(bool allowAdditional)
Parameters
TheCreateWallet method accepts the following parameter:Whether or not to create an additional wallet for the user if they already have an existing ethereum wallet.
Must be set to
true to create additional wallets.
Defaults to false.Returns
A
Task for the created ethereum wallet object.To create a wallet with the Unity SDK, use the
CreateSolanaWallet method on your PrivyUser instance:Report incorrect code
Copy
Ask AI
Task<IEmbeddedSolanaWallet> CreateSolanaWallet(bool allowAdditional)
Parameters
TheCreateSolanaWallet method accepts the following parameter:Whether or not to create an additional wallet for the user if they already have an existing solana wallet.
Must be set to
true to create additional wallets.
Defaults to false.Returns
A
Task for the created solana wallet object.- Ethereum
- Solana
To create a wallet with the Flutter SDK, use the
createEthereumWallet method from the PrivyUser instance:Report incorrect code
Copy
Ask AI
Future<Result<EmbeddedEthereumWallet>> createEthereumWallet({bool allowAdditional = false});
Parameters
ThecreateEthereumWallet method optionally accepts as a parameter an opts object with the following fields:Whether or not to create an additional Ethereum wallet for the user if they already have an existing Ethereum embedded wallet. Must be set to
true to create additional wallets. Defaults to false.Returns
A
Result containing the EmbeddedEthereumWallet for the user.To create a wallet with the Android SDK, use the
createSolanaWallet method from the PrivyUser instance:Report incorrect code
Copy
Ask AI
Future<Result<EmbeddedSolanaWallet>> createSolanaWallet()
Parameters
ThecreateSolanaWallet method optionally accepts the following parameters:Whether or not to create an additional Solana wallet for the user if they already have an existing Solana embedded wallet. Must be set to
true to create additional wallets. Defaults to false.Returns
A
Result containing the EmbeddedSolanaWallet for the user.To create a new wallet with the NodeJS SDK, use the
create method on the wallets() interface of the Privy client.If you are creating a user wallet, you must specify the user ID as the owner of the wallet. You can obtain a user ID by first creating a user before creating the wallet.Or, you can create a user and wallet at the same time.
Usage
Report incorrect code
Copy
Ask AI
const {id, address, chain_type} = await privy.wallets().create({chain_type: 'ethereum', owner: {user_id: 'privy:did:xxxxx'}});
Parameters and Returns
Check out the API reference for more details.Your app can provision a smart account with the wallet as a signer by following this guide.
The
@privy-io/server-auth library is deprecated. We recommend integrating @privy-io/node for
the latest features and support.createWallet method from the Privy client’s walletApi class:Report incorrect code
Copy
Ask AI
createWallet: (input: WalletApiCreateRequestType) => Promise<WalletApiCreateResponseType>
If you are creating a user wallet, you must specify the user ID as the owner of the wallet. You can obtain a user ID by first creating a user before creating the wallet.Or, you can create a user and wallet at the same time.
Usage
Report incorrect code
Copy
Ask AI
const {id, address, chainType} = await privy.walletApi.createWallet({chainType: 'ethereum', owner: {userId: 'privy:did:xxxxx'}});
Parameters
ThecreateWallet method accepts as a parameter an input object with the following fields:chainType
'ethereum' | 'solana' | 'stellar' | 'cosmos' | 'sui' | 'tron' | 'bitcoin-segwit' | 'near' | 'ton' | 'starknet' | 'aptos'
required
Chain type of the wallet to create.
The user ID to set as the owner of the wallet, or the P-256 public key to set as the owner of the wallet.If you provide this, do not specify an
ownerId as it will be generated automatically.View this guide to learn more about owners.The key quorum ID of the owner of the wallet. If you provide this, do not specify an
owner.View this guide to learn more about owners.List of policy IDs for policies that should be enforced on the wallet. Currently, only one policy is supported per wallet.
Idempotency key to identify a unique request.
List of key quorum IDs that should be allowed to approve transactions for the wallet.
Returns
Unique ID of the created wallet. This will be the primary identifier when using the wallet in the future.
Address of the created wallet.
chainType
'ethereum' | 'solana' | 'stellar' | 'cosmos' | 'sui' | 'tron' | 'bitcoin-segwit' | 'near' | 'ton' | 'starknet' | 'aptos'
Chain type of the created wallet.
List of policy IDs for policies that are enforced on the wallet.
The key quorum ID of the owner of the wallet. If an
ownerId was passed in, this response is the input ownerId. If a user ID or authorization key was passed in as the owner, this response is a newly created key quorum containing the input user ID or authorization key.The key quorum IDs of the additional signers for the wallet.
Your app can provision a smart account with the wallet as a signer by following this guide.
To create a new wallet with the Java SDK, use the
create method from the Privy client’s wallets() helper:Usage
Report incorrect code
Copy
Ask AI
try {
// Example 1: Create an ethereum wallet with no owner
WalletCreateRequestBody walletRequest1 = WalletCreateRequestBody.builder()
.chainType(WalletChainType.ETHEREUM)
.build();
// Example 2: Create an ethereum wallet with a user owner
WalletCreateRequestBody walletRequest2 = WalletCreateRequestBody.builder()
.chainType(WalletChainType.ETHEREUM)
.owner(OwnerInput.of(UserOwner.builder().userId("privy-user-id").build()))
.build();
// Example 3: Create an ethereum wallet with a public key owner
WalletCreateRequestBody walletRequest3 = WalletCreateRequestBody.builder()
.chainType(WalletChainType.ETHEREUM)
.owner(OwnerInput.of(PublicKeyOwner.builder().publicKey("authorization-key").build()))
.build();
// Example 4: Create an ethereum wallet with a key quorum owner
WalletCreateRequestBody walletRequest4 = WalletCreateRequestBody.builder()
.chainType(WalletChainType.ETHEREUM)
.ownerId("key-quorum-id")
.build();
WalletCreateResponse response = privyClient.wallets()
.create(walletRequest1); // or walletRequest2, walletRequest3, or walletRequest4
if (response.wallet().isPresent()) {
Wallet createdWallet = response.wallet().get();
}
} catch (APIException e) {
String errorBody = e.bodyAsString();
System.err.println(errorBody);
} catch (Exception e) {
System.err.println(e.getMessage());
}
Parameters
When creating a wallet, you may specify the following values on theWalletCreateRequestBody:The chain to create the wallet on.
List of policy IDs for policies that should be enforced on the wallet. Currently, only one policy
is supported per wallet.
The owner of the resource, which can either be a public key from a p256 keypair, or a user ID. If
you provide this, do not specify an
ownerId as it will be generated automatically.The key quorum ID to set as the owner of the resource. If you provide this, do not specify
an
owner.Additional signers for the wallet.
Returns
TheWalletCreateResponse object contains an optional wallet() field, present if the
wallet was created successfully.The newly created
Wallet object.Hide child attributes
Hide child attributes
Unique ID of the created wallet. This will be the primary identifier when using the wallet in the future.
Address of the created wallet.
Chain type of the created wallet.
List of policy IDs for policies that are enforced on the wallet.
The key quorum ID of the owner of the wallet. If an
ownerId was passed in, this response is the input ownerId. If a user ID or authorization key was passed in as the owner, this response is a newly created key quorum containing the input user ID or authorization key.The key quorum IDs of the additional signers for the wallet.
The creation date of the wallet, as Unix time.
To create a new wallet for a user, make a A successful response will look like the following:
POST request toReport incorrect code
Copy
Ask AI
https://api.privy.io/v1/wallets
If you are creating a user wallet, you must specify the user ID as the owner of the wallet. You can obtain a user ID by first creating a user before creating the wallet.Or, you can create a user and wallet at the same time.
Body
In the request body, include the following fields.chain_type
'ethereum' | 'solana' | 'stellar' | 'cosmos' | 'sui' | 'tron' | 'bitcoin-segwit' | 'near' | 'ton' | 'starknet' | 'aptos'
required
Chain type of the wallet to create.
The user ID to set as the owner of the wallet, or the P-256 public key to set as the owner of the wallet.If you provide this, do not specify an
owner_id as it will be generated automatically.View this guide to learn more about owners.The key quorum ID of the owner of the wallet. If you provide this, do not specify an
owner.View this guide to learn more about owners.List of policy IDs for policies that should be enforced on the wallet. Currently, only one policy is supported per wallet.
Idempotency key to identify a unique request.
The key quorum IDs to add as additional signers for the wallet.
Response
In the response, Privy will send back the following if successful:Unique ID of the created wallet. This will be the primary identifier when using the wallet in the future.
Address of the created wallet.
chain_type
'ethereum' | 'solana' | 'stellar' | 'cosmos' | 'sui' | 'tron' | 'bitcoin-segwit' | 'near' | 'ton' | 'starknet' | 'aptos'
Chain type of the created wallet.
List of policy IDs for policies that are enforced on the wallet.
The key quorum ID of the owner of the wallet. If an
ownerId was passed in, this response is the input ownerId. If a user ID or authorization key was passed in as the owner, this response is a newly created key quorum containing the input user ID or authorization key.The key quorum IDs of the additional signers for the wallet.
The creation date of the wallet, in milliseconds since midnight, January 1, 1970 UTC.
Example
A sample request might look like the following:Report incorrect code
Copy
Ask AI
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 'Content-Type: application/json' \
-d '{
"owner": {
"user_id": "did:privy:xxxxxx"
},
"chain_type": "ethereum"
}'
Report incorrect code
Copy
Ask AI
{
"id": "fmfdj6yqly31huorjqzq38zc",
"address": "0xf9f284C7Eaf97b0f9B5542d83Af7F785D12E803a",
"chain_type": "ethereum",
"policy_ids": [],
"owner_id": null,
"additional_signers": [],
"created_at": 1733923425155
}
To create a new wallet with the Rust SDK, use the
create method on the wallets() interface of the Privy client.If you are creating a user wallet, you must specify the user ID as the owner of the wallet. You can obtain a user ID by first creating a user before creating the wallet.Or, you can create a user and wallet at the same time.
Usage
Report incorrect code
Copy
Ask AI
use privy_rs::{PrivyClient, generated::types::*};
let client = PrivyClient::new(app_id, app_secret)?;
// Create an Ethereum wallet with a user owner
let wallet = client
.wallets()
.create(
None, // idempotency key (optional)
&CreateWalletBody {
chain_type: WalletChainType::Ethereum,
owner: Some(Owner::UserOwner(UserOwner {
user_id: "did:privy:xxxxx".to_string(),
})),
policy_ids: vec![],
additional_signers: vec![],
},
)
.await?;
println!("Created wallet {} with address {}", wallet.id, wallet.address);
Parameters and Returns
See the Rust SDK documentation for detailed parameter and return types, including embedded examples:For REST API details, see the API reference.Your app can provision a smart account with the wallet as a signer by following this guide.

