Bitcoin Forum

Economy => Web Wallets => Topic started by: YellowBlueGreen on February 27, 2014, 09:11:26 AM



Title: Blockchain Info API - Payment Tx_Hash
Post by: YellowBlueGreen on February 27, 2014, 09:11:26 AM
Hi guys,

When making a payment using the Blockchain Info API, I receive a success response but the tx_hash doesn't seem correct.

Here's the JSON response:
{"message":"Sent 0.0001 BTC to 1Jp6r9MqJQY5RBaF6mDtM4cjDJ3mBNpj8J","tx_hash":"aa1effcea0956eba9f7b46d3b1f7c0187534fa89c53d9cd1fe1fd73499288cfd"}

However the tx appears to actually be: fe34089c3b43d6f4f20363305a7b53c15c007431feca953b1193bcc321dc324f.

Am I not understanding something correctly?


Title: Re: Blockchain Info API - Payment Tx_Hash
Post by: Bitalo_Maciej on February 27, 2014, 09:49:23 AM
Did you tried to contact Blockchain.info support about that? It might be an issue with their system. Or, you could be a victim of transaction malleability issue that was quite well known in last weeks. See: http://bitcoin.stackexchange.com/questions/22051/transaction-malleability-in-the-blockchain


Title: Re: Blockchain Info API - Payment Tx_Hash
Post by: YellowBlueGreen on February 27, 2014, 11:36:21 AM
Thanks for your reply. Much appreciated!

I think it's more that I don't understand the purpose of the returned tx hash? I get the same problem with blockchain RPC. I get a tx hash returned but I'm not sure what to do with it. When the transaction appears on blockchain it is a different id/hash that I can then monitor.

What's the purpose of the returned tx_hash? I was hoping I can use it to verify or monitor the transaction. But that doesn't seem to be the case? Do I need some other way of tracking each specific transaction or some way to get the actual transaction id?


Title: Re: Blockchain Info API - Payment Tx_Hash
Post by: Bitalo_Maciej on February 27, 2014, 12:20:09 PM
Raw data for the transaction you posted is:

Code:
01000000010a76e7737d25ebab31a954919f9126940ffbe136a9523d9c3940e8af912ccace010000008c4930460221009d208a10475c9f67f21fe192ad4c0a27c66bf4f05627a65194e8b2fcc419362a022100a47ba43195b58d8cf32c6a1ebb1d911926f986e4b76259c1a92bfc040310e77801410481751ad255b2b79cfde9c0f4230148ee5b83621052241e1baa51123557cdb565a0ad817f2839a927da0840ef236b2127163b7f5ff830d2c8445c42ba77de2070ffffffff0210270000000000001976a914c36291d28c66530f3e79c89aa34b763e20e574dc88ac23ed9200000000001976a914a341c6fd7f94118af99a6cfeaffcebcc8714817888ac00000000

With input signatures stripped and hashType added:
Code:
01000000010a76e7737d25ebab31a954919f9126940ffbe136a9523d9c3940e8af912ccace0100000000ffffffff0210270000000000001976a914c36291d28c66530f3e79c89aa34b763e20e574dc88ac23ed9200000000001976a914a341c6fd7f94118af99a6cfeaffcebcc8714817888ac0000000001000000

I tried to hash these in various ways, but nothing returned the hash that they are returning in the tx_hash parameter.

It really seems that it's an issue on Blockchain.info's side:

https://github.com/blockchain/My-Wallet/issues/72
http://bitcoinewz.com/news/blockchain-info-api-payment-txhash

OR the hash is just something they use internally, but it's unlikely, because I couldn't find any documentation about it, and everything that I did found suggested that tx_hash should represent TXID of the transaction.


Title: Re: Blockchain Info API - Payment Tx_Hash
Post by: wisefear on November 02, 2014, 02:38:32 AM
The tx_hash returned by Blockchain.info is in reverse byte order, which is the way it's represented internally in the Bitcoin network.

It's actually the same data / hash, but the first byte is at the end, and so on.