<p><code>tx_hash</code> and <code>tx_hash_big_endian</code> are the little endian and big endian representations of the transactions hash. Bitcoin uses little endian hashes internally, but explorers normally show such information in big endian, you can read more about such topic <a href="https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation">here</a>.</p>

<p>Regarding <code>tx_index</code>, that field is an internal id for blockchain.info database. It has nothing to do with the Bitcoin blockchain.</p>

<p><code>tx_output_n</code> is the index of the output in the transaction. <code>utxos</code> are identified by <code>tx_id</code> and <code>tx_index</code>.</p>

<p>Finally, the <code>script</code> is the <code>scriptPubKey</code> or <code>outputScript</code> defined in the <code>utxo</code>. Basically it sets the conditions to be met in order to claim such an output in a new transaction.</p>

CC BY-SA 4.0
2018-09-10T09:49:06.840Z
I have a question about `script`. What is the list of conditions to claim the output in a transaction?
srgbnd
CC BY-SA 4.0
2018-09-10T12:58:28.993Z
It depends. Usually it is a digital signature performed with a specific private key. However, it can be set to several other things, like multisigs or even custom scripts.
sr_gi
CC BY-SA 4.0
2018-08-26T11:10:37.627Z
2018-08-26T11:10:37.627Z
sr_gi
<p><em>Bitcoin testnet</em></p>

<p>I used the following code to obtain info about unspent outputs:</p>

<pre><code>const blockchainInfo = require('blockchain.info')

const blockexplorer = blockchainInfo.blockexplorer.usingNetwork(3)
blockexplorer.getUnspentOutputs(address).then((resp) =&gt; {
  console.log(resp.unspent_outputs);
})
</code></pre>

<p>Response:</p>

<pre><code>   [ { tx_hash: '9c5a...f31b',
       tx_hash_big_endian: '1bf3....5a9c',
       tx_index: 249487365,
       tx_output_n: 0,
       script: '76a9...88ac',
       value: 200000000,
       value_hex: '0bebc200',
       confirmations: 2262 },
     { tx_hash: '708e...ec103',
       tx_hash_big_endian: '03c1...8e70',
       tx_index: 250637325,
       tx_output_n: 0,
       script: '76a9...88ac',
       value: 20000,
       value_hex: '4e20',
       confirmations: 1845 },
     { tx_hash: '803a...901d',
       tx_hash_big_endian: '1d90...3a80',
       tx_index: 256201920,
       tx_output_n: 0,
       script: '76a9...88ac',
       value: 20000,
       value_hex: '4e20',
       confirmations: 262 },
     { tx_hash: '255d...cfde',
       tx_hash_big_endian: 'decf...5d25',
       tx_index: 256264533,
       tx_output_n: 0,
       script: '76a9....88ac',
       value: 20000,
       value_hex: '4e20',
       confirmations: 252 } ]
</code></pre>

<p>And I got some questions.</p>

<ol>
<li>Why do we have both <code>tx_hash</code> and <code>tx_hash_big_endian</code>? Because some wallets prefer big-endian and others little-endian hash? </li>
<li>What is the <code>tx_index</code>? Index of a transaction in entire blockchain? </li>
<li>What is the <code>tx_output_n</code>?</li>
<li>What is the <code>script</code>?</li>
</ol>

<blockchain.info><javascript>
Explain blockexplorer UTXO
srgbnd
# Explain blockexplorer UTXO

(Asked by: username_0 on 2018-08-26)

*Bitcoin testnet*

I used the following code to obtain info about unspent outputs:

```
const blockchainInfo = require('blockchain.info')

const blockexplorer = blockchainInfo.blockexplorer.usingNetwork(3)
blockexplorer.getUnspentOutputs(address).then((resp) => {
  console.log(resp.unspent_outputs);
})

```

Response:

```
   [ { tx_hash: '9c5a...f31b',
       tx_hash_big_endian: '1bf3....5a9c',
       tx_index: 249487365,
       tx_output_n: 0,
       script: '76a9...88ac',
       value: 200000000,
       value_hex: '0bebc200',
       confirmations: 2262 },
     { tx_hash: '708e...ec103',
       tx_hash_big_endian: '03c1...8e70',
       tx_index: 250637325,
       tx_output_n: 0,
       script: '76a9...88ac',
       value: 20000,
       value_hex: '4e20',
       confirmations: 1845 },
     { tx_hash: '803a...901d',
       tx_hash_big_endian: '1d90...3a80',
       tx_index: 256201920,
       tx_output_n: 0,
       script: '76a9...88ac',
       value: 20000,
       value_hex: '4e20',
       confirmations: 262 },
     { tx_hash: '255d...cfde',
       tx_hash_big_endian: 'decf...5d25',
       tx_index: 256264533,
       tx_output_n: 0,
       script: '76a9....88ac',
       value: 20000,
       value_hex: '4e20',
       confirmations: 252 } ]

```

And I got some questions.

1. Why do we have both `tx_hash` and `tx_hash_big_endian`? Because some wallets prefer big-endian and others little-endian hash?
2. What is the `tx_index`? Index of a transaction in entire blockchain?
3. What is the `tx_output_n`?
4. What is the `script`?

**Tags:** blockchain.info, javascript


---

## 1 answers

### Answer by username_1 on 2018-08-26. Score: 1 | Accepted answer

`tx_hash` and `tx_hash_big_endian` are the little endian and big endian representations of the transactions hash. Bitcoin uses little endian hashes internally, but explorers normally show such information in big endian, you can read more about such topic [here](https://bitcoin.stackexchange.com/questions/2063/why-does-the-bitcoin-protocol-use-the-little-endian-notation).

Regarding `tx_index`, that field is an internal id for blockchain.info database. It has nothing to do with the Bitcoin blockchain.

`tx_output_n` is the index of the output in the transaction. `utxos` are identified by `tx_id` and `tx_index`.

Finally, the `script` is the `scriptPubKey` or `outputScript` defined in the `utxo`. Basically it sets the conditions to be met in order to claim such an output in a new transaction.

> **Comments:**
> **username_0**: I have a question about `script`. What is the list of conditions to claim the output in a transaction?  
> **username_1**: It depends. Usually it is a digital signature performed with a specific private key. However, it can be set to several other things, like multisigs or even custom scripts.  

---

