Bitcoin Module

Bitcoin Module

This reference covers v1beta, generated from spec v0.19.2.

Block

Represents a block in the Bitcoin blockchain.

FieldTypeLabelDescription
versionuint32Block version number
previousblockhashbytesoptionalHash of the previous block
merklerootbytesRoot hash of the Merkle tree
timeuint32Time when the block was created
bitsuint32Target difficulty value
nonceuint32Value used for Proof-of-Work
txTransactionrepeatedList of transactions included in the block

ScriptPubKey

Represents a script pub key in the output.

FieldTypeLabelDescription
asmbytesScript in human-readable format
hexbytesScript in hexadecimal format
typebytes
addressbytesoptionalSome outputs have addresses

Transaction

Represents a transaction in the Bitcoin network.

FieldTypeLabelDescription
versionuint32Transaction version number. Currently 1
vinTxInputrepeatedList of transaction inputs
voutTxOutputrepeatedList of transaction outputs
locktimeuint32Block height or timestamp when transaction is final
hashbytesHash of the transaction
blockhashbytesoptionalTransactions reference their block
timeuint32optionalTimestamp of the transaction

TxInput

Represents an input in a Bitcoin transaction.

FieldTypeLabelDescription
txidbytesoptionalHash of the previous transaction output, corresponds to txid
scriptSigbytesoptionalUnlocking script for spending the UTXO
sequenceuint32Used for relative timelocks
coinbasebytesoptionalCoinbase transactions have this instead of txid and scriptSig
txinwitnessbytesrepeatedWitness data for SegWit transactions

TxOutput

Represents an output in a Bitcoin transaction.

FieldTypeLabelDescription
valueuint64Amount of Bitcoin in Satoshis
scriptPubKeyScriptPubKeyLocking script defining spendability