πŸ¦†
BlockDuck
  • BlockDuck
    • Introduce
    • Why BlockDuck
  • Getting Started
    • Quickstart
    • How to build
    • Try your first query
    • Supported Blockchains
  • Functionality
    • Basic EVM structure table function
      • Blocks
      • Transactions
      • Logs
      • Traces
      • Traces v2
      • Latest Block Number
    • Customized EVM contact table function
      • Contract Events
      • Contract view function
    • Bitcoin table function
      • Blocks
      • Transactions
      • Outputs
      • Inputs
    • Parameter Setting
      • Verbose logging
      • Configs setting
  • Types
    • Types Mapping between DuckDB and EVM
  • Examples
    • Python examples
      • Hourly ERC20 transfer volumn monitor page
Powered by GitBook
On this page
  • Inputs
  • Outputs
  • Examples
  1. Functionality
  2. Bitcoin table function

Transactions

The bitcoin_transactions_rpc table records Bitcoin blockchain transactions. Each transaction transfers Bitcoin value across the network, to be included in blocks.

Inputs

Args
Types
Info

fromBlock

BIGINT

Block number to start scanning from.

toBlock

BIGINT

Block number to stop scanning at.

url

VARCHAR

URL of the Bitcoin node.

Outputs

Column names
Types
Info

height

BIGINT

The block number

txid

VARCHAR

The transaction ID

hash

VARCHAR

The transaction hash (differs from txid for witness transactions)

size

BIGINT

The serialized transaction size

vsize

BIGINT

The virtual transaction size (differs from size for witness transactions)

weight

BIGINT

The transaction's weight (between vsize4-3 and vsize4)

version

BIGINT

The version of the transaction

locktime

BIGINT

The transaction's locktime

vin

LIST(JSON)

List of transaction inputs (structured as JSON objects)

vout

LIST(JSON)

List of transaction outputs (structured as JSON objects)

blockhash

VARCHAR

Hash of the block containing this transaction

confirmations

BIGINT

Number of confirmations the transaction has received

time

TIMESTAMP

Timestamp when the transaction was included in a block

Examples

D set variable bitcoin_url = 'https://bitcoin-mainnet.core.chainstack.com/xxx';
D select * from bitcoin_transactions_rpc(886654, 886654, getvariable('bitcoin_url')) where hash = '4bc9f4fbd1f3aea067c637daaa2f743e8bcdf7859688fc556964bdf67468c82a';
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ height β”‚         txid         β”‚         hash         β”‚ size  β”‚ vsize β”‚ weight β”‚ version β”‚ locktime β”‚         vin          β”‚         vout         β”‚         blockhash         β”‚ confirmations β”‚        time         β”‚
β”‚ int64  β”‚       varchar        β”‚       varchar        β”‚ int64 β”‚ int64 β”‚ int64  β”‚  int64  β”‚  int64   β”‚        json[]        β”‚        json[]        β”‚          varchar          β”‚     int64     β”‚      timestamp      β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”Όβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ 886654 β”‚ f397dd542f4f1dd0e7…  β”‚ 4bc9f4fbd1f3aea067…  β”‚  377  β”‚  350  β”‚  1400  β”‚    2    β”‚    0     β”‚ [{"coinbase":"037e…  β”‚ [{"n":0,"scriptPub…  β”‚ 0000000000000000000132d…  β”‚     1689      β”‚ 2025-03-07 00:02:24 β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
PreviousBlocksNextOutputs

Last updated 2 months ago