<blockquote>
<p>This seems to be somewhat different.</p>
</blockquote>
<p>Blockchain explorers do not show the exact block structure. They usually add extra derived information that they consider helpful. I also find this misleading and often unhelpful.</p>
<p>You might find a different blockchain explorer to be more helpful (or at least unhelpful in ways that don't matter as much to you). For example See <code>For developers</code>  <code>Raw Tx</code> in <a href="https://blockchair.com/bitcoin/transaction/928c4275dfd6270349e76aa5a49b355eefeb9e31ffbe95dd75fed81d219a23f8" rel="nofollow noreferrer">https://blockchair.com/bitcoin/transaction/928c4275dfd6270349e76aa5a49b355eefeb9e31ffbe95dd75fed81d219a23f8</a>.</p>
<blockquote>
<p>is there a way of figuring out which transactions are chained to which?</p>
</blockquote>
<p>Yes. Each input of a transaction links that transaction to an earlier transaction identified by the previous transaction ID field (&quot;Prev.TxId&quot; in your example) in the data for each input.</p>
<p>So you can, for example, parse the BLK files created by Bitcoin core to list those links between transactions.</p>
<pre><code>&gt; blockchain -file blk02000.dat -block 1 -tx 572

Transaction Details in Hex (Decimal/Symbolic):
  Version:................01000000 (1)
  Inputs:.................04 (4)
  Input:1
    Previous Transaction:.3476B395124F8C339802EDEDBA2FDFE13D28AF4C28E67BABBFCCC27E18EF97C7
    Previous Output Index:0000 (0)
    Script Length:........6A (106)
    Unlocking Script:.....47304402205EE39EA72444ECB77D5448C6742CE17F4887AAFD30FE90E4E20147
                          823803E5AF022067D94E7AEE43C56221B403989D50BE40F1DB5A6073635E100F
                          96D8C2656798960121026B61AC29519038AECC2BB6E2F57FE9310B82D7E7873A
                          C5F4501B823C4D8E5B43
    Sequence:.............FFFFFFFF
  Input:2
    Previous Transaction:.DC9C065A1C610B13604C79925331F9762F08344E9330B11F9F5E938C3F46754B
    Previous Output Index:0000 (0)
    Script Length:........6B (107)
    Unlocking Script:.....483045022100CF78C34E882E39EC2F76FD47218195156030B2FDF93E1D854FD9
                          DA17FEB785AE02200ECBE9A6402F4C597970F3F9CDB8C3FC4A700C1D8B0CA29F
                          07C71A4EF00C372B01210363CFCE0BD0D8BF56AAE3388EF5928E4F2EEB032606
                          A9B17506948CDEB0A5D8A2
    Sequence:.............FFFFFFFF
  Input:3
    Previous Transaction:.EF59C004545977F125CD33905A6AD17A4F7C5E7E55B96B6740C8B850F1AC6705
    Previous Output Index:0000 (0)
    Script Length:........6B (107)
    Unlocking Script:.....483045022100F29055D9A3D8BB9DD5ADEDAE3E2BD071488790F11290866CC5B9
                          08B7738578A402204DBCED4D7787D8D174385BCB7563BC0E7B16016E70E7F1BD
                          C28702F75283AA6A012103F8F5D44539C2679C090034F369B52B1FD309A0520B
                          F6C91F5E0C7E78FE3C30D4
    Sequence:.............FFFFFFFF
  Input:4
    Previous Transaction:.F3BEA54D65FE5E89D77E34C7E1C57D3B00E1C8327AAB0E4B3DA026C9FA7B8A16
    Previous Output Index:0001 (1)
    Script Length:........6A (106)
    Unlocking Script:.....4730440220598BB94163092C90EE14FC96BAD695915254F2FA990BF33F646D58
                          47D0A8EB9A02205893ED21FD19BC912A4D9D14C8B32F85F1C54D246529E5C95D
                          BDB53B90F4F7440121022547351C3502D195472035ACFE58E5D000EAACCF3290
                          4F0BA4057720A81F9D14
    Sequence:.............FFFFFFFF
  Outputs:................01 (1)
  Output 1
    Value:................2434000000000000 (13348)
    Script Length:........17 (23)
    Locking Script:.......A9146B6674CCB5ACA499B2A8F4A27127AD9DB9D6DD1487
  LockTime:...............00000000 (0)
</code></pre>
<p>Note that every transaction is identified by a Transaction ID that is a hash of selected data in the transaction (it excludes SegWit data for compatibility with non-Segwit nodes)</p>
<p>See</p>
<ul>
<li><a href="https://en.bitcoin.it/wiki/Protocol_documentation#tx" rel="nofollow noreferrer">Bitcoin Protocol Documentations - TX</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/113631/13866">In what format does a block store the transaction data?</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/98426/13866">Is blockchain.com the only place where you can see the blockchain?</a></li>
<li><a href="https://bitcoin.stackexchange.com/q/114804/13866">How can I take a &quot;snapshot&quot; of the bitcoin blockchain and analyze it?</a></li>
</ul>

CC BY-SA 4.0
2022-09-06T15:00:11.400Z
2022-09-06T15:40:20.603Z
2022-09-06T15:40:20.603Z
RedGrittyBrick
<p>I'm reading 'Blockchain and distributed ledgers' by Alexander Lipton and Adrien Treccani.</p>
<p>I'm trying to understand how individual transactions are linked together.</p>
<p>On page 338, they give the 'details of a typical transaction in Block 400,000' (sorry I can't copy and paste text):</p>
<p><a href="https://i.sstatic.net/zZrg9.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/zZrg9.png" alt="From the book, page 338" /></a></p>
<p>When I look at this transaction using <code>https://blockchain.info/tx/928c4275dfd6270349e76aa5a49b355eefeb9e31ffbe95dd75fed81d219a23f8?format=json</code> then this is what I see:</p>
<pre><code>{
  &quot;hash&quot;: &quot;928c4275dfd6270349e76aa5a49b355eefeb9e31ffbe95dd75fed81d219a23f8&quot;,
  &quot;ver&quot;: 1,
  &quot;vin_sz&quot;: 1,
  &quot;vout_sz&quot;: 1,
  &quot;size&quot;: 191,
  &quot;weight&quot;: 764,
  &quot;fee&quot;: 100000,
  &quot;relayed_by&quot;: &quot;0.0.0.0&quot;,
  &quot;lock_time&quot;: 0,
  &quot;tx_index&quot;: 8730617388972831,
  &quot;double_spend&quot;: false,
  &quot;time&quot;: 1456417484,
  &quot;block_index&quot;: 400000,
  &quot;block_height&quot;: 400000,
  &quot;inputs&quot;: [
    {
      &quot;sequence&quot;: 4294967295,
      &quot;witness&quot;: &quot;&quot;,
      &quot;script&quot;: &quot;473044022100a98648381f405a6882989faa500147c7cb9f4ce03e912d18529fb3609e243a47021f798214efe634e8c47e158edae534f5652b98ce1bd3693fa95dcdd2c699d987012102bd63ab2a6215bdd16d554ea3fd5d83843bff9c76e0b8c6c150d58ee6ca7ea525&quot;,
      &quot;index&quot;: 0,
      &quot;prev_out&quot;: {
        &quot;tx_index&quot;: 2867663739202288,
        &quot;value&quot;: 321000000,
        &quot;n&quot;: 5,
        &quot;type&quot;: 0,
        &quot;spent&quot;: true,
        &quot;script&quot;: &quot;76a914c53c08858049dccc686358e05a0371211fc77c5b88ac&quot;,
        &quot;spending_outpoints&quot;: [
          {
            &quot;tx_index&quot;: 8730617388972831,
            &quot;n&quot;: 0
          }
        ],
        &quot;addr&quot;: &quot;1Jyt2ydxc9uTzHuj8DR8egqbLEwLa6kQPL&quot;
      }
    }
  ],
  &quot;out&quot;: [
    {
      &quot;type&quot;: 0,
      &quot;spent&quot;: true,
      &quot;value&quot;: 320900000,
      &quot;spending_outpoints&quot;: [
        {
          &quot;tx_index&quot;: 8460568020598031,
          &quot;n&quot;: 0
        }
      ],
      &quot;n&quot;: 0,
      &quot;tx_index&quot;: 8730617388972831,
      &quot;script&quot;: &quot;76a9142f58e6245481be77894d5f0f0e2641decdafc44788ac&quot;,
      &quot;addr&quot;: &quot;15KMFpvaHJLf26y7DkTFKjxijfYvAAdU2s&quot;
    }
  ]
}
</code></pre>
<p>This seems to be somewhat different. In particular, there's no 'Prev. TXID' field. The previous transaction the book refers to (5180fff4155787703d10f03cca1566794516ac65a67764e571dc9c34931f321d) doesn't even seem to exist.</p>
<p>My question is: is there a way of figuring out which transactions are chained to which?</p>

<transactions><hash><raw-transaction>
Structure of a bitcoin transaction, in particular the link to the previous transaction
Neil D
# Structure of a bitcoin transaction, in particular the link to the previous transaction

(Asked by: username_0 on 2022-09-06)

I'm reading 'Blockchain and distributed ledgers' by Alexander Lipton and Adrien Treccani.

I'm trying to understand how individual transactions are linked together.

On page 338, they give the 'details of a typical transaction in Block 400,000' (sorry I can't copy and paste text):

[![From the book, page 338](https://i.sstatic.net/zZrg9.png)](https://i.sstatic.net/zZrg9.png)

When I look at this transaction using `https://blockchain.info/tx/928c4275dfd6270349e76aa5a49b355eefeb9e31ffbe95dd75fed81d219a23f8?format=json` then this is what I see:

```
{
  "hash": "928c4275dfd6270349e76aa5a49b355eefeb9e31ffbe95dd75fed81d219a23f8",
  "ver": 1,
  "vin_sz": 1,
  "vout_sz": 1,
  "size": 191,
  "weight": 764,
  "fee": 100000,
  "relayed_by": "0.0.0.0",
  "lock_time": 0,
  "tx_index": 8730617388972831,
  "double_spend": false,
  "time": 1456417484,
  "block_index": 400000,
  "block_height": 400000,
  "inputs": [
    {
      "sequence": 4294967295,
      "witness": "",
      "script": "473044022100a98648381f405a6882989faa500147c7cb9f4ce03e912d18529fb3609e243a47021f798214efe634e8c47e158edae534f5652b98ce1bd3693fa95dcdd2c699d987012102bd63ab2a6215bdd16d554ea3fd5d83843bff9c76e0b8c6c150d58ee6ca7ea525",
      "index": 0,
      "prev_out": {
        "tx_index": 2867663739202288,
        "value": 321000000,
        "n": 5,
        "type": 0,
        "spent": true,
        "script": "76a914c53c08858049dccc686358e05a0371211fc77c5b88ac",
        "spending_outpoints": [
          {
            "tx_index": 8730617388972831,
            "n": 0
          }
        ],
        "addr": "1Jyt2ydxc9uTzHuj8DR8egqbLEwLa6kQPL"
      }
    }
  ],
  "out": [
    {
      "type": 0,
      "spent": true,
      "value": 320900000,
      "spending_outpoints": [
        {
          "tx_index": 8460568020598031,
          "n": 0
        }
      ],
      "n": 0,
      "tx_index": 8730617388972831,
      "script": "76a9142f58e6245481be77894d5f0f0e2641decdafc44788ac",
      "addr": "15KMFpvaHJLf26y7DkTFKjxijfYvAAdU2s"
    }
  ]
}

```

This seems to be somewhat different. In particular, there's no 'Prev. TXID' field. The previous transaction the book refers to (5180fff4155787703d10f03cca1566794516ac65a67764e571dc9c34931f321d) doesn't even seem to exist.

My question is: is there a way of figuring out which transactions are chained to which?

**Tags:** transactions, hash, raw-transaction


---

## 1 answers

### Answer by username_1 on 2022-09-06. Score: 2 | Accepted answer

> This seems to be somewhat different.

Blockchain explorers do not show the exact block structure. They usually add extra derived information that they consider helpful. I also find this misleading and often unhelpful.

You might find a different blockchain explorer to be more helpful (or at least unhelpful in ways that don't matter as much to you). For example See `For developers` `Raw Tx` in <https://blockchair.com/bitcoin/transaction/928c4275dfd6270349e76aa5a49b355eefeb9e31ffbe95dd75fed81d219a23f8>.

> is there a way of figuring out which transactions are chained to which?

Yes. Each input of a transaction links that transaction to an earlier transaction identified by the previous transaction ID field ("Prev.TxId" in your example) in the data for each input.

So you can, for example, parse the BLK files created by Bitcoin core to list those links between transactions.

```
> blockchain -file blk02000.dat -block 1 -tx 572

Transaction Details in Hex (Decimal/Symbolic):
  Version:................01000000 (1)
  Inputs:.................04 (4)
  Input:1
    Previous Transaction:.3476B395124F8C339802EDEDBA2FDFE13D28AF4C28E67BABBFCCC27E18EF97C7
    Previous Output Index:0000 (0)
    Script Length:........6A (106)
    Unlocking Script:.....47304402205EE39EA72444ECB77D5448C6742CE17F4887AAFD30FE90E4E20147
                          823803E5AF022067D94E7AEE43C56221B403989D50BE40F1DB5A6073635E100F
                          96D8C2656798960121026B61AC29519038AECC2BB6E2F57FE9310B82D7E7873A
                          C5F4501B823C4D8E5B43
    Sequence:.............FFFFFFFF
  Input:2
    Previous Transaction:.DC9C065A1C610B13604C79925331F9762F08344E9330B11F9F5E938C3F46754B
    Previous Output Index:0000 (0)
    Script Length:........6B (107)
    Unlocking Script:.....483045022100CF78C34E882E39EC2F76FD47218195156030B2FDF93E1D854FD9
                          DA17FEB785AE02200ECBE9A6402F4C597970F3F9CDB8C3FC4A700C1D8B0CA29F
                          07C71A4EF00C372B01210363CFCE0BD0D8BF56AAE3388EF5928E4F2EEB032606
                          A9B17506948CDEB0A5D8A2
    Sequence:.............FFFFFFFF
  Input:3
    Previous Transaction:.EF59C004545977F125CD33905A6AD17A4F7C5E7E55B96B6740C8B850F1AC6705
    Previous Output Index:0000 (0)
    Script Length:........6B (107)
    Unlocking Script:.....483045022100F29055D9A3D8BB9DD5ADEDAE3E2BD071488790F11290866CC5B9
                          08B7738578A402204DBCED4D7787D8D174385BCB7563BC0E7B16016E70E7F1BD
                          C28702F75283AA6A012103F8F5D44539C2679C090034F369B52B1FD309A0520B
                          F6C91F5E0C7E78FE3C30D4
    Sequence:.............FFFFFFFF
  Input:4
    Previous Transaction:.F3BEA54D65FE5E89D77E34C7E1C57D3B00E1C8327AAB0E4B3DA026C9FA7B8A16
    Previous Output Index:0001 (1)
    Script Length:........6A (106)
    Unlocking Script:.....4730440220598BB94163092C90EE14FC96BAD695915254F2FA990BF33F646D58
                          47D0A8EB9A02205893ED21FD19BC912A4D9D14C8B32F85F1C54D246529E5C95D
                          BDB53B90F4F7440121022547351C3502D195472035ACFE58E5D000EAACCF3290
                          4F0BA4057720A81F9D14
    Sequence:.............FFFFFFFF
  Outputs:................01 (1)
  Output 1
    Value:................2434000000000000 (13348)
    Script Length:........17 (23)
    Locking Script:.......A9146B6674CCB5ACA499B2A8F4A27127AD9DB9D6DD1487
  LockTime:...............00000000 (0)

```

Note that every transaction is identified by a Transaction ID that is a hash of selected data in the transaction (it excludes SegWit data for compatibility with non-Segwit nodes)

See

* [Bitcoin Protocol Documentations - TX](https://en.bitcoin.it/wiki/Protocol_documentation#tx)
* [In what format does a block store the transaction data?](https://bitcoin.stackexchange.com/q/113631/13866)
* [Is blockchain.com the only place where you can see the blockchain?](https://bitcoin.stackexchange.com/q/98426/13866)
* [How can I take a "snapshot" of the bitcoin blockchain and analyze it?](https://bitcoin.stackexchange.com/q/114804/13866)


---

