Examples
Worked workflow patterns using this node
Example 1 — Watch an Address for Incoming Payments
A read-only workflow that polls an address and reports its confirmed balance.
- Bitcoin node —
resource: address,operation: getInfo,address: "bc1q...",network: mainnet - Branch on
balanceSats— compare against the last known value stored in workflow state - If increased, look up the new activity with
resource: address,operation: getTransactionsMempoolto catch it before its first confirmation, orgetTransactionsonce confirmed
Example 2 — Check if a Payment Has Enough Confirmations
- Bitcoin node —
resource: transaction,operation: getStatus,txid: "8f3c...e21a" - If
confirmed: true, compareblockHeightagainst the current chain tip (resource: block,operation: getRecentBlocks) to compute confirmation depth - Proceed once depth meets your policy (e.g. 1 confirmation for a small retail sale, 6+ for a large transfer)
Example 3 — Full Send-Bitcoin Pipeline
A complete, real-funds workflow chaining every write operation through
PSBT Signing Pipeline to transaction/broadcast.
- Bitcoin node —
resource: psbt,operation: buildnetwork: mainnet,fromAddress: "bc1q..."outputs: [{ "address": "bc1qdest...", "amountSats": 100000 }]changeAddress: "bc1qchange..."
psbtBase64,changeSats,changeAddress - Bitcoin node —
resource: psbt,operation: signpsbtBase64from step 1walletType: wif,credentialID: 42expectedOutputs: [ { "address": "bc1qdest...", "amountSats": 100000 }, { "address": "bc1qchange...", "amountSats": <changeSats from step 1> } ]— must match exactly, including the change output
psbtBase64 - Bitcoin node —
resource: psbt,operation: finalizepsbtBase64from step 2
psbtBase64andinputOutpoints - Bitcoin node —
resource: psbt,operation: extractpsbtBase64from step 3
rawTransactionHexand the computedtxid - Bitcoin node —
resource: transaction,operation: broadcastrawTransactionHexfrom step 4expectedTxid: thetxidfrom step 4, as a cross-check
{ "txid": "...", "alreadyKnown": false }
Single-signature only in this example. A multisig spend inserts a
psbt/combine step between multiple parallel psbt/sign calls (one per signer)
before finalize — see PSBT Signing Pipeline.
Example 4 — Prove Address Ownership
- Bitcoin node —
resource: wallet,operation: signMessage,walletType: wif,credentialID: 42,message: "Proving ownership for order #4471" - Send the returned
address,message, andsignatureto the counterparty - Counterparty (or a later step) verifies with
resource: wallet,operation: verifySignature— no credential needed for this step
Example 5 — Choose a Fee Rate Before Building
- Bitcoin node —
resource: fee,operation: getEstimates - Pick the
satVbvalue for your desiredblocksconfirmation target from the returned array - Pass it explicitly as
feeRateSatVbonpsbt/buildinstead of letting the node auto-select the fastest target