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.
- Why do we have both
tx_hash
andtx_hash_big_endian
? Because some wallets prefer big-endian and others little-endian hash? - What is the
tx_index
? Index of a transaction in entire blockchain? - What is the
tx_output_n
? - What is the
script
?