Blockstream Enterprise Custody SDK
RecipesWallets

Wallet Setup Prerequisites

Signer, XPUB, and address-generation prerequisites shared by every wallet type.

Complete Setup and Installation first.

This page assumes:

  • @blockstream/cryptic and @blockstream/ecs-registry are already configured
  • you have an authenticated user that can create signers and wallets
  • you use the request helper described in Making Requests

What every wallet flow needs

Before creating any wallet, make sure you have:

  1. an authenticated user or service
  2. permission to create signers and wallets
  3. a signer
  4. an XPUB derived for that signer

Create a signer

import { v4 as uuidv4 } from 'uuid'

const signerResult = await broadcastRequest({
  action: 'add',
  resource: '/signers',
  details: {
    sid: uuidv4(),
    name: 'my-signer',
    location: 'hosted',
  },
})

const signerId = signerResult.details.sid

Derive an XPUB

const xpubResult = await broadcastRequest({
  action: 'add',
  resource: `/signers/${signerId}/xpubs`,
  details: {
    id: uuidv4(),
    change: 'receive',
  },
})

const keyoriginXpub = xpubResult.details.keyorigin_xpub

Why XPUBs matter

XPUBs let the system derive addresses from a signer without exposing the private key material used for actual signing.

Generate addresses after wallet creation

const addressResult = await broadcastRequest({
  action: 'add',
  resource: `/wallets/${walletId}/addresses`,
  details: {
    type: 'receive',
    index: 1,
  },
})

const address = addressResult.details.address

Continue to the wallet-specific guides

On this page