|
| 1 | +# Bitcoin Module |
| 2 | + |
| 3 | +<a name="bitcoin-v1-Block"></a> |
| 4 | + |
| 5 | +## Block |
| 6 | + |
| 7 | +Represents a block in the Bitcoin blockchain. |
| 8 | + |
| 9 | +| Field | Type | Label | Description | |
| 10 | +| --------------- | -------------------------------------- | -------- | ------------------------------------------- | |
| 11 | +| version | [uint32](#uint32) | | Block version number | |
| 12 | +| prev_block_hash | [bytes](#bytes) | | Hash of the previous block | |
| 13 | +| merkle_root | [bytes](#bytes) | | Root hash of the Merkle tree | |
| 14 | +| timestamp | [uint32](#uint32) | | Time when the block was created | |
| 15 | +| bits | [uint32](#uint32) | | Target difficulty value | |
| 16 | +| nonce | [uint32](#uint32) | | Value used for Proof-of-Work | |
| 17 | +| transactions | [Transaction](#bitcoin-v1-Transaction) | repeated | List of transactions included in the block | |
| 18 | + |
| 19 | + |
| 20 | +<a name="bitcoin-v1-Transaction"></a> |
| 21 | + |
| 22 | +## Transaction |
| 23 | + |
| 24 | +Represents a transaction in the Bitcoin network. |
| 25 | + |
| 26 | +| Field | Type | Label | Description | |
| 27 | +| ---------- | -------------------------------- | -------- | --------------------------------------------------- | |
| 28 | +| version | [uint32](#uint32) | | Transaction version number. Currently 1 | |
| 29 | +| inputs | [TxInput](#bitcoin-v1-TxInput) | repeated | List of transaction inputs | |
| 30 | +| outputs | [TxOutput](#bitcoin-v1-TxOutput) | repeated | List of transaction outputs | |
| 31 | +| locktime | [uint32](#uint32) | | Block height or timestamp when transaction is final | |
| 32 | +| hash | [bytes](#bytes) | | | |
| 33 | +| block_hash | [bytes](#bytes) | | Transactions reference their block | |
| 34 | +| timestamp | [uint32](#uint32) | | | |
| 35 | + |
| 36 | + |
| 37 | +<a name="bitcoin-v1-TxInput"></a> |
| 38 | + |
| 39 | +## TxInput |
| 40 | + |
| 41 | +Represents an input in a Bitcoin transaction. |
| 42 | + |
| 43 | +| Field | Type | Label | Description | |
| 44 | +| ---------- | ----------------- | -------- | ------------------------------------------------------------- | |
| 45 | +| tx_id | [bytes](#bytes) | | Hash of the previous transaction output | |
| 46 | +| script_sig | [bytes](#bytes) | | Unlocking script for spending the UTXO | |
| 47 | +| sequence | [uint32](#uint32) | | Used for relative timelocks | |
| 48 | +| coinbase | [bytes](#bytes) | | Coinbase transactions have this instead of txid and scriptSig | |
| 49 | +| witnesses | [bytes](#bytes) | repeated | | |
| 50 | + |
| 51 | + |
| 52 | +<a name="bitcoin-v1-TxOutput"></a> |
| 53 | + |
| 54 | +## TxOutput |
| 55 | + |
| 56 | +Represents an output in a Bitcoin transaction. |
| 57 | + |
| 58 | +| Field | Type | Label | Description | |
| 59 | +| -------------- | ---------------------------------------- | ----- | ------------------------------------- | |
| 60 | +| value | [uint64](#uint64) | | Amount of Bitcoin in Satoshis | |
| 61 | +| script_pub_key | [ScriptPubKey](#bitcoin-v1-ScriptPubKey) | | Locking script defining spendability | |
| 62 | + |
| 63 | + |
| 64 | +<a name="bitcoin-v1-ScriptPubKey"></a> |
| 65 | + |
| 66 | +## ScriptPubKey |
| 67 | + |
| 68 | +Represents a script pub key in the output. |
| 69 | + |
| 70 | +| Field | Type | Label | Description | |
| 71 | +| ----------- | -------------------- | ----- | ------------------------------- | |
| 72 | +| asm | [bytes](#bytes) | | Script in human-readable format | |
| 73 | +| hex | [bytes](#bytes) | | Script in hexadecimal format | |
| 74 | +| script_type | [ScriptType](#bytes) | | Can be ScriptHash, Multsig, etc | |
| 75 | + |
0 commit comments