Developer docs
Move crypto in both directions with one API. Receive payments into an address per customer, send payouts and withdrawals to anyone, and sweep funds to your treasury, with every outgoing transfer signed on your own machine.
On this page
Overview
BlocksReader is a REST API at https://api.blocksreader.com/v1 for receiving and sending crypto from self-custody wallets: your wallet is created by the BlocksReader Signer on your own server, and the same signer signs your payouts. Only you can move your funds.
ref. 22 networks.deposit.confirmed webhook the moment funds land.| Receive | Send | |
|---|---|---|
| Main call | POST /v1/addresses | POST /v1/payouts |
| You hear back by | deposit.confirmed webhook | payout.sent or payout.failed webhook |
| History | GET /v1/deposits | GET /v1/payouts |
| Networks | All 22 | 20: every network except Sui and Aptos |
| Test mode | Simulated deposits | Simulated signer: success, failure or manual approval |
Most products use both halves: customers top up through their own address, and withdraw or get paid out through payouts. You can build and test all of it for free with a test key, or let your AI coding assistant do it through the MCP server.
Quickstart
Receive a payment and send one out in about ten minutes. Everything here uses a free test key.
- Create your account. Sign up at app.blocksreader.com, verify your email and answer the short "Tell us about your business" questions. API keys start working once those are done.
- Copy your test key. Open API keys in the dashboard and copy the key starting with
br_test_. Keep it on your server only. - Create a test address.
bash
curl https://api.blocksreader.com/v1/addresses \ -H "Authorization: Bearer br_test_..." \ -H "Content-Type: application/json" \ -d '{ "chain": "tron", "ref": "customer_8431" }'response{ "success": true, "data": { "id": "adr_7Kq2mZp9XbR4tVnW", "chain": "tron", "asset": null, "address": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn", "destination_tag": null, "ref": "customer_8431", "label": null, "tag": null, "livemode": false, "created_at": "2026-11-24T10:00:00.000Z" } } - Register a webhook endpoint. It must be a public
httpsURL. For local development, a tunnel such ascloudflared tunnel --url http://localhost:3000works.Save thebashcurl https://api.blocksreader.com/v1/webhooks \ -H "Authorization: Bearer br_test_..." \ -H "Content-Type: application/json" \ -d '{ "url": "https://example.com/webhooks/blocksreader", "events": ["deposit.confirmed", "payout.sent", "payout.failed"] }'secret(whsec_...) from the response asBLOCKSREADER_WEBHOOK_SECRET. The API shows it only once. - Handle the webhook. Verify the signature and credit the customer once. Copy a handler from Verify signatures.
- Simulate a deposit.
Your endpoint receivesbash
curl https://api.blocksreader.com/v1/sandbox/deposits \ -H "Authorization: Bearer br_test_..." \ -H "Content-Type: application/json" \ -d '{ "address_id": "adr_7Kq2mZp9XbR4tVnW", "amount": "25", "asset": "USDT" }'deposit.confirmedat 1 confirmation after about 5 seconds, and again at 3 confirmations about 6 seconds later, exactly like live. - Send a payout. In test mode a simulated signer signs it for you.
It starts asbash
curl https://api.blocksreader.com/v1/payouts \ -H "Authorization: Bearer br_test_..." \ -H "Content-Type: application/json" \ -H "Idempotency-Key: withdrawal-1001" \ -d '{ "chain": "tron", "asset": "USDT", "to": "TXyz8rWkX2bJ3yHn5cPq1Vd7GfS9aV7abc", "amount": "10" }'pending, turnssenta few seconds later, and your endpoint receivespayout.sent. - Go live when you're ready: set up the BlocksReader Signer with Docker (it creates your wallet), then follow the go-live checklist.
Your wallet and signer
Going live starts here. Your wallet is created on your own server, and its keys never leave your control.
Test mode needs none of this. For live mode you run one piece of BlocksReader software, the BlocksReader Signer, with Docker on a server you control. It runs on Linux, Windows and Mac (amd64, arm64 and 32-bit ARM v7) and:
- creates your wallet and its seed phrase, or imports one you already have,
- adds your wallet's public keys to your account, so your addresses can be created and watched,
- signs your payouts and sweeps automatically.
1. Set up the signer
docker run --rm -it -v blocksreader_signer_data:/app/data blocksreader/blocksreader-signer:latest initSetup takes four steps:
- Seed phrase. Choose Create a new wallet. The signer shows your seed phrase once: write it on paper, then confirm you've saved it. Already have a seed phrase? Choose Type it manually instead.
- Passphrase. Choose a strong passphrase. It encrypts the seed phrase on this server, and the signer needs it every time it starts.
- API key. Paste your
br_live_key from API keys. The signer then appears under Signers & xpubs → Devices in the dashboard, where you can revoke it at any time. - Options. Choose BlocksReader dashboard for fund+sweep settings (recommended). Then say yes to adding your public keys: we email you a 6-digit code, and if two-factor authentication is on you also enter your authenticator code. You get an email listing the networks that were added. From then on you can create live addresses on those networks.
Skipped the public keys, or added a network later? Run sync-keys (below). It only ever adds keys; it never replaces one that's already on your account.
Your seed phrase is your money. Anyone who has it can move your funds, and if you lose it, nobody can recover them, including us. BlocksReader never sees it and will never ask for it. Don't store it in email, chat, cloud notes, a screenshot or on the server itself.
2. Start the signer
Payouts you create with POST /v1/payouts are signed by the signer, and so are sweeps. Without it running, live payouts stay pending. It checks for pending payouts every 30 seconds and signs them automatically.
# save the passphrase from setup in a file only you can read
umask 077; read -rsp 'Passphrase: ' PP; printf '%s' "$PP" > signer_passphrase.txt; unset PP; echo
# start it
docker run -d --name blocksreader-signer --restart unless-stopped \
-v blocksreader_signer_data:/app/data \
-v "$PWD/signer_passphrase.txt:/run/secrets/signer_passphrase:ro" \
-e SIGNER_PASSPHRASE_FILE=/run/secrets/signer_passphrase \
blocksreader/blocksreader-signer:latestOther signer commands
Run any of these with docker run --rm -it -v blocksreader_signer_data:/app/data blocksreader/blocksreader-signer:latest <command>.
| Command | What it does |
|---|---|
status | Checks the setup and the connection to BlocksReader |
sync-keys | Adds your wallet's public keys to your account (needs an emailed code) |
export-keys | Prints your public keys, to add by hand under Signers & xpubs → Add public key |
change-passphrase | Encrypts the stored seed phrase with a new passphrase |
configure | Chooses where fund+sweep and address-pool settings come from: BlocksReader dashboard (edit them on the Signer settings page) or This signer (set them here; keeps working if the dashboard can't be reached) |
generate-addresses | Adds addresses to your Solana or TON address pool right away, for a first fill or an extra top-up. Add --chain=solana or --chain=ton and --count=100 (1–1000) to skip the questions. The running signer also tops the pool up on its own |
The signer sends every pending payout. It doesn't ask anyone first. Put your limits (per withdrawal, per day, allowed destinations) in your own backend before calling POST /v1/payouts, and keep the server locked down: it holds your seed phrase, encrypted.
Authentication
Send your secret key as a Bearer token on every request:
curl https://api.blocksreader.com/v1/chains \
-H "Authorization: Bearer br_live_..."| Prefix | Mode | What happens |
|---|---|---|
br_test_ | Test | Simulated addresses, deposits and payouts. Real webhooks to your test endpoints. Free. |
br_live_ | Live | Real addresses on chain. Needs an active plan. |
The key decides the mode. There is no separate test URL. Find, reveal or roll keys under API keys in the dashboard. Rolling a key stops the old one immediately, so update your servers first.
Server-side only. A live key can create addresses and queue payouts. Keep it in an environment variable or secret manager, never in a mobile app, browser code or a public repo.
Response format
Every response uses the same envelope. Lists add pagination.
{ "success": true, "data": { ... } }
{ "success": true, "data": [ ... ], "pagination": { "page": 1, "limit": 20, "total": 57, "pages": 3 } }
{ "success": false, "error": { "code": "INVALID_CHAIN", "message": "Unknown chain. GET /v1/chains lists the supported values." } }Branch on error.code, which is stable. message is written for people and may change.
Conventions
- Amounts are strings in whole coin units (
"25.50"USDT,"0.0015"BTC). Never floats, wei or satoshis. Store them in an exact decimal column. - Chains use the
idfromGET /v1/chains, such astronorbsc. Short names likebtc,eth,bnbandtrxare accepted on input. - Times are ISO 8601 in UTC.
- IDs carry their type:
adr_address,po_payout,whk_webhook endpoint,evt_event,dlv_delivery. - Fields are
snake_case. New fields can appear at any time, so ignore ones you don't recognise.
Test mode
With a br_test_ key every endpoint works without touching a real chain. Test mode is free, needs no plan and never expires.
| Test mode | Live mode | |
|---|---|---|
| Key | br_test_... | br_live_... |
| Addresses | Simulated, on bitcoin, ethereum, bsc, tron | Derived from your wallet's public keys, all 22 chains |
| Deposits | You trigger them | Real transfers |
| Payouts | Simulated signer | Your BlocksReader Signer |
| Webhooks | Sent to test endpoints, same format as live | Sent to live endpoints |
| Cost | Free | Your plan |
Test and live data are completely separate. A webhook created with a test key only ever receives test events, and a live endpoint only receives live events.
Simulate a deposit
curl https://api.blocksreader.com/v1/sandbox/deposits \
-H "Authorization: Bearer br_test_..." \
-H "Content-Type: application/json" \
-d '{ "address_id": "adr_7Kq2mZp9XbR4tVnW", "amount": "25", "asset": "USDT", "confirm_after_seconds": 10 }'| Field | Notes |
|---|---|
address_id or address | A test address you created |
amount | String in coin units. Default "10" |
asset | The native coin (default), USDT or USDC |
contract | For any other token, its contract address |
confirm_after_seconds | Delay before the first event, 0 to 60. Default 5. The second event follows 6 seconds later |
Simulate payouts
Create a payout with a test key and a simulated signer handles it. Pick the outcome with simulate:
simulate | Result |
|---|---|
sent (default) | Becomes sent with a fake tx_hash after sign_after_seconds (max 60), then payout.sent fires |
failed | Becomes failed with a failure_reason, then payout.failed fires |
manual | Stays pending until you approve or reject it |
curl https://api.blocksreader.com/v1/payouts \
-H "Authorization: Bearer br_test_..." \
-H "Content-Type: application/json" \
-d '{ "chain": "tron", "asset": "USDT", "to": "TXyz8rWkX2bJ3yHn5cPq1Vd7GfS9aV7abc", "amount": "10", "simulate": "manual" }'
# act as the signer
curl -X POST https://api.blocksreader.com/v1/sandbox/payouts/po_test_8Hn2Kd4mQx7VbR1tLp9s/approve \
-H "Authorization: Bearer br_test_..."
curl -X POST https://api.blocksreader.com/v1/sandbox/payouts/po_test_8Hn2Kd4mQx7VbR1tLp9s/reject \
-H "Authorization: Bearer br_test_..." \
-H "Content-Type: application/json" \
-d '{ "reason": "Amount over daily limit" }'Prefer clicking? The Sandbox and Payouts pages in the dashboard do the same with buttons. Switch the dashboard to Test first.
Addresses
Live addresses are derived from your wallet's public keys, so only you can spend from them. Before creating live addresses on a network, its public keys must be on your account. The signer adds them during setup, or later with sync-keys. Otherwise you get XPUB_REQUIRED.
Create an address
curl https://api.blocksreader.com/v1/addresses \
-H "Authorization: Bearer br_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: signup-customer-8431-bsc" \
-d '{ "chain": "bsc", "ref": "customer_8431", "label": "Jane D." }'| Field | Required | Notes |
|---|---|---|
chain | yes | From supported chains |
ref | no | Your customer or order id (max 120). Comes back on every deposit and event for this address |
label | no | Display name (max 120) |
tag | no | Free-form grouping (max 60) |
- One address per customer per chain is the usual pattern. Store it and show it on your deposit page forever.
- One address per order also works: set
refto the order id. - No asset to choose. An address receives the network’s coin and every token on it (USDT, USDC and any token you add). Each deposit tells you what arrived.
XRP destination tags and TON memos
On XRP all your addresses share one account, and each customer gets their own destination_tag:
{ "id": "adr_3Rt8Vn2kQm7XbL4p", "chain": "xrp", "address": "rN7n7otQDd6FczFgLdSqtcsAUxDkw6fzRH", "destination_tag": 104839, "ref": "customer_8431" }Show the tag to your customer. Senders must include it. A payment without the tag can't be matched to a customer. Deposits that use a TON comment carry it as memo.
Balances
GET /v1/addresses/balances?chain=tron returns the addresses on that network that hold funds, with the coin and each token. Addresses not listed hold nothing. Live mode only; refreshed about every 30 seconds.
{
"success": true,
"data": [
{
"address": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"native": { "asset": "TRX", "amount": "12.5" },
"tokens": [ { "symbol": "USDT", "contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t", "amount": "250.75" } ],
"updated_at": "2026-11-24T10:02:11.000Z"
}
]
}List and find
# all Tron addresses for one customer
curl "https://api.blocksreader.com/v1/addresses?chain=tron&ref=customer_8431" -H "Authorization: Bearer br_live_..."
# look up by on-chain address
curl "https://api.blocksreader.com/v1/addresses?address=TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn" -H "Authorization: Bearer br_live_..."
# one address by id
curl https://api.blocksreader.com/v1/addresses/adr_7Kq2mZp9XbR4tVnW -H "Authorization: Bearer br_live_..."Deposits
Webhooks tell you about deposits in real time. GET /v1/deposits gives you the history, for your UI and for a catch-up job. A live key returns real deposits, a test key returns test deposits.
curl "https://api.blocksreader.com/v1/deposits?chain=tron&status=confirmed&limit=50" \
-H "Authorization: Bearer br_live_..."{
"success": true,
"data": [
{
"id": "6741f0c2a9e1b8d4c3f2a1b0",
"tx_hash": "9f3c1e...a07b",
"chain": "tron",
"address": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"from_address": "TFj2...",
"to_address": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"destination_tag": null,
"address_id": "adr_7Kq2mZp9XbR4tVnW",
"ref": "customer_8431",
"amount": "25",
"asset": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"type": "token",
"symbol": "USDT",
"confirmations": 19,
"status": "confirmed",
"livemode": true,
"created_at": "2026-11-24T10:02:11.000Z"
}
],
"pagination": { "page": 1, "limit": 50, "total": 1, "pages": 1 }
}| Field | Meaning |
|---|---|
type | native (the chain's coin) or token |
asset | For native deposits, the coin symbol (BTC, ETH, TRX). For tokens, the token contract (lowercase 0x on EVM, base58 on Tron and Solana) |
symbol | Human symbol such as USDT, when known |
amount | Already in coin units, as a string |
status | pending, confirmed (check confirmations if you wait for more than 1) or failed |
The catch-up job
Webhooks can be missed during a deploy or an outage on your side. Run a job every few minutes that pages through GET /v1/deposits?status=confirmed (newest first), goes back over a fixed window such as the last 48 hours, and passes every deposit through the same idempotent path as your webhook handler. Don't stop at the first deposit you've already credited: an older one may still be missing.
Credit exactly once. Use (chain, tx_hash, address) as the key, with a unique constraint in your database, and credit inside the same transaction that inserts the row. That one rule makes repeated webhooks, retries and the catch-up job all safe. A transaction that pays the same address more than once is rare, but only the first payment is credited under this key, so compare credited totals with your balances regularly.
Tokens
Popular tokens such as USDT and USDC are detected out of the box on the chains that carry them (TRC-20, BEP-20, ERC-20, SPL, Jettons and more). To detect another token, add it with a live key. Tokens aren't available on Bitcoin, Litecoin, Dogecoin or XRP.
# built-in and custom tokens on a chain (any key)
curl "https://api.blocksreader.com/v1/assets?chain=bsc" -H "Authorization: Bearer br_live_..."
# add a custom token (live key, active plan)
curl https://api.blocksreader.com/v1/assets \
-H "Authorization: Bearer br_live_..." \
-H "Content-Type: application/json" \
-d '{ "chain": "bsc", "contract": "0x...", "symbol": "ABC", "name": "ABC Token" }'
# pause or resume detection
curl -X PATCH https://api.blocksreader.com/v1/assets/bsc/0x... \
-H "Authorization: Bearer br_live_..." -H "Content-Type: application/json" -d '{ "enabled": false }'
# remove it
curl -X DELETE https://api.blocksreader.com/v1/assets/bsc/0x... -H "Authorization: Bearer br_live_..."decimals is read from the contract when you leave it out. The contract format depends on the chain: a contract address on EVM and Tron, the mint on Solana, the jetton master on TON, and the coin type on Sui and Aptos.
Payouts
Send crypto to any address: customer withdrawals, refunds, supplier and partner payments, payroll, or moving funds between your own wallets.
A payout never moves on our say-so. Your server asks, your own signer signs:
- Your server calls
POST /v1/payouts. The payout ispending. - Your BlocksReader Signer picks it up within about 30 seconds and signs it on your server, from the
fromaddress. - The signed transaction is broadcast, the payout becomes
sentwith atx_hash, andpayout.sentfires.
Keep your signer running. Live payouts stay pending until the BlocksReader Signer signs them, so run it on a server that stays up. The sending address needs the funds plus the network fee.
Create a payout
Payouts are created with the API. The dashboard lists them and shows their status.
curl https://api.blocksreader.com/v1/payouts \
-H "Authorization: Bearer br_live_..." \
-H "Content-Type: application/json" \
-H "Idempotency-Key: withdrawal-55102" \
-d '{
"chain": "tron",
"asset": "USDT",
"from": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"to": "TXyz8rWkX2bJ3yHn5cPq1Vd7GfS9aV7abc",
"amount": "125.50"
}'{
"success": true,
"data": {
"id": "po_6afc8279cc8a87f039265e17",
"object": "payout",
"livemode": true,
"chain": "tron",
"type": "token",
"asset": "USDT",
"amount": "125.50",
"to": "TXyz8rWkX2bJ3yHn5cPq1Vd7GfS9aV7abc",
"from": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"contract": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"decimals": 6,
"memo": null,
"destination_tag": null,
"status": "pending",
"tx_hash": null,
"failure_reason": null,
"created_at": "2026-11-24T10:05:00.000Z",
"updated_at": "2026-11-24T10:05:00.000Z"
}
}| Field | Required | Notes |
|---|---|---|
chain | yes | Any supported chain except sui and aptos |
to | yes | Destination address |
amount | yes | Coin units as a string, such as "125.50" |
asset | no | What to send: the chain's coin (the default, for example TRX) or a token symbol such as USDT. For tokens we fill in the contract and decimals from GET /v1/assets |
contract, decimals | no | Only when the symbol is ambiguous or the token isn't in GET /v1/assets |
type | no | native or token. Worked out from asset and contract |
from | live: yes | The address of yours that holds the funds (on XRP, your XRP account address). Your signer signs with that address's key. Optional in test mode |
memo | no | TON comment, when the receiver (often an exchange) asks for one |
destination_tag | no | XRP tag the receiver asked for |
Always send an Idempotency-Key. Use your own withdrawal id. If the request times out, retry with the same key within 24 hours, one attempt at a time, and you get the original payout back. After 24 hours the same key creates a new payout, and a 5xx response isn't remembered. In both cases, check GET /v1/payouts for the same address and amount before you send again.
Statuses
status | Meaning |
|---|---|
pending | Waiting for your signer |
signed | Signed, about to be broadcast |
sent | Broadcast. tx_hash is set. payout.sent fires |
failed | Not sent, see failure_reason. No funds left your wallet. payout.failed fires |
# one payout
curl https://api.blocksreader.com/v1/payouts/po_6afc8279cc8a87f039265e17 -H "Authorization: Bearer br_live_..."
# everything still waiting for your signer
curl "https://api.blocksreader.com/v1/payouts?status=pending" -H "Authorization: Bearer br_live_..."Both events carry payout_id, so you can match them to your own withdrawal record. A payout that stays pending for a long time usually means your signer is offline.
Customer withdrawals
If your customers hold a balance with you (an exchange, wallet, game or marketplace), this is the pattern that keeps balances correct whatever happens on the network:
- Reserve the funds first. In one database transaction, check the balance, subtract the amount (plus any fee you charge) and create a
withdrawalsrow with statusprocessing. - Create the payout with
Idempotency-Keyset to that row's id, and store the returnedpo_id on the row. Lock the row so only one attempt runs at a time. If the call times out, retry with the same key within 24 hours. After a5xxerror, or later than that, checkGET /v1/payoutsfirst so you never pay twice. - Mark it complete on
payout.sent, saving thetx_hashso you can show the customer a link to the transaction. - Refund on failure. On
payout.failed, put the amount back on the customer's balance and tell them. As a safety net, a job can also checkprocessingwithdrawals withGET /v1/payouts/{id}in case a webhook was missed.
Validate before you send. Check the address format for the chain, ask for the XRP destination tag or TON memo when the receiver is an exchange, and set your own limits (per withdrawal, per day) before calling the API. A sent transaction can't be reversed.
Sweeps and gas
With one address per customer, received funds are spread across many addresses. A sweep collects them into one wallet you choose, ready for payouts or cold storage.
Sweeps run automatically with the BlocksReader Signer, around the clock.
Automatic sweeps are set up in the dashboard under Signer settings (two-factor authentication required), per network:
- Receiver address: where swept funds go. You can set a different receiver per asset.
- Assets to sweep and the minimum amount worth sweeping for each.
- Gas tank (funder) address: moving tokens such as USDT needs a little of the chain's coin for the network fee. Your signer tops up addresses that hold tokens from this address before sweeping them, using the minimum balance and top-up amount you set.
- How often it runs, from every minute to every hour, and a switch to stop sweeping at any time.
Your signer picks up the new settings on its next run.
Either way, every sweep is signed with your own keys, on your own machine.
Webhooks
Add endpoints in the dashboard under Webhooks, or with the API:
curl https://api.blocksreader.com/v1/webhooks \
-H "Authorization: Bearer br_live_..." \
-H "Content-Type: application/json" \
-d '{ "url": "https://example.com/webhooks/blocksreader", "events": ["deposit.confirmed", "payout.sent"], "description": "Production" }'- The response contains
secret(whsec_...) once. You can view it again in the dashboard, or replace it withPOST /v1/webhooks/{id}/roll-secret. - URLs must be
httpsand resolve to a public address. Redirects are not followed. - Up to 10 endpoints per mode. Leave out
events, or send["*"], to receive everything. - Pause an endpoint with
PATCH /v1/webhooks/{id}and{ "enabled": false }.
Event types
| Type | When |
|---|---|
deposit.confirmed | A deposit reached 1 confirmation, and again when it reaches 3. This is the event to credit on. |
payout.sent | Your signer signed and broadcast a payout. Sent once per payout. Mark the withdrawal complete now. |
payout.failed | A payout couldn't be sent (see failure_reason). No funds left your wallet. Refund the withdrawal. |
deposit.pending | Reserved. You can subscribe to it, but it isn't sent today. Use deposit.confirmed |
The request
POST /webhooks/blocksreader HTTP/1.1
Content-Type: application/json
User-Agent: BlocksReader-Webhooks/1.0
BR-Webhook-Signature: t=1795516630,v1=5f2b9c0d...e81a
BR-Webhook-Id: evt_2Lm8Qx4nRt7VbW1k
BR-Webhook-Type: deposit.confirmed
{
"id": "evt_2Lm8Qx4nRt7VbW1k",
"type": "deposit.confirmed",
"livemode": true,
"created_at": "2026-11-24T10:02:11.000Z",
"data": {
"chain": "tron",
"address": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"from_address": "TFj2...",
"to_address": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"tx_hash": "9f3c1e...a07b",
"amount": "25",
"asset": "TR7NHqjeKQxGTCi8q8ZY4pL8otSzgjLj6t",
"type": "token",
"confirmations": 1,
"address_id": "adr_7Kq2mZp9XbR4tVnW",
"ref": "customer_8431",
"amount_usd": "25.00"
}
}Deposit data always has chain, address, tx_hash, amount, asset, type and confirmations. It adds from_address, to_address, address_id, ref and tag when known, destination_tag on XRP, memo for TON comments, and amount_usd (2 decimals) when a price is available. As with deposits, a token's asset is its contract: map it to a symbol with GET /v1/assets.
payout.sent and payout.failed data: payout_id, status, chain, type, asset, contract, amount, to, from, memo, destination_tag, tx_hash (sent) and failure_reason (failed).
{
"id": "evt_9Pq3Lm7xKt2VbW8n",
"type": "payout.sent",
"livemode": true,
"created_at": "2026-11-24T10:05:41.000Z",
"data": {
"payout_id": "po_6afc8279cc8a87f039265e17",
"chain": "tron",
"asset": "USDT",
"amount": "125.50",
"to": "TXyz8rWkX2bJ3yHn5cPq1Vd7GfS9aV7abc",
"from": "TQ4mZ8rWkX2bJ3yHn5cPq1Vd7GfS9aV7pn",
"tx_hash": "4be1a9...c33d"
}
}Two events per deposit, credit once. Each deposit sends deposit.confirmed twice (at 1 and 3 confirmations), each with its own event id. Deduplicate on (chain, tx_hash, address), not on the event id. Events can also arrive out of order or more than once after retries.
Responding and retries
- Answer with any 2xx within 10 seconds. Do slow work in a background job after replying.
- Anything else (non-2xx, timeout, connection or TLS error) is retried with growing delays, 11 attempts over about a day. After the last one the delivery is marked
failed. - Re-send a delivery any time with
POST /v1/webhooks/deliveries/{id}/retryor from the dashboard.
Debugging
POST /v1/webhooks/{id}/testsends a sampledeposit.confirmed(with"test": trueindata).GET /v1/webhooks/{id}/deliveriesshows every attempt: your HTTP status, response time and error. Kept for 90 days.GET /v1/eventslists every event (filter with?type=) so you can catch up after downtime.- Most failures are one of: replying with something other than 2xx, taking longer than 10 seconds, re-serialising the JSON before checking the signature, using the secret of a different endpoint, or a test-key webhook waiting for live deposits.
Verify signatures
BR-Webhook-Signature looks like t=<unix seconds>,v1=<hex>. v1 is HMAC-SHA256 of "<t>.<raw request body>" keyed with your endpoint secret.
- Read the raw body bytes. Don't parse and re-serialise the JSON first.
- Compute the HMAC and compare in constant time.
- Reject if
tis more than 300 seconds away from now.
import crypto from 'node:crypto';
import express from 'express';
const app = express();
const SECRET = process.env.BLOCKSREADER_WEBHOOK_SECRET; // whsec_...
app.post('/webhooks/blocksreader', express.raw({ type: 'application/json' }), async (req, res) => {
const header = String(req.get('BR-Webhook-Signature') || '');
const parts = Object.fromEntries(header.split(',').map((p) => p.split('=')));
const t = Number(parts.t);
if (!t || Math.abs(Date.now() / 1000 - t) > 300) return res.sendStatus(401);
const expected = crypto.createHmac('sha256', SECRET).update(`${t}.${req.body}`).digest('hex');
const got = String(parts.v1 || '');
if (got.length !== expected.length ||
!crypto.timingSafeEqual(Buffer.from(got), Buffer.from(expected))) return res.sendStatus(401);
const event = JSON.parse(req.body);
if (event.type === 'deposit.confirmed') {
// INSERT ... ON CONFLICT (chain, tx_hash, address) DO NOTHING,
// and credit event.data.ref only if a row was inserted.
} else if (event.type === 'payout.sent') {
// mark the withdrawal with event.data.payout_id completed, save tx_hash
} else if (event.type === 'payout.failed') {
// refund the withdrawal with event.data.payout_id
}
// reply once it's saved, within 10 seconds (an error reply is retried); do slow work in a background job
res.sendStatus(200);
});import hmac, hashlib, json, os, time
from flask import Flask, request, abort
app = Flask(__name__)
SECRET = os.environ["BLOCKSREADER_WEBHOOK_SECRET"].encode()
@app.post("/webhooks/blocksreader")
def blocksreader_webhook():
raw = request.get_data() # raw bytes
header = request.headers.get("BR-Webhook-Signature", "")
parts = dict(p.split("=", 1) for p in header.split(",") if "=" in p)
t = int(parts.get("t", "0"))
if abs(time.time() - t) > 300:
abort(401)
expected = hmac.new(SECRET, f"{t}.".encode() + raw, hashlib.sha256).hexdigest()
if not hmac.compare_digest(expected, parts.get("v1", "")):
abort(401)
event = json.loads(raw)
if event["type"] == "deposit.confirmed":
pass # insert on (chain, tx_hash, address) unique; credit only if new
elif event["type"] == "payout.sent":
pass # mark the withdrawal with data["payout_id"] completed, save tx_hash
elif event["type"] == "payout.failed":
pass # refund the withdrawal with data["payout_id"]
return "", 200// routes/api.php: no CSRF there, and the URL to register is https://example.com/api/webhooks/blocksreader
Route::post('/webhooks/blocksreader', function (Illuminate\Http\Request $request) {
parse_str(str_replace(',', '&', (string) $request->header('BR-Webhook-Signature')), $p);
$t = (int) ($p['t'] ?? 0);
abort_if(abs(time() - $t) > 300, 401);
$expected = hash_hmac('sha256', $t . '.' . $request->getContent(), config('services.blocksreader.webhook_secret'));
abort_unless(hash_equals($expected, (string) ($p['v1'] ?? '')), 401);
$event = json_decode($request->getContent(), true);
if ($event['type'] === 'deposit.confirmed') {
// DB::transaction: insertOrIgnore on (chain, tx_hash, address); credit only if inserted
} elseif ($event['type'] === 'payout.sent') {
// mark the withdrawal with $event['data']['payout_id'] completed, save tx_hash
} elseif ($event['type'] === 'payout.failed') {
// refund the withdrawal with $event['data']['payout_id']
}
return response()->noContent(200);
});func blocksreaderWebhook(w http.ResponseWriter, r *http.Request) {
raw, _ := io.ReadAll(r.Body)
parts := map[string]string{}
for _, kv := range strings.Split(r.Header.Get("BR-Webhook-Signature"), ",") {
if k, v, ok := strings.Cut(kv, "="); ok {
parts[k] = v
}
}
t, _ := strconv.ParseInt(parts["t"], 10, 64)
if d := time.Now().Unix() - t; d > 300 || d < -300 {
http.Error(w, "stale", http.StatusUnauthorized)
return
}
mac := hmac.New(sha256.New, []byte(os.Getenv("BLOCKSREADER_WEBHOOK_SECRET")))
fmt.Fprintf(mac, "%d.", t)
mac.Write(raw)
expected := hex.EncodeToString(mac.Sum(nil))
if !hmac.Equal([]byte(expected), []byte(parts["v1"])) {
http.Error(w, "bad signature", http.StatusUnauthorized)
return
}
w.WriteHeader(http.StatusOK)
// json.Unmarshal(raw, &event); deposit.confirmed: credit once per (chain, tx_hash, address)
// payout.sent: mark the withdrawal with data.payout_id completed; payout.failed: refund it
}Build with AI: the MCP server
Connect your AI coding assistant (Claude Code, Cursor, VS Code, Claude and others) to BlocksReader through the Model Context Protocol. It can read this guide, create test addresses, simulate deposits, create and approve test payouts, register webhooks and read delivery logs, then write and test both your deposit flow and your withdrawal flow for your stack.
| Server URL | https://api.blocksreader.com/mcp |
|---|---|
| Transport | Streamable HTTP |
| Sign-in | Authorization: Bearer br_test_... header, or OAuth (you paste your key on a BlocksReader sign-in page) |
Safe by design. The server acts with your API key and can only do what that key can. It cannot create live payouts: those always need your own signer. A test key only sees test data and sandbox tools, so start there.
Connect your tool
Copy your test key from API keys in the dashboard, then add the server:
Claude Code
claude mcp add --transport http blocksreader https://api.blocksreader.com/mcp \
--header "Authorization: Bearer br_test_YOUR_KEY"Or leave out --header and run /mcp in Claude Code to sign in through the browser.
Claude (claude.ai and desktop)
- Open Settings → Connectors → Add custom connector.
- Name it BlocksReader and paste
https://api.blocksreader.com/mcpas the URL. - Click Connect. A BlocksReader page opens: paste your API key and continue.
Any other app that supports remote MCP servers with OAuth sign-in works the same way.
Cursor
{
"mcpServers": {
"blocksreader": {
"url": "https://api.blocksreader.com/mcp",
"headers": { "Authorization": "Bearer br_test_YOUR_KEY" }
}
}
}VS Code
{
"servers": {
"blocksreader": {
"type": "http",
"url": "https://api.blocksreader.com/mcp",
"headers": { "Authorization": "Bearer br_test_YOUR_KEY" }
}
}
}Other clients (stdio only)
npx -y mcp-remote https://api.blocksreader.com/mcp \
--header "Authorization:Bearer br_test_YOUR_KEY"Keep keys out of git. Project files like .cursor/mcp.json are often committed. Add them to .gitignore, or use your tool's user-level config instead. Rolling your API key disconnects every OAuth session made with it.
Tools and commands
The tools you see depend on the key you connect with.
| Tool | What it does | Test | Live |
|---|---|---|---|
get_integration_guide | The integration guide by topic (overview, webhooks, deposits, addresses, sandbox, payouts, tokens, errors, all), with signature code | ✓ | ✓ |
whoami | Which mode the connected key is in | ✓ | ✓ |
list_chains, get_prices | Supported chains, current USD prices | ✓ | ✓ |
create_address, list_addresses, get_address | Deposit addresses | ✓ | ✓ |
list_deposits, list_events | Deposit history and generated events | ✓ | ✓ |
list_payouts, get_payout | Payout status (read only) | ✓ | ✓ |
list_webhooks, create_webhook, update_webhook, delete_webhook, roll_webhook_secret | Manage endpoints | ✓ | ✓ |
test_webhook, get_webhook_deliveries, retry_webhook_delivery | Send a test event, read the delivery log, re-send | ✓ | ✓ |
list_tokens | Built-in and custom tokens | ✓ | ✓ |
add_token, set_token_enabled, remove_token | Custom token detection | ✓ | |
sandbox_simulate_deposit | Fake a deposit to a test address | ✓ | |
sandbox_create_payout, sandbox_resolve_payout | Test payouts and act as the signer | ✓ |
Ready-made commands
The server ships guided prompts. For withdrawals, ask in your own words as in the examples below. In Claude Code they appear as slash commands (the middle part is the name you gave the server); other tools list them as prompts.
| Command | What it does |
|---|---|
/mcp__blocksreader__integrate_deposits | Adds the receiving side to your project end to end: data model, address creation, signed webhook handler with credit-once logic, catch-up job, env config, tests, then proves it in the sandbox. Optional arguments: stack, chains, assets |
/mcp__blocksreader__debug_webhooks | Finds out why webhooks fail or don't arrive, using the delivery log and your handler code, and fixes it |
/mcp__blocksreader__go_live_checklist | Reviews your integration against the go-live checklist with file references |
Things to ask
- "Add BlocksReader USDT deposits on Tron and BNB Chain to this app. Verify webhook signatures, credit each user once, and add a catch-up job using /v1/deposits."
- "Create a test Tron address for user 42 and simulate a 25 USDT deposit. Did my endpoint answer 200?"
- "Add USDT withdrawals: reserve the balance, create a payout with the withdrawal id as Idempotency-Key, complete it on payout.sent and refund it on payout.failed. Test success, failure and manual approval in the sandbox."
- "My webhook isn't firing. Check the delivery log and tell me why."
All endpoints
Base URL https://api.blocksreader.com. All accept a test or live key unless noted.
| Endpoint | Purpose |
|---|---|
GET/v1/chains | Supported chains (no key needed) |
GET/v1/prices | Current USD prices |
POST/v1/addresses | Create an address. Idempotency-Key supported |
GET/v1/addresses | List. Filters chain, ref, address, destination_tag |
GET/v1/addresses/{id} | One address |
GET/v1/addresses/balances | Funded addresses on a network, with coin and token balances (live) |
GET/v1/deposits | Deposit history. Filters chain, status |
POST/v1/payouts | Queue a payout for your signer. Idempotency-Key supported |
GET/v1/payouts | List. Filters status, chain |
GET/v1/payouts/{id} | One payout |
GET/v1/webhooks | List endpoints |
POST/v1/webhooks | Create. Returns the secret once |
PATCH/v1/webhooks/{id} | Change url, events, description, enabled |
DELETE/v1/webhooks/{id} | Delete |
POST/v1/webhooks/{id}/roll-secret | New secret. The old one stops working at once |
POST/v1/webhooks/{id}/test | Send a sample event |
GET/v1/webhooks/{id}/deliveries | Delivery log |
POST/v1/webhooks/deliveries/{id}/retry | Re-send one delivery |
GET/v1/events | All events. Filter type |
GET/v1/assets | Tokens. Filter chain |
POST/v1/assets | Add a custom token (live key, plan) |
PATCH/v1/assets/{chain}/{contract} | Enable or disable (live key) |
DELETE/v1/assets/{chain}/{contract} | Remove (live key) |
POST/v1/sandbox/deposits | Simulate a deposit (test key) |
POST/v1/sandbox/payouts/{id}/approve | Approve a manual test payout (test key) |
POST/v1/sandbox/payouts/{id}/reject | Reject a manual test payout (test key) |
API keys and billing are managed in the dashboard only.
Errors
Errors use normal HTTP status codes and a stable error.code.
| HTTP | code | What to do |
|---|---|---|
| 400 | INVALID_INPUT | A field is missing or malformed. See message |
| 400 | INVALID_CHAIN | Use an id from GET /v1/chains |
| 400 | INVALID_AMOUNT | Send a positive number string, such as "25.50" |
| 400 | INVALID_ASSET | Unknown or ambiguous token for this chain. Pass contract, or add it with POST /v1/assets |
| 400 | INVALID_URL | Webhook URL must be public https |
| 400 | INVALID_EVENTS | Use the event types above |
| 400 | INVALID_JSON | Check Content-Type and the body |
| 400 | INVALID_IDEMPOTENCY_KEY | Keep it under 200 characters |
| 400 | LIMIT_REACHED | 10 webhook endpoints already exist in this mode |
| 400 | XPUB_REQUIRED | Run sync-keys on your signer to add the network's public keys |
| 401 | UNAUTHORIZED | Send Authorization: Bearer br_... |
| 401 | INVALID_API_KEY | Key is wrong or was rolled. Copy the current one |
| 402 | PLAN_REQUIRED | Choose a plan on the Billing page |
| 402 | BILLING_SUSPENDED | Renew or settle on the Billing page |
| 403 | ONBOARDING_REQUIRED | Sign in to the dashboard and finish the setup questions |
| 403 | ACCOUNT_SUSPENDED | Contact support |
| 403 | PLAN_LIMIT_REACHED | Your plan's address or webhook limit. Upgrade |
| 403 | TEST_ONLY / LIVE_ONLY | Use the other key |
| 403 | DASHBOARD_ONLY | Do it in the dashboard |
| 404 | NOT_FOUND | Check the id, and that you're using the right mode's key |
| 409 | IDEMPOTENCY_KEY_REUSED | Use a new key per operation |
| 409 | PAYOUT_NOT_PENDING | The test payout was already resolved |
| 502 | UPSTREAM_ERROR | Temporary. Retry with backoff and the same Idempotency-Key |
| 503 | ACCOUNT_NOT_READY | New account still being set up. Retry in a minute |
| 500 | INTERNAL_ERROR | Retry. If it continues, contact support |
A 404 for an id you know exists usually means you used the other mode's key: objects belong to one mode.
Pagination and retries
Pagination
List endpoints take page (default 1) and limit (default 20, max 100), and return newest first. total and pages can be null when a count isn't available: keep paging until a page has fewer items than limit.
Idempotency
Send an Idempotency-Key header on POST /v1/addresses and POST /v1/payouts. Repeating the request with the same key within 24 hours returns the original response with Idempotent-Replayed: true, and nothing new is created.
- Use a value unique to the operation, such as your withdrawal id or a UUID. Max 200 characters.
- Keys are per mode. Reusing one on a different endpoint returns
409 IDEMPOTENCY_KEY_REUSED. - Server errors (
5xx) aren't stored, so a retry after one runs again. For payouts, checkGET /v1/payoutsfirst. - Send one attempt at a time: two requests with the same key at the same moment aren't guaranteed to be merged.
Retrying safely
Retry 5xx errors and timeouts with exponential backoff (for payouts, check GET /v1/payouts before each retry). Don't retry 4xx errors without changing the request.
Supported chains
Use the id wherever the API asks for chain. GET /v1/chains always has the current list.
| id | Chain | native_asset | Deposits | Payouts |
|---|---|---|---|---|
bitcoin | Bitcoin | BTC | ✓ | ✓ |
ethereum | Ethereum | ETH | ✓ | ✓ |
bsc | BNB Chain | BNB | ✓ | ✓ |
tron | Tron | TRX | ✓ | ✓ |
base | Base | BASE | ✓ | ✓ |
ton | TON | TON | ✓ | ✓ |
xrp | XRP Ledger | XRP | ✓ | ✓ |
litecoin | Litecoin | LTC | ✓ | ✓ |
dogecoin | Dogecoin | DOGE | ✓ | ✓ |
solana | Solana | SOL | ✓ | ✓ |
polygon | Polygon | POL | ✓ | ✓ |
arbitrum | Arbitrum | ARB | ✓ | ✓ |
optimism | Optimism | OP | ✓ | ✓ |
avalanche | Avalanche | AVAX | ✓ | ✓ |
sui | Sui | SUI | ✓ | |
aptos | Aptos | APT | ✓ | |
celo | Celo | CELO | ✓ | ✓ |
linea | Linea | LINEA | ✓ | ✓ |
opbnb | opBNB | opBNB | ✓ | ✓ |
plasma | Plasma | XPL | ✓ | ✓ |
hyperliquid | Hyperliquid | HYPE | ✓ | ✓ |
robinhood | Robinhood Chain | HOOD | ✓ | ✓ |
Short names accepted on input: btc, eth, bnb, trx, sol, matic/pol, arb, op, avax, ltc, doge, apt.
Pricing and billing
Test mode is free with no time limit, for receiving and sending. Live addresses, payouts and custom tokens need a plan, chosen on the Billing page. Until then, live calls return 402 PLAN_REQUIRED.
- Pay as you go: 0.5% of the US dollar value of incoming live deposits. Each deposit's value is fixed when it's first priced. Payouts and sweeps carry no BlocksReader fee (you only pay the network fee), and transfers between your own addresses aren't charged. Fees settle every 14 days, and a cycle under US$1 is waived.
- Other plans on offer, including monthly ones, are listed on the Billing page with their prices and limits.
- Fees come from a prepaid billing wallet in your account: USDT on BNB Chain (BEP-20) only. Every top-up and fee is emailed to you.
- If the balance can’t cover a fee, you keep full service for 2 days. After that, live access pauses until you settle on the Billing page:
- Live API calls return
402 BILLING_SUSPENDED. - Your signer stops too: payouts stay
pendingand sweeps don’t run until you settle. - We keep watching your addresses. Deposit webhooks from the pause are held and delivered as soon as you settle, so nothing is lost.
- Your funds are never locked: they’re controlled by your seed phrase, not by us.
- Test mode is never paused.
- Live API calls return
Full terms are at blocksreader.com/terms.
Go-live checklist
- Set up the BlocksReader Signer with Docker on a server that stays online. Setup creates your wallet, you write the seed phrase on paper, and it adds your public keys to your account. See Wallet and signer.
- Start the signer and leave it running. Without it, live payouts and sweeps never go out.
- Choose a plan on the Billing page and top up the billing wallet.
- Swap to your
br_live_key in your server's environment. It is read only on the server and never logged. - Register your production webhook with the live key. Test-key endpoints never receive live deposits. Put that endpoint's secret in production config.
- Check the handler: raw-body signature check, 300-second window, 2xx within 10 seconds, credit once per
(chain, tx_hash, address)in a transaction, exact decimals. - Run the catch-up job on a schedule and alert if it ever credits something (that means a webhook was missed).
- Show destination tags and memos to customers on XRP and TON.
- For payouts: make sure your signer is running, keep the sending wallet funded (plus gas for tokens), reserve balances before creating a payout, use your withdrawal id as the
Idempotency-Key, and refund withdrawals onpayout.failed.
Using an AI assistant? Run /mcp__blocksreader__go_live_checklist and it checks all of this against your code.
Questions: contact us or email hello@blocksreader.com.