# How to Build a Crypto Wallet — Non-Custodial, on One API

Ship a wallet where users keep their own keys. Generate an HD wallet, derive addresses from the extended public key, track balances and transactions across 20+ chains, and move funds by signing offline — all without running a node or ever holding a private key on your servers.

## Non-custodial by construction

The API only ever receives your *public* key and reads public on-chain data. Signing happens off the wire, with a key we never see.

## Build it in four steps

1. **Generate keys and sync the xPub.** Create the HD wallet in your app (any BIP-32/39/44 library) and take its extended public key (xPub). Sync the xPub once so it's indexed and kept up to date.
   `POST /hd-wallets/manage/{blockchain}/{network}/{xPub}/sync`
2. **Derive receiving addresses.** Derive a fresh, tracked address per user or deposit — using only the public key.
   `POST /hd-wallets/{evm|utxo}/{blockchain}/{network}/{xPub}/addresses/derive-and-sync`
3. **Track balances and transactions.** Read the wallet's aggregated balance and list its transactions, and [subscribe to webhooks](https://cryptoapis.io/guides/monitor-addresses-with-webhooks) for incoming payments so the wallet updates in real time.
   `GET /hd-wallets/{evm|utxo}/{blockchain}/{network}/{xPub}/details`
   `GET /hd-wallets/{evm|utxo}/{blockchain}/{network}/{xPub}/transactions`
4. **Send funds by signing offline.** Prepare an unsigned transaction from the HD wallet, sign it offline with the user's key (e.g. [@cryptoapis-io/offline-signer](https://www.npmjs.com/package/@cryptoapis-io/offline-signer)), then broadcast.
   `POST /hd-wallets/{evm|utxo}/{blockchain}/{network}/{xPub}/transactions/prepare` → sign offline → `POST /broadcast-transactions/…`

The same HD-wallet flow covers native coins and tokens (ERC-20, TRC-20 and more).

> Only need to receive crypto to an address you already control (not a full wallet)? The shorter path is [How to accept crypto payments](https://cryptoapis.io/guides/accept-crypto-payments).

## FAQ

**How do I build a crypto wallet with an API?** Generate an HD wallet, sync and derive receiving addresses from its xPub, and use CryptoAPIs to track balances and transactions and to prepare transactions for offline signing — across 20+ blockchains, with no node to run.

**Is a wallet built on CryptoAPIs custodial?** No. Keys are held in your app or on the user's device; CryptoAPIs only ever sees the extended public key and public on-chain data. Every send is signed offline.

**What is an HD wallet and xPub?** A hierarchical deterministic (HD) wallet derives many addresses from one seed. Its extended public key (xPub/yPub/zPub) can derive receiving addresses without exposing any private key — which is what lets CryptoAPIs track a wallet non-custodially.

**Which blockchains are supported?** Bitcoin, Ethereum, BSC, Polygon, XRP, Litecoin, Dogecoin and 20+ others, through the same unified API and HD-wallet model.

[Start building free](https://app.cryptoapis.io/auth/register) · [Wallet as a Service](https://cryptoapis.io/products/wallet-as-a-service)
