Bitcoin Forum

Economy => Services => Topic started by: schnuber on May 10, 2016, 10:41:17 PM



Title: origin of tx_index in blockchain.info API
Post by: schnuber on May 10, 2016, 10:41:17 PM
Hi everybody

I am toying a bit with the json API from blockchain.info. When looking at some transactions I note this tx_index which is always the same for outputs, and different for each input of one tx. It is clear that this references the utx.
But where does this tx_index come from I wonder? Is it inside the blockchain or is it some blockchain.info specific indexing sitting in their index database?

Sincerely


Title: Re: origin of tx_index in blockchain.info API
Post by: achow101 on May 11, 2016, 01:50:01 AM
Hi everybody

I am toying a bit with the json API from blockchain.info. When looking at some transactions I note this tx_index which is always the same for outputs, and different for each input of one tx. It is clear that this references the utx.
But where does this tx_index come from I wonder? Is it inside the blockchain or is it some blockchain.info specific indexing sitting in their index database?

Sincerely
It is blockchain.info's internal tx database. It is not inside the blockchain itself.


Title: Re: origin of tx_index in blockchain.info API
Post by: schnuber on May 11, 2016, 07:32:51 AM
Is this index the same in every UTX database on every full node? So can I retrieve the tx_index from blockchain.info and then query with this index on any other index database and get the same transaction?


Title: Re: origin of tx_index in blockchain.info API
Post by: piotr_n on May 11, 2016, 10:42:44 AM
Is this index the same in every UTX database on every full node? So can I retrieve the tx_index from blockchain.info and then query with this index on any other index database and get the same transaction?
No. The common nodes use TxID as the index, then lookup for Vout inside the record.


Title: Re: origin of tx_index in blockchain.info API
Post by: gmaxwell on May 12, 2016, 01:33:28 PM
They've even previously reset the numbers for all transactions on their site. You shouldn't be using that information for anything.