blockchain.address.subscribe
Subscribe to state changes on a BCH address. Best invoked over WebSocket — once subscribed, the gateway pushes a notification each time the address's history changes.
Parameters
| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 0 | address |
string | yes | Cashaddr or legacy P2PKH/P2SH address. |
Returns
The initial response is the address's current "status" — a hash that summarizes its full history. Subsequent state changes are delivered as JSON-RPC notifications (no id, has method: "blockchain.address.subscribe" and params: [address, new_status]).
Usage shape (WebSocket)
Open a WS to:
wss://solidpeer.io/fulcrum/mainnet/<token>
Send:
{"jsonrpc":"2.0","id":1,"method":"blockchain.address.subscribe","params":["bitcoincash:q..."]}
Initial response:
{"jsonrpc":"2.0","id":1,"result":"<32-byte-hex-status-hash or null>"}
After a new transaction touches the address, a push arrives:
{
"jsonrpc":"2.0",
"method":"blockchain.address.subscribe",
"params":["bitcoincash:q...", "<new-status-hash>"]
}
The status value is null when the address has never been involved in a transaction; otherwise it's a hex hash that changes whenever the address's history changes. To learn what changed, call blockchain.address.get_history after each push.
Notes
- Subscriptions are per-connection. Closing the WS removes them all; you don't need to unsubscribe individually.
- Same address can be subscribed from multiple connections; each gets independent pushes.
- The
blockchain.scripthash.subscribevariant takes a raw 32-byte scripthash instead of a cashaddr. The two represent the same address space; pick whichever fits your client library.
Cost
- Registration: 100 CC at subscribe time (50 CC on testnets/regtest).
- Per push: 100 CC per delivered notification (50 CC on testnets/regtest).
Each push billed against the per-account balance and (if set) the token's CC budget.