Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differences between Blockchain and Biteasy #11

Closed
3 tasks done
cimm opened this issue Apr 28, 2014 · 3 comments
Closed
3 tasks done

Differences between Blockchain and Biteasy #11

cimm opened this issue Apr 28, 2014 · 3 comments

Comments

@cimm
Copy link

cimm commented Apr 28, 2014

I am comparing the Blockchain.info and Biteasy API's. Here is an example of the unspent outputs endpoint for the same multisig address for both services. I understand there are small differences between both API's but they seem to differ heavily.

  • The tx_hash (db29...) and transaction_hash (9e07...) are not the same?
  • The tx_index (5480...) and transaction_index (0) are not even close, I guess the transaction_index from Biteasy matches with the tx_output_n?
  • The script (a914...) and script_pub_key (HASH...) are in a different format, I guess you can encode one in the other?

Do both API's simply use different ways to present the same data or is the data different between the two?

BLOCKCHAIN

https://blockchain.info/unspent?active=3CmmhMciChAx4FtGxHtYppoPBLpRLcBy1H

{
"tx_hash": "db29f6a52fa09bf852cefd514fdd71027894f2b19f6fc752cb5e001dc323079e",
"tx_index": 54805310,
"tx_output_n": 0,
"script": "a914798f9646eb0c7efdd33eaf019a35fc6e37bffb4287",
"value": 100000,
"value_hex": "0186a0",
"confirmations": 1369
}

BITEASY

https://api.biteasy.com/blockchain/v1/addresses/3CmmhMciChAx4FtGxHtYppoPBLpRLcBy1H/unspent-outputs

{
"transaction_hash": "9e0723c31d005ecb52c76f9fb1f294780271dd4f51fdce52f89ba02fa5f629db",
"script_pub_key": "HASH160 [798f9646eb0c7efdd33eaf019a35fc6e37bffb42] EQUAL",
"to_address": "3CmmhMciChAx4FtGxHtYppoPBLpRLcBy1H",
"value": 100000,
"transaction_index": 0,
"is_spent": 0,
"script_sent_type": "PAY_TO_HASH"
}
@cimm
Copy link
Author

cimm commented Apr 28, 2014

To answer my first question, it's a difference between little and big endians. The Blockchain transaction hash is the reverse of the Biteasy one. 👊 Thanks Buziss.

@biteasy Why didn't you stick to the way bitcoind reports transaction ids?

@biteasy
Copy link
Owner

biteasy commented Apr 30, 2014

  1. We use big endian format for displaying transaction hashes. bitcoind displays them in the same way and I believe Blockchain.info does the same thing. I do not why they show the specific transaction reversed. Maybe a bug on their side?
  2. The tx_index which blockchain.info uses I assume is their internal MySQL ids. Our transaction_index is the position of the output within the outputs array.
  3. Their script is the hex encoded string value and ours is converted to a readable string which contains the OP codes as well but we will probably provide the hex encoded string value in the future if a lot of API users request it. The value we provide is basically intended for displaying (like on our Testnet pages).

Blockchain.info does things their way and we are doing things our way :)

Let us know if you have more questions and my apologies for the small delay but it has been crazy here, we will be adding more coins to the site and we are in the middle of changing our infrastructure a bit.

@cimm
Copy link
Author

cimm commented May 1, 2014

Indeed, it seems Blockchain.info reverts the transaction_id around, not Biteasy. Sorry for that.

Thank you for helping me out!

@biteasy biteasy closed this as completed May 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants