1. Tutorials
Bitpanda Enterprise
  • Bitpanda Enterprise
    • Getting Started
      • Overview
      • Authentication
      • Versioning and API Changes
      • Changelog
    • REST API Endpoints
      • Overview
      • Auth Tokens
        • Obtain a Refresh and Access Tokens
        • Revoke a Refresh Token
      • User Administration
        • Individual Users
          • Create new user
          • Get user list v2
          • Search for users
          • Get user details v2
          • Update an existing user
          • Get user details
          • Off-boarding user
          • Inactivate user
          • Get user accepted Terms & Conditions
          • Get user Terms & Conditions v2
          • User verification files
          • Get account levels
          • Get account levels v2
          • Refresh KYC data for an existing user
        • Businesses
          • Get risk questions
          • Get a list of available businesses
          • Create new business
          • Get business details
          • Update an existing business
          • Create Authorized Individual
          • Get a list of Authorized Individuals
          • Get Authorized Individual details
          • Update Authorized Individual
          • Delete Authorized Individual
          • Create Shareholder
          • Get a list of Shareholders
          • Get Shareholder details
          • Update Shareholder
          • Delete Shareholder
          • Create Beneficial Owner
          • Get a list of Beneficial Owners
          • Get Beneficial Owner details
          • Update Beneficial Owner
          • Delete Beneficial Owner
          • Create Managing Director
          • Get a list of Managing Directors
          • Get Managing Director details
          • Update Managing Director
          • Delete Managing Director
          • Create Individual
          • Get a list of Individuals
          • Get Individual details
          • Update Individual
          • Delete Individual
        • User Files
          • Upload a file
          • Get file contents
          • Get file information
          • Upload a financial file
        • Legal & Regulatory
          • Get Terms & Conditions
          • Get Terms & Conditions v2
          • Get AML questions
          • Get appropriateness questions
          • Get client categorization questionnaire
          • Get DAC8 questionnaire
          • Get FATCA questionnaire
          • Get Legal Documents
          • Capture consent for User's final check
          • Retrieve Tax Identification Number Configuration
          • Get UK appropriateness questionnaire
          • Get appropriateness questionnaire for complex products
          • Get UK Risk Disclosure Warning
          • Acknowledge UK Risk Disclosure Warning
          • Get user compliance status
      • Asset Oversight
        • Asset History
          • Get asset history
          • Get asset history V2
        • Available Assets
          • Get a list of available assets
          • Get a list of available assets v2
        • Asset Details
          • Get asset details
          • Get asset details v2
        • Asset Info
          • Get asset information
          • Get asset information V2
        • Cryptocoin Details
          • Get cryptocoin details
          • Get cryptocoin details V2
        • Metal Details
          • Get metal details
          • Get metal details V2
        • Crypto Index Details
          • Get crypto index details
          • Get crypto index details V2
        • Stock Details
          • Get stock details
          • Get stock details V2
        • Equity Stock Details
          • Get equity stock details
          • Get equity stock details V2
        • ETF Details
          • Get ETF details
          • Get ETF details V2
        • Equity ETF Details
          • Get equity ETF details
          • Get equity ETF details V2
          • Get equity complex ETF details
          • Get equity complex ETF details V2
        • ETC Details
          • Get ETC details
          • Get ETC details V2
          • Get equity complex ETC details
          • Get equity complex ETC details V2
        • Equity ETC Details
          • Get Equity ETC details
          • Get Equity ETC details V2
        • Token Details
          • Get token details
          • Get token details V2
        • Asset ESG Data
          • Get asset ESG data
          • Get asset ESG data V2
        • List all available fiats per partner
        • Get the exchange rate for two assets
        • Get the swap exchange rate between two assets
        • Get assets under management
        • Get assets under management grouped by type
        • Get assets under management grouped by user
        • Get crypto index allocations
        • Get asset tags mapping
        • Get prices
        • Get prices V2
      • Trading Capabilities
        • Trades
          • Create a trade offer
          • [Deprecated] Accept a trade offer
          • Accept a trade offer V2
          • Accept a trade offer V3
          • Get a trade offer status
          • Create a trade offer V2
          • Sell asset with auto-withdraw
        • Swaps
          • Create a swap offer
          • Accept a swap offer
          • Accept a swap offer V2
          • Create a swap offer V2
        • Automated Orders
          • List automated orders
          • Get automated order price estimation
          • Create an automated order
          • Get an automated order details
          • Cancel an automated order
      • Portfolio Management
        • Returns the list of owned assets
        • Returns the list of owned asset groups
        • Portfolio performance based on timeframe
        • Returns the enhanced portfolio detail of an asset
        • Returns the list of owned assets
        • Returns the list of owned asset groups
        • Portfolio performance based on timeframe
        • Returns the enhanced portfolio detail of an asset
        • Returns the list of owned fiat wallets
      • Transactions Timeline
        • All
          • Transaction timeline per user
        • Trades
          • List all trades per user
          • Get trade details
          • Get trades history for user using asset and fiat uuid
          • Search for trades
          • Lightweight Search for trades V2
        • Swaps
          • Search for swaps
          • Search for swaps V2
          • Swap details by swap offer ID
          • Swap details by swap offer ID V2
        • Crypto Transfers
          • List all crypto transfers per user
          • Search for crypto transfers
        • Non-User Initiated Transactions
          • Non-user initiated transaction details
          • List all non-user initiated transactions per partner or per user
          • List all non-user initiated transactions per partner or per user V2
        • Corporate Actions
          • List all corporate actions per partner or per user
          • Corporate action details
          • Corporate action details V2
        • Crypto Actions
          • Crypto action details V2
          • Crypto action details
        • Staking Actions
          • List all staking actions per user
          • List all staking actions per user V2
        • Fiat Transfers
          • Search for fiat transfers
      • Reports
        • Get all available report types per user
        • Get all generated reports per user
        • Download a specific report
        • Create Account Statement Report
        • Get ex-ante report for an offer
        • Get kid information for an offer
        • List partner reports
        • Download a partner report file
      • Tax Insights
        • Get user’s tax eligibility status
        • Update user’s tax eligibility status
        • Get trade tax details
      • Notification Events
        • List all notification events per partner
        • Get JSON Web Key Set
      • Smart Investment Features
        • Crypto Transfers
          • List external addresses
          • Create deposit address
          • Update external address
          • Create withdrawal address
          • Create withdrawal address V2
          • List of VASPs
          • Validate crypto address
          • Update tax declaration status for a crypto deposit transaction
          • Create a crypto withdrawal offer
          • Confirm a withdrawal offer
          • Get public address verification details
          • Submit address verification result
        • Crypto Staking
          • Get staking overview
          • Get bonded overview
          • Stake a crypto asset
          • Stake a crypto asset V2
          • Unstake a crypto asset
          • Unstake a crypto asset V2
          • Get a staking action status
        • Savings Plans
          • Create a savings plan
          • Search for savings plans
          • Search for savings plans V2
          • Get savings plan next recurrence date.
          • Cancel a savings plan
          • Cancel a savings plan V2
          • Confirm a savings plan transaction
          • Confirm a savings plan transaction V2
          • Create a savings plan V2
        • Fiat Transfers
          • Initiate a fiat deposit
          • Create a payout account
          • Get payout accounts
          • Verify a payout account
          • Update a verification
          • Initiate a fiat withdrawal
          • List all fiat transfers per user
          • Get fiat transfer fees
          • Get fiat balances
          • Get deposit bank details
          • Initiate a bank fiat deposit
      • Settlements
        • List all available fiats per partner
        • Create a settlement deposit
        • Update the fiat stock
        • List all settlement transactions per partner
    • Webhooks
      • Overview
      • Setting up Webhooks
      • Handling Webhooks Events
        • User Updates Notifications
          • User Updates Notifications
        • Corporate Actions Notifications
          • Corporate Actions Notifications
          • Corporate Actions Notifications V2
        • Crypto Transfers Notifications
          • Deposit or withdrawal notification
        • Settlement Notifications
          • Send Money
          • Send Money V2
          • Send Money Success
          • Send Money Success V2
          • Top-Up Request
          • Top-Up Request V2
          • Top-Up Success
          • Top-Up Success V2
        • Non-user Initiated Transactions Notifications
          • Non-user Initiated Transactions
          • Non-user Initiated Transactions V2
          • Non-user Initiated Transactions V3
        • Savings Plans Notifications
          • Savings Plan Upcoming Trade
          • Savings Plan Upcoming Trade v2
          • Savings Plan Successful Trade
          • Savings Plan Failed Trade
          • Savings Plan Auto Cancel
          • Savings Transaction Updates
        • Crypto Actions Notifications
          • Crypto Actions Notifications
        • Report Notifications
          • Reports Notifications
        • Automated Orders Notifiations
          • Automated Orders Notifications
        • Proxy Voting
          • Proxy Voting Notifications
        • Fiat Transfers
          • Fiat transfer update notification
        • KYC
          • KYC Refresh Notification
        • Offer Status
          • Offer Status Notification
        • Financial Documents
          • User Financial Documents Notification
    • Websocket
      • Overview
      • Setting a Websocket
      • Websocket Server Documentation
    • Glosary
      • Key Terms and Definitions
    • Trades
      • List auto-conversions
  • Custody
    • Overview
      • Introduction
      • How TrustVault Works
      • Supported Assets
      • Environments
    • Getting Started
      • Getting Started
      • API Onboarding
      • Security
    • Tutorials
      • Create a Bitcoin Transaction
      • Create Ethereum Transaction GraphQL API
      • InfraOps
      • Organisation Management
      • TrustVault Node.js SDK
      • Change Wallet Policy API
      • Create an Ethereum Transaction
      • Create Transaction (Unsupported EVM chain)
      • Calculating Transaction Fee
      • Get User Portfolio
    • APIs
      • Trust API
      • Travel Rule API
      • Deprecations
    • Core Concepts
      • Webhooks
      • Address Book V2
      • Policies and Signing
      • Travel Rule API
      • Wallets and Sub-Wallets
    • Reference
      • Changelog
      • Understanding Bitcoin
      • Supported Ethereum Decoded Data
      • TrustVault Node.js SDK
      • Glossary
      • TrustVault Public Keys
  • Crypto Pay by Bitpanda
    • Overview
    • REST API Endpoints
      • Authentication
        • Obtain a Refresh and Access Tokens
        • Revoke a Refresh Token
      • Transactions
        • Get transaction details
        • Create a new transaction
        • Get transactions details
      • Get list of fiat currencies
  1. Tutorials

Change Wallet Policy API

What is a Policy#

Each wallet has an associated policy that dictates the keys which are allowed to spend from it (delegates) and the keys which are allowed to change the policy (recoverers, aka wallet admins). The spending key is called the Instruction Key and usually is kept in the secure enclave of the iPhone device that you onboarded with. However API users can change the Instruction Key so they sign transactions without the phone. See Policies and Signing for the full policy model.
This tutorial is for users who:
Wish to register their new Instruction Key (i.e. want to remove the iOS device from the signing process and manage their Instruction Key).
Already manage their own Instruction Key and wish to rotate it.

Brief outline of the process#

Note: This process only needs to be done once for every wallet owned. (Although you can create a single external key for use across ALL your wallets)
1.
Create a new public/private key pair on the correct curve as your signing key. (All transactions in future will be signed with this key)
For Production you MUST use a secure key storage solution (e.g. AWS KMS)
2.
Create a new wallet policy for your wallet that includes your new Instruction Key (Remember: policy changes are approved by the wallet admins (recoverers) only — the required recoverers, including Bitpanda Custody by default, MUST sign before the new wallet policy can be used)
1.
Creating a new wallet policy can be done in few different ways
Create the policy change via the SDK and use the sign callback to sign with your recoverer key
OR
Create the policy change via the GraphQL API and then call the AddSignature Mutation API endpoint to sign with your recoverer key
OR
Register your site to receive the POLICY_CHANGE_REQUEST_CREATED webhook (Ask Bitpanda Custody to set this up) and then ask Bitpanda Custody to create the policy change, wait for the webhook, and call the Add Signature Mutation API endpoint to sign with your recoverer key
3.
Which ever wallet policy change method is chosen, you will need to verify the response obtained from the policy change request is valid
1.
For testing purposes you can skip this step
2.
For Production we highly recommend you verify the data
4.
Sign the data with your recoverer (admin) key. This confirms that you, as a wallet admin, agree to the new wallet policy.
If your signing solution requires the pre-image data then use the unverifiedDigestData.signData and use the SHA256 hashing algorithm
If your signing solution can sign hash data then use the unverifiedDigestData.shaSignData
5.
Submit the recoverer public key and signature by calling the Add Signature Mutation mutation
6.
Repeat this for all wallets that need to be updated with the new Instruction Key

Creating the public/private key#

1.
The new keypair MUST be on the secp256r1 (also known as P-256 and prime256v1) curve. Please note this is the "r" curve (sometimes called the "p" curve) which is different to the "k" curve that Bitcoin or Ethereum uses.
if you use AWS KMS you should use the following parameters:
KeyType: Asymmetric
KeySpec: ECC_NIST_P256
Signing Algorithm: ECDSA_SHA_256
2.
To validate the curve you can use the SDK or the following tool to check (https://report-uri.com/home/pem_decoder) by uploading the public key PEM file. e.g.
-----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEI8zNvjURIX2LVEQn49icMqDaydvX
5ZLRxsL4M33gKAcZ4Nm4VlziXyyG2ddHCZ3vmp7UYtZGcr8Xa/8c4wuyYg==
-----END PUBLIC KEY-----
Gives the result:
Array
(
    [bits] => 256
    [key] => -----BEGIN PUBLIC KEY-----
MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEI8zNvjURIX2LVEQn49icMqDaydvX
5ZLRxsL4M33gKAcZ4Nm4VlziXyyG2ddHCZ3vmp7UYtZGcr8Xa/8c4wuyYg==
-----END PUBLIC KEY-----
    [ec] => Array
        (
            [curve_name] => prime256v1
            [curve_oid] => 1.2.840.10045.3.1.7
            [x] => 23cccdbe3511217d8b544427e3d89c32a0dac9dbd7e592d1c6c2f8337de02807
            [y] => 19e0d9b8565ce25f2c86d9d747099def9a9ed462d64672bf176bff1ce30bb262
        )

    [type] => 3
)
The prime256v1 confirms this is on the correct curve.
The x value and the y value can simply be concatenated with 04 at the front to produce the publicKey in the format TrustVault requires.
i.e:
0423cccdbe3511217d8b544427e3d89c32a0dac9dbd7e592d1c6c2f8337de0280719e0d9b8565ce25f2c86d9d747099def9a9ed462d64672bf176bff1ce30bb262

Creating the new Wallet Policy and Signing it#

There are two types of wallet Policy change process. The most common is a RECOVERY type. There is a special case called a ZERO. A ZERO request removes every delegate from a wallet without needing any signatures, so you can lock a wallet down straight away in an emergency.
Both are created in the same way and the system will automatically determine which type is required based on the input. This is summarised below:
delegateSchedulesrecovererSchedulesRequest typeResulting recoverersApproval required
[]Omitted, [], or same as currentZEROUnchangedNone
[]Different from currentRECOVERYNew recoverers + Bitpanda admins*Current and new recoverers
Non-emptyAnyRECOVERYNew (or current if omitted) + Bitpanda admins*Current and new recoverers
* When includeBitpandaAdmins is true (the default).
Schedules use the format [[{ "keys": ["04..."], "quorumCount": 1 }]].
New recoverers need a quorumCount of at least 2 and at least 2 unique keys.
Without a walletId, every wallet gets its own request.

Option 1 - Typescript (Javascript) example (used in conjunction with the SDK signed callback as a reference implementation)#

The Node.js SDK provides a reference implementation of how to use the GraphQL APIs and provides numerous helper methods such as webhook validation or DER encoding. (DER encoding is used for digest validation).

Option 2 - GraphQL to create the Wallet Policy Change#

If you don't want to use the SDK you can use the GraphQL endpoint with any language required.

Mutation#

Variables - Zero Delegate#

This request is passing in an empty array for delegateSchedules and recovererSchedules. This forces the system to determine that this is a ZERO request. i.e. the delegateSchedules and the recovererSchedules are both empty for the input. Since recovererSchedules cannot ever be empty (otherwise it's impossible to change the policy again) the system marks this as a ZERO. The request is to only change the delegateSchedules and make them empty. Thus the wallet is unspendable until a subsequent policy change is submitted and approved adding back a delegateSchedules
{
  "createChangePolicyRequestInput": {
    "walletId": "79f94368-d1ca-4503-9827-fa2f823fd33d",
    "delegateSchedules": [],
    "recovererSchedules": []
  }
}

Variables - Change Both Schedules#

This request will change both the recovererSchedules and the delegateSchedules. Note that new recoverers need a quorumCount of at least 2 and at least 2 unique keys.
{
  "createChangePolicyRequestInput": {
    "walletId": "79f94368-d1ca-4503-9827-fa2f823fd33d",
    "delegateSchedules": [
      [
        {
          "keys": [
            "04aed5365279f2da5bdbf8d6bdaa665a1bd3be96f2552774860cf35ecef88a1be043921d39199957d20cc9aadf61fc6e52303c75ee5f766a5c03ab1a72acb5198c"
          ],
          "quorumCount": 1
        }
      ]
    ],
    "recovererSchedules": [
      [
        {
          "keys": [
            "04aed5365279f2da5bdbf8d6bdaa665a1bd3be96f2552774860cf35ecef88a1be043921d39199957d20cc9aadf61fc6e52303c75ee5f766a5c03ab1a72acb5198c",
            "04fd8a5ac45dcdaa4a975e4cc1cc32d08c4f67705bd3bd61fe6d7e03f82af34c2881a287d625803d6ff4e7857904b75290e859f6c10f49f38f69fa77777672262a"
          ],
          "quorumCount": 2
        }
      ]
    ]
  }
}

Variables - Simple#

This creates a new delegateSchedule that includes a 1 of 1 for a single external key. Remember the key format should be that of a public key as defined in our glossary. i.e. An ECDSA public key in uncompressed hex format (first byte is always 04), exactly 130 hex characters. This will be the public Key obtained from your AWS KMS implementation.
For details on a more complex delegate schedule, or for how to find your walletId, please reach out for help.
{
  "createChangePolicyRequestInput": {
    "walletId": "79f94368-d1ca-4503-9827-fa2f823fd33d",
    "delegateSchedules": [
      [
        {
          "keys": [
            "04aed5365279f2da5bdbf8d6bdaa665a1bd3be96f2552774860cf35ecef88a1be043921d39199957d20cc9aadf61fc6e52303c75ee5f766a5c03ab1a72acb5198c"
          ],
          "quorumCount": 1
        }
      ]
    ]
  }
}
Once submitted you will have the requestId which you should save to use in the next mutation.

Add your signature to the wallet policy change#

Mutation#

mutation(
    $requestId: String!
    $publicKeySignaturePairs: [PublicKeySignaturePair!]!
) {
    addSignature(
        addSignatureInput: {
            requestId: $requestId
            signRequests: [
                {
                    publicKeySignaturePairs: $publicKeySignaturePairs
                }
            ]
        }
    ) {
        requestId
    }
}

Variables#

The requestId is obtained from the mutation to create the policy change.
the publicKey is your recoverer public key in the format mentioned above.
the signature is your signature in raw format. This should be the r and s value concatenated.
{
  "requestId": "e125d4ea-1ce5-0e69-275f-a11939c33e1a",
  "publicKeySignaturePairs": [
    {
      "publicKey": "04fd8a5ac45dcdaa4a975e4cc1cc32d08c4f67705bd3bd61fe6d7e03f82af34c2881a287d625803d6ff4e7857904b75290e859f6c10f49f38f69fa77777672262a",
      "signature": "2f660e6ae78cbfc33c21d1cd9ff9bc16f51b51163aa375ce1819aa8fdc199a2021dc85b41b86a7a5efc75b595dfa9b8d2e93553831cce86e4a727b6153dd253b"
    }
  ]
}

Finishing up#

Once you have created your new wallet policy and signed it with your recoverer key you will need to wait for any other required recoverers to sign the request.
Once they have all signed, the final step is for Bitpanda Custody (as a recoverer) to complete some checks before signing the change. Once that has been completed the new wallet policy is ready to be used for signing transactions.
NB: In our Pre-production environment Bitpanda Custody does not need to sign wallet change requests so they will be processed (if correctly signed) within a few minutes.
Modified at 2026-10-29 12:46:11
Previous
TrustVault Node.js SDK
Next
Create an Ethereum Transaction
Built with