> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sqd.dev/llms.txt
> Use this file to discover all available pages before exploring further.

<AgentInstructions>

## Submitting Feedback

If you encounter incorrect, outdated, or confusing documentation on this page, submit feedback:

POST https://docs.sqd.dev/feedback

```json
{
  "path": "/en/data/bitcoin/bitcoin-mainnet",
  "feedback": "Description of the issue"
}
```

Only submit feedback when you have something specific and actionable to report.

</AgentInstructions>

# Bitcoin

> Index Bitcoin UTXO blockchain data — blocks, transactions, inputs, and outputs — via SQD Portal API for high-throughput historical streaming.

<Info>Full UTXO history: blocks, transactions, inputs (with prevout data), and outputs.</Info>

| Property   | Value             |
| ---------- | ----------------- |
| Network ID | `bitcoin-mainnet` |
| Real-time  | Yes               |

## Endpoint

```
https://portal.sqd.dev/datasets/bitcoin-mainnet
```

## Quick start

```bash theme={"system"}
curl --compressed -X POST \
  'https://portal.sqd.dev/datasets/bitcoin-mainnet/stream' \
  -H 'Content-Type: application/json' \
  -d '{
    "type": "bitcoin",
    "fromBlock": 0,
    "toBlock": 100,
    "fields": {
      "block": { "number": true, "timestamp": true },
      "transaction": { "hash": true, "size": true }
    },
    "transactions": [{}]
  }'
```

## Schema

<AccordionGroup>
  <Accordion title="Blocks">
    | Field        | Type    | Description              |
    | ------------ | ------- | ------------------------ |
    | `number`     | integer | Block height             |
    | `hash`       | string  | Block hash               |
    | `parentHash` | string  | Parent block hash        |
    | `timestamp`  | integer | Block timestamp (Unix)   |
    | `merkleRoot` | string  | Merkle root              |
    | `size`       | integer | Total block size (bytes) |
    | `weight`     | integer | Block weight (BIP 141)   |
  </Accordion>

  <Accordion title="Transactions">
    | Field              | Type    | Description                        |
    | ------------------ | ------- | ---------------------------------- |
    | `transactionIndex` | integer | Index in the block                 |
    | `txid`             | string  | Transaction ID                     |
    | `hash`             | string  | Tx hash (witness-aware)            |
    | `size`             | integer | Total size (bytes)                 |
    | `vsize`            | integer | Virtual size                       |
    | `weight`           | integer | Weight                             |
    | `version`          | integer | Tx version                         |
    | `locktime`         | integer | Earliest time/height for inclusion |
  </Accordion>

  <Accordion title="Inputs">
    | Field                        | Type    | Description                     |
    | ---------------------------- | ------- | ------------------------------- |
    | `transactionIndex`           | integer | Parent transaction index        |
    | `inputIndex`                 | integer | Index of this input             |
    | `txid`                       | string  | Tx ID of the spent output       |
    | `vout`                       | integer | Index of the spent output       |
    | `scriptSigHex`               | string  | ScriptSig in hex                |
    | `prevoutValue`               | number  | Value of the spent output (BTC) |
    | `prevoutScriptPubKeyAddress` | string  | Address of the spent output     |
  </Accordion>

  <Accordion title="Outputs">
    | Field                 | Type    | Description              |
    | --------------------- | ------- | ------------------------ |
    | `transactionIndex`    | integer | Parent transaction index |
    | `outputIndex`         | integer | Index of this output     |
    | `value`               | number  | Value (BTC)              |
    | `scriptPubKeyHex`     | string  | ScriptPubKey in hex      |
    | `scriptPubKeyType`    | string  | Output type              |
    | `scriptPubKeyAddress` | string  | Output address           |
  </Accordion>
</AccordionGroup>

## Reference

<CardGroup cols={2}>
  <Card title="API Reference" icon="code" href="/en/portal/bitcoin/overview">
    Field definitions and query syntax
  </Card>

  <Card title="Portal Migration" icon="arrow-right" href="/en/portal/migration">
    Migrate from v2 archives to Portal
  </Card>
</CardGroup>
