Portal Community

Example 1 — Watch an Address for Incoming Payments

A read-only workflow that polls an address and reports its confirmed balance.

  1. Bitcoin node — resource: address, operation: getInfo, address: "bc1q...", network: mainnet
  2. Branch on balanceSats — compare against the last known value stored in workflow state
  3. If increased, look up the new activity with resource: address, operation: getTransactionsMempool to catch it before its first confirmation, or getTransactions once confirmed

Example 2 — Check if a Payment Has Enough Confirmations

  1. Bitcoin node — resource: transaction, operation: getStatus, txid: "8f3c...e21a"
  2. If confirmed: true, compare blockHeight against the current chain tip (resource: block, operation: getRecentBlocks) to compute confirmation depth
  3. 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.

  1. Bitcoin node — resource: psbt, operation: build
    • network: mainnet, fromAddress: "bc1q..."
    • outputs: [{ "address": "bc1qdest...", "amountSats": 100000 }]
    • changeAddress: "bc1qchange..."
    → returns psbtBase64, changeSats, changeAddress
  2. Bitcoin node — resource: psbt, operation: sign
    • psbtBase64 from step 1
    • walletType: wif, credentialID: 42
    • expectedOutputs: [ { "address": "bc1qdest...", "amountSats": 100000 }, { "address": "bc1qchange...", "amountSats": <changeSats from step 1> } ]must match exactly, including the change output
    → returns the signed psbtBase64
  3. Bitcoin node — resource: psbt, operation: finalize
    • psbtBase64 from step 2
    → returns the finalized psbtBase64 and inputOutpoints
  4. Bitcoin node — resource: psbt, operation: extract
    • psbtBase64 from step 3
    → returns rawTransactionHex and the computed txid
  5. Bitcoin node — resource: transaction, operation: broadcast
    • rawTransactionHex from step 4
    • expectedTxid: the txid from step 4, as a cross-check
    → returns { "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

  1. Bitcoin node — resource: wallet, operation: signMessage, walletType: wif, credentialID: 42, message: "Proving ownership for order #4471"
  2. Send the returned address, message, and signature to the counterparty
  3. 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

  1. Bitcoin node — resource: fee, operation: getEstimates
  2. Pick the satVb value for your desired blocks confirmation target from the returned array
  3. Pass it explicitly as feeRateSatVb on psbt/build instead of letting the node auto-select the fastest target