2

how exactly is the satoshi value in a raw transaction calculated to decimal? Because on blockchain.info, I cannot figure out how they parse the raw transaction from that value to the JSON result. I thought it would be just a hex to decimal parsing, but I cannot get the same results. Neither I understand it in here, how you get to 49.99990000 BTC (from https://developer.bitcoin.org/reference/transactions.html):

Sorry if it's a silly question.

1 Answer 1

1

The amount is encoded as a little endian signed 64 bits integer.

Here is how you would decode your sample in Python:

>>> int.from_bytes(bytes.fromhex("f0ca052a01000000"), "little")
4999990000

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.