Runnable field recipe

Run your own Wallet Storage

Boot the maintained Wallet Infrastructure reference server and MySQL locally, then connect a BRC-100 wallet without giving the storage service custody of user keys.

Bring to the bench
  • Git
  • Docker with Compose
  • A free local port 8080
BRC-100BRC-42BRC-46BRC-62BRC-95BRC-116

Local runbook

Start it, then inspect it

  1. 01

    Fetch the reference stack

    Work from the official TypeScript stack so the server, wallet toolbox, and storage wire format stay aligned.

    Terminal
    git clone --depth 1 https://github.com/bsv-blockchain/ts-stack.git
    cd ts-stack/infra/wallet-infra
  2. 02

    Create a disposable identity and boot

    The included Compose file starts Wallet Infrastructure and MySQL. Database migrations run when the service starts.

    Terminal
    export SERVER_PRIVATE_KEY="$(openssl rand -hex 32)"
    docker compose up --build

    Boundary: Local development only: do not reuse this key, the sample database password, or the unmodified Compose topology in production.

  3. 03

    Check the service boundary

    Wait for both containers to become healthy, then verify the HTTP edge. The storage RPC itself uses mutual authentication rather than anonymous database-style access.

    Terminal
    curl --fail --show-error http://127.0.0.1:8080/
    # In a second terminal when finished:
    docker compose down

Code callout

Connect from Wallet Toolbox

Keep the example small enough to understand. Follow the linked source before adding funds, users, or public traffic.

TypeScript
import { SetupWallet } from '@bsv/wallet-toolbox'

const wallet = await SetupWallet({
  env: 'main',
  endpointUrl: 'http://127.0.0.1:8080'
})

const outputs = await wallet.listOutputs({
  basket: 'my application records',
  limit: 20
})

Carry it further

Turn the local proof into a deployment plan

Read before shipping

Wallet Infrastructure sourceWallet Toolbox storage documentationBRC-100 wallet interface