<p>99900000 in hex is <code>5F45A60</code>. Padded out to be a 64-bit integer makes it <code>0000000005F45A60</code>. But Bitcoin uses little endian for most things, so this will need to be converted to little endian by byteswapping. So the final value put into a transaction is <code>605AF40500000000</code>.</p>

CC BY-SA 3.0
2017-08-11T22:29:58.207Z
Congrats on your 200th answer. :)
Murch
CC BY-SA 3.0
2017-08-11T22:30:20.227Z
Thank you again.  You wouldn't, by chance, know of a website for doing that conversion easily would you?  It looks self explanatory but I could swear I've seen some byteswaps in bitcoin that change a hex number/letter sometimes in addition to moving them around.  Speaking of which, yours even added a "0" between the 4 and the 5.  Yes!  I'm not crazy!
Mine
CC BY-SA 3.0
2017-08-11T22:55:36.630Z
Byteswapping will not add characters. Bytes are represented with 2 characters, so to byte swap, you reverse the string in 2 character chunks. This means that the last 2 characters become the first two, the second 2 characters becomes the second 2, and so on. So if you look carefully at the byteswapped string, where you see `05` is actually the `05` that was at the beginning of the hex originally. The 4 is part of `F4`. So it used to look like `F45A`, but now swapped they are `5AF4` which makes you think a 0 was added between the 5 and 4, but it's really a different byte that you are seeing.
Ava Chow
CC BY-SA 3.0
2017-08-11T23:33:52.583Z
So I'm not crazy, but I'm still wrong, lol.  Thank you
Mine
CC BY-SA 3.0
2017-08-11T22:13:55.273Z
2017-08-11T22:13:55.273Z
Ava Chow
<p>According to <a href="https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx">this</a></p>

<p>You can specify the amount of bitcoin with an (apparently) 16 alphanumeric hex representation.  It is stated you must specify the bitcoin you want to send in units of Satoshi.  </p>

<p>Here is the quote:</p>

<blockquote>
  <p>We then write an 8-byte field (64 bit integer) containing the amount we want to redeem from the specified output. I will set this to the total amount available in the output minus a fee of 0.001 BTC (0.999 BTC, or 99900000 Satoshis): 605af40500000000</p>
</blockquote>

<p>How did they get <code>605af40500000000</code> from '99900000 Satoshis' when that hex code = <code>6943130077857054720</code>?  I can find no conversion calculator online which demonstrates what they are switching it from or to.</p>

<p>I got the hex code from <a href="https://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html" rel="nofollow noreferrer">https://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html</a></p>

<transactions><raw-transaction><satoshi>
In manual raw tx creation, how do you specify the amount of the bitcoin to be sent?
Mine
# In manual raw tx creation, how do you specify the amount of the bitcoin to be sent?

(Asked by: username_0 on 2017-08-11)

According to [this](https://bitcoin.stackexchange.com/questions/3374/how-to-redeem-a-basic-tx)

You can specify the amount of bitcoin with an (apparently) 16 alphanumeric hex representation. It is stated you must specify the bitcoin you want to send in units of Satoshi.

Here is the quote:

> We then write an 8-byte field (64 bit integer) containing the amount we want to redeem from the specified output. I will set this to the total amount available in the output minus a fee of 0.001 BTC (0.999 BTC, or 99900000 Satoshis): 605af40500000000

How did they get `605af40500000000` from '99900000 Satoshis' when that hex code = `6943130077857054720`? I can find no conversion calculator online which demonstrates what they are switching it from or to.

I got the hex code from <https://www.mathsisfun.com/binary-decimal-hexadecimal-converter.html>

**Tags:** transactions, raw-transaction, satoshi


---

## 1 answers

### Answer by username_1 on 2017-08-11. Score: 3 | Accepted answer

99900000 in hex is `5F45A60`. Padded out to be a 64-bit integer makes it `0000000005F45A60`. But Bitcoin uses little endian for most things, so this will need to be converted to little endian by byteswapping. So the final value put into a transaction is `605AF40500000000`.

> **Comments:**
> **username_2**: Congrats on your 200th answer. :)  
> **username_0**: Thank you again.  You wouldn't, by chance, know of a website for doing that conversion easily would you?  It looks self explanatory but I could swear I've seen some byteswaps in bitcoin that change a hex number/letter sometimes in addition to moving them around.  Speaking of which, yours even added a "0" between the 4 and the 5.  Yes!  I'm not crazy!  
> **username_1**: Byteswapping will not add characters. Bytes are represented with 2 characters, so to byte swap, you reverse the string in 2 character chunks. This means that the last 2 characters become the first two, the second 2 characters becomes the second 2, and so on. So if you look carefully at the byteswapped string, where you see `05` is actually the `05` that was at the beginning of the hex originally. The 4 is part of `F4`. So it used to look like `F45A`, but now swapped they are `5AF4` which makes you think a 0 was added between the 5 and 4, but it's really a different byte that you are seeing.  
> **username_0**: So I'm not crazy, but I'm still wrong, lol.  Thank you  

---

