Bitcoin Scopes

Reference guide for available scopes for Bitcoin.

Bitcoin scopes are parameters you use to define the if this specification logic of your Chainhook on the Bitcoin blockchain. In other words, scopes specify what on-chain events you are looking to monitor and track. For more information on Chainhook design, please view predicate design.

txid

The txid scope allows you to query transactions based on their transaction ID. This is particularly useful for tracking specific transactions or auditing transaction histories.

Parameters

equals
Required
string

The equals property is a 32 byte hex encoded type used to specify the exact transaction ID to match.

{
  "if_this": {
    "scope": "txid",
    "equals": "0xfaaac1833dc4883e7ec28f61e35b41f896c395f8d288b1a177155de2abd6052f"
  }
}

outputs

The outputs scope allows you to query blocks based on the payload returned by the specified operation.

Parameters

operation
Required
object

The operation property is used to identify the Bitcoin operation that will trigger Chainhook as it observes Bitcoin transactions. The available operations are op_return, p2pkh, p2sh,p2wpkh and p2wsh.

{
  "if_this": {
    "scope": "outputs",
    "op_return": {
      "equals": "0xbtc21000042stx016"
    }
  }
}

Note

The op_return operation allows for equals, starts_with and ends_with for matching against the desired input.

stacks_protocol

The stacks_protocol scope allows you query Bitcoin transactions related to the Stacks Proof of Transfer (PoT) concensus mechanism.

Parameters

operation
Required
string

The operation property is used to identify the Stacks operation that will trigger Chainhook as it observes Bitcoin transactions. The available operations are block_committed, leader_registered, inscription_feed, stx_transferred and stx_locked.

  {
    "if_this": {
      "scope": "stacks_protocol",
      "operation": "block_committed"
    }
  }