Bitcoin Module

Bitcoin Module

Block

Represents a block in the Bitcoin blockchain.

FieldTypeLabelDescription
versionuint32Block version number
prev_block_hashbytesHash of the previous block
merkle_rootbytesRoot hash of the Merkle tree
timestampuint32Time when the block was created
bitsuint32Target difficulty value
nonceuint32Value used for Proof-of-Work
transactionsTransactionrepeatedList of transactions included in the block

Transaction

Represents a transaction in the Bitcoin network.

FieldTypeLabelDescription
versionuint32Transaction version number. Currently 1
inputsTxInputrepeatedList of transaction inputs
outputsTxOutputrepeatedList of transaction outputs
locktimeuint32Block height or timestamp when transaction is final
hashbytes
block_hashbytesTransactions reference their block
timestampuint32

TxInput

Represents an input in a Bitcoin transaction.

FieldTypeLabelDescription
tx_idbytesHash of the previous transaction output
script_sigbytesUnlocking script for spending the UTXO
sequenceuint32Used for relative timelocks
coinbasebytesCoinbase transactions have this instead of txid and scriptSig
witnessesbytesrepeated

TxOutput

Represents an output in a Bitcoin transaction.

FieldTypeLabelDescription
valueuint64Amount of Bitcoin in Satoshis
script_pub_keyScriptPubKeyLocking script defining spendability

ScriptPubKey

Represents a script pub key in the output.

FieldTypeLabelDescription
asmbytesScript in human-readable format
hexbytesScript in hexadecimal format
script_typeScriptTypeCan be ScriptHash, Multsig, etc