Skip to main content
POST
/
v1
/
wallets
/
{wallet_id}
/
export
Export wallet
curl --request POST \
  --url https://api.privy.io/v1/wallets/{wallet_id}/export \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/json' \
  --header 'privy-app-id: <privy-app-id>' \
  --data '
{
  "encryption_type": "HPKE",
  "recipient_public_key": "BDAZLOIdTaPycEYkgG0MvCzbIKJLli/yWkAV5yCa9yOsZ4JsrLweA5MnP8YIiY4k/RRzC+APhhO+P+Hoz/rt7Go="
}
'
{
  "encryption_type": "HPKE",
  "encapsulated_key": "BOhR6xITDt5THJawHHJKrKdI9CBr2M/SDWzZZAaOW4gCMsSpC65U007WyKiwuuOVAo1BNm4YgcBBROuMmyIZXZk=",
  "ciphertext": "PRoRXygG+YYSDBXjCopNYZmx8Z6nvdl1D0lpePTYZdZI2VGfK+LkFt+GlEJqdoi9"
}

SDK methods

Learn more about exporting wallets using our SDKs here.
This endpoint exports a wallet’s private key using Hybrid Public Key Encryption (HPKE). The following HPKE configuration is supported:
  • KEM (Key Encapsulation Mechanism): DHKEM_P256_HKDF_SHA256
  • KDF (Key Derivation Function): HKDF_SHA256
  • AEAD (Authenticated Encryption with Associated Data): CHACHA20_POLY1305
  • Mode: BASE

Authorizations

Authorization
string
header
required

Basic Auth header with your app ID as the username and your app secret as the password.

Headers

privy-app-id
string
required

ID of your Privy app.

privy-authorization-signature
string

Request authorization signature. If multiple signatures are required, they should be comma separated.

privy-request-expiry
string

Request expiry. Value is a Unix timestamp in milliseconds representing the deadline by which the request must be processed.

Path Parameters

wallet_id
string
required

ID of the wallet.

Body

application/json
encryption_type
enum<string>
required

The encryption type of the wallet to import. Currently only supports HPKE.

Available options:
HPKE
recipient_public_key
string
required

The base64-encoded encryption public key to encrypt the wallet private key with.

Response

200 - application/json

The exported private key.

encryption_type
enum<string>
required

The encryption type of the wallet to import. Currently only supports HPKE.

Available options:
HPKE
ciphertext
string
required

The encrypted private key.

encapsulated_key
string
required

The base64-encoded encapsulated key that was generated during encryption, for use during decryption.