Bitcoin Module
This reference covers v1beta, generated from spec v0.19.2.
Block
Represents a block in the Bitcoin blockchain.
| Field | Type | Label | Description |
|---|---|---|---|
| version | uint32 | Block version number | |
| previousblockhash | bytes | optional | Hash of the previous block |
| merkleroot | bytes | Root hash of the Merkle tree | |
| time | uint32 | Time when the block was created | |
| bits | uint32 | Target difficulty value | |
| nonce | uint32 | Value used for Proof-of-Work | |
| tx | Transaction | repeated | List of transactions included in the block |
ScriptPubKey
Represents a script pub key in the output.
| Field | Type | Label | Description |
|---|---|---|---|
| asm | bytes | Script in human-readable format | |
| hex | bytes | Script in hexadecimal format | |
| type | bytes | ||
| address | bytes | optional | Some outputs have addresses |
Transaction
Represents a transaction in the Bitcoin network.
| Field | Type | Label | Description |
|---|---|---|---|
| version | uint32 | Transaction version number. Currently 1 | |
| vin | TxInput | repeated | List of transaction inputs |
| vout | TxOutput | repeated | List of transaction outputs |
| locktime | uint32 | Block height or timestamp when transaction is final | |
| hash | bytes | Hash of the transaction | |
| blockhash | bytes | optional | Transactions reference their block |
| time | uint32 | optional | Timestamp of the transaction |
TxInput
Represents an input in a Bitcoin transaction.
| Field | Type | Label | Description |
|---|---|---|---|
| txid | bytes | optional | Hash of the previous transaction output, corresponds to txid |
| scriptSig | bytes | optional | Unlocking script for spending the UTXO |
| sequence | uint32 | Used for relative timelocks | |
| coinbase | bytes | optional | Coinbase transactions have this instead of txid and scriptSig |
| txinwitness | bytes | repeated | Witness data for SegWit transactions |
TxOutput
Represents an output in a Bitcoin transaction.
| Field | Type | Label | Description |
|---|---|---|---|
| value | uint64 | Amount of Bitcoin in Satoshis | |
| scriptPubKey | ScriptPubKey | Locking script defining spendability |