348Judah (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 24, 2022, 02:37:47 PM |
|
Let's go abit back into history, i came across an article on Satoshi bitcoin decimal place and it rounded down values, some assume the reason to it decimal point of numbers as base on the software design capacity he used then while some give contrary opinion, what Satoshi did then was is base on the fact that he never expected the outcome to go global with adoption to this time or because it's part of his limitation to the extent to which bitcoin can go base on it finite supply? please i need the experience members to shed more light on this. source
|
|
|
|
pooya87
Legendary
Offline
Activity: 3556
Merit: 10803
|
Actually at protocol level there is no decimal places whatsoever. There is only a 64-bit integer that represents amounts in what call satoshis. Meaning 1BTC is actually 100000000 satoshi at code level. Any kind of restriction is a UI thing that can be changed as it was changed over time, it used to be that way because price was very very low. Nowadays wallets show amounts in various formats with or without decimals and using different units (bits, mili and micro BTC).
|
|
|
|
LoyceV
Legendary
Offline
Activity: 3416
Merit: 17280
Thick-Skinned Gang Leader and Golden Feather 2021
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 24, 2022, 02:59:59 PM |
|
Allow me to quote the relevant posts, your screenshot is too small to read: So there is another thread asking about bc and decimal places. It is stated that the client(s) only show 2 decimal places, but there are 8 in total. Now, working on stuff, I find that it would be nice if I could transfer at least 4 decimals precision, but the full 8 would be great.
Looking at the code it seems simple enough to remove the rounding from bitcoind, but what about the receiving side? If it's a non UI client, then it will show everything, but would I be making things overly confusing for GUI clients?
Is there any shortcoming in me patching my client to handle full precision? I would not encourage using the extra decimal places. They're only intended for future use.
You are correct that above 0.01 can still have additional precision, but the recipient won't be able to see it. The UI will show it rounded down. I wasn't into Bitcoin back then, but my guess would be further decimals at that point were simply irrelevant: anything smaller than 0.01 Bitcoin was basically dust. It's funny how it's now worth $200. When I installed Bitcoin Core for the first time (in 2015), all 8 decimals were visible already by default.
|
|
|
|
NotATether
Legendary
Offline
Activity: 1708
Merit: 7184
In memory of o_e_l_e_o
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 24, 2022, 05:37:40 PM |
|
There is no "round-off", floating-point or decimal, whatsoever. Bitcoin balances aren't stored as IEEE-754 double-precision floats, they're stored as 64-bit unsigned longs - this includes the decimal places - as pooya87 pointed out.
|
|
|
|
odolvlobo
Legendary
Offline
Activity: 4424
Merit: 3319
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 24, 2022, 09:47:20 PM Last edit: September 24, 2022, 09:58:48 PM by odolvlobo |
|
The post was about the precision of values displayed in the UI.
He was writing that a higher precision was unnecessary at the time, and that more precision would be necessary in the future when the price would be higher.
Why is the primary unit set to 100 million satoshis? That was never explained.
|
Join an anti-signature campaign: Click ignore on the members of signature campaigns. PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
|
|
|
nc50lc
Legendary
Offline
Activity: 2520
Merit: 5968
Self-proclaimed Genius
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 25, 2022, 04:34:26 AM |
|
-snip- some assume the reason to it decimal point of numbers as base on the software design capacity he used then while some give contrary opinion, what Satoshi did then was is base on the fact that he never expected the outcome to go global with adoption to this time or because it's part of his limitation to the extent to which bitcoin can go base on it finite supply? please i need the experience members to shed more light on this.
Check out this link to Bitcoin's old code ( Sep 7, 2010): /bitcoin/bitcoin/blob/41016bfc46b70aace013ffd29143a27bc7288e48/main.h#L19-L20Even back then, the " COIN" ( 1BTC in satoshi) is already the same as it is today: /bitcoin/bitcoin/blob/master/src/consensus/amount.h#L13-L16Your question seem to be greatly influenced by that Tweet ( the source in the OP): That was 2010, users at that time mostly send whole Bitcoin. Showing beyond two decimal value in the UI is just pointless. But since the author is talking about " no one expected" ( even satoshi), then he's just using it to for publicity since as you can see in the links above, Bitcoin from 2010 was already prepared for that fast paced adoption.
|
|
|
|
LoyceV
Legendary
Offline
Activity: 3416
Merit: 17280
Thick-Skinned Gang Leader and Golden Feather 2021
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 25, 2022, 06:30:10 AM |
|
Why is the primary unit set to 100 million satoshis? That was never explained. As far as I know, that amount was chosen so that Bitcoin can be divided enough to serve the entire global money market. Let's say there's about $40 trillion going around. And let's say there's 20 million Bitcoins to replace those. That means each Bitcoin takes the place of $2 million, and each satoshi is worth $0.02. That's small enough for most practical purposes.
|
|
|
|
n0nce
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 25, 2022, 08:14:01 PM |
|
There is no "round-off", floating-point or decimal, whatsoever. Bitcoin balances aren't stored as IEEE-754 double-precision floats, they're stored as 64-bit unsigned longs - this includes the decimal places - as pooya87 pointed out.
It's still funny that the software actually rounded the 100,000,000sat number into a BTC-denominated value with a maximum of 2 decimal places, back in the day! My guess is that satoshi just didn't like the look; he may just have liked the look of most fiat currencies which have 'cents' as smallest denomination - always representable in 2 decimal places. Now, it would be interesting to know when this weird rounding idea was finally removed from Bitcoin Core.. ![Grin](https://bitcointalk.org/Smileys/default/grin.gif)
|
|
|
|
pooya87
Legendary
Offline
Activity: 3556
Merit: 10803
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 26, 2022, 03:49:19 AM |
|
they're stored as 64-bit unsigned longs
For reasons that I don't know of, the amounts are stored as signed integers (int64_t) not unsigned. https://github.com/bitcoin/bitcoin/blob/623745ca74cf3f54b474dac106f5802b7929503f/src/consensus/amount.h#L12My guess is that satoshi just didn't like the look; he may just have liked the look of most fiat currencies which have 'cents' as smallest denomination - always representable in 2 decimal places.
Possibly. He could have been trying to make bitcoin feel like most other currency people are used to which have 2 decimal places regardless of what he liked.
|
|
|
|
LoyceV
Legendary
Offline
Activity: 3416
Merit: 17280
Thick-Skinned Gang Leader and Golden Feather 2021
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 26, 2022, 07:30:41 AM |
|
My guess is that satoshi just didn't like the look; he may just have liked the look of most fiat currencies which have 'cents' as smallest denomination - always representable in 2 decimal places. That makes sense: if you have to pay 232765892 sat, it takes longer to understand the amount than when you pay 2.33 BTC. Even adding thousand separators doesn't really help because Bitcoin has 8 instead of 9 decimals: 232,765,892 sat still looks weird. Since I started with Bitcoin, I preferred mBTC. At the time it was worth around $0.20, now $19. Units that are closer to a dollar are just more convenient for everyday purchases.
|
|
|
|
odolvlobo
Legendary
Offline
Activity: 4424
Merit: 3319
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 26, 2022, 09:51:10 AM |
|
I assume signed because it is common to have negative amounts of money (debits, for example). Besides, the range -2.1x10 15 to 2.1x10 15 easily fits in a signed 64-bit integer, so there is no reason to make it unsigned.
|
Join an anti-signature campaign: Click ignore on the members of signature campaigns. PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
|
|
|
achow101
Moderator
Legendary
Offline
Activity: 3486
Merit: 6823
Just writing some code
|
I assume signed because it is common to have negative amounts of money (debits, for example). Besides, the range -2.1x1015 to 2.1x1015 easily fits in a signed 64-bit integer, so there is no reason to make it unsigned.
Common on centralized system, but not on Bitcoin. Especially when the code is located on consensus directory. IMO it's more likely signed int64 is used to prevent underflow when total coin on output is bigger than total coin in input. Signed integers isn't to "prevent underflow". It is required in order to detect underflow and catch invalid conditions involving negative amounts. However negative amounts are also used internally in several places; the wallet has debits and will show negative amounts for sent Bitcoin.
|
|
|
|
BlackHatCoiner
Legendary
Offline
Activity: 1624
Merit: 7958
Bitcoin is a royal fork
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 26, 2022, 06:11:58 PM |
|
That means each Bitcoin takes the place of $2 million, and each satoshi is worth $0.02. That's small enough for most practical purposes. Off-chain asides, moving 1 satoshi is non-standard, though. You'll have to move about 500 times more than that to let it propagate. However, it can change if the market value rises that much, it isn't a consensus rule. I assume signed because it is common to have negative amounts of money (debits, for example). But you can't have negative amounts of cash. As for signed & unsigned int, this is the only thing that's said from satoshi: unsigned int is good until 2106. Surely the network will have to be totally revamped at least once by then.
There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int.
|
|
|
|
odolvlobo
Legendary
Offline
Activity: 4424
Merit: 3319
|
As for signed & unsigned int, this is the only thing that's said from satoshi: unsigned int is good until 2106. Surely the network will have to be totally revamped at least once by then. There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int.
That's regarding an issue with timestamps.
|
Join an anti-signature campaign: Click ignore on the members of signature campaigns. PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
|
|
|
BlackHatCoiner
Legendary
Offline
Activity: 1624
Merit: 7958
Bitcoin is a royal fork
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 26, 2022, 07:32:35 PM |
|
That's regarding an issue with timestamps. True, but I haven't found anything else with the word "signed" from him in this forum. Can he possibly have explained it elsewhere?
|
|
|
|
odolvlobo
Legendary
Offline
Activity: 4424
Merit: 3319
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 26, 2022, 07:55:22 PM |
|
That's regarding an issue with timestamps. True, but I haven't found anything else with the word "signed" from him in this forum. Can he possibly have explained it elsewhere? Personally, I don't feel that there needs to be an explanation. Numbers used in arithmetic should be signed. Denying the existence of negative numbers is bound to lead to trouble. ![Wink](https://bitcointalk.org/Smileys/default/wink.gif)
|
Join an anti-signature campaign: Click ignore on the members of signature campaigns. PGP Fingerprint: 6B6BC26599EC24EF7E29A405EAF050539D0B2925 Signing address: 13GAVJo8YaAuenj6keiEykwxWUZ7jMoSLt
|
|
|
n0nce
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 27, 2022, 12:48:39 AM |
|
That means each Bitcoin takes the place of $2 million, and each satoshi is worth $0.02. That's small enough for most practical purposes. Off-chain asides, moving 1 satoshi is non-standard, though. You'll have to move about 500 times more than that to let it propagate. However, it can change if the market value rises that much, it isn't a consensus rule. Good point. Also, moving 1 satoshi even if it worked, would always require 1*[size of tx] in fees. So the fee would be [size of tx] times larger than the actual amount if we actually attempted to transact the smallest possible amount. I guess it would have been smart if satoshi designed Bitcoin such that the fee can be smaller than any sendable amount. In other words; the minimum fee should be smaller than the minimum transfer value. In practice though, it just means the point where it becomes infeasible doing an on-chain transfer will come a bit earlier, and definitely before 1 satoshi has a substantial amount of value. If we estimate tx size of ~200 bytes, and assume we can use 1sat fee, a price of ~0.10€/sat or 10sat/€ would mean at the very least 20 bucks for a Bitcoin transaction. Even 0.01€/sat or 100sat/€ would be rather high; resulting in a minimum fee of 2€ at the very least. This would be the case if / when Bitcoin reaches a price of €1m per BTC, which doesn't seem too outrageous. As for signed & unsigned int, this is the only thing that's said from satoshi: unsigned int is good until 2106. Surely the network will have to be totally revamped at least once by then.
There should not be any signed int. If you've found a signed int somewhere, please tell me (within the next 25 years please) and I'll change it to unsigned int.
That's actually super interesting, because it sounds like he considered sticking to the project for 25 more years at that point in time.
|
|
|
|
pooya87
Legendary
Offline
Activity: 3556
Merit: 10803
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 27, 2022, 03:45:01 AM |
|
Numbers used in arithmetic should be signed.
But there isn't much consensus critical arithmetic when it comes to transaction amounts. The only thing I can think of is: sum(inputs) >= sum(outputs) and whether the numbers are treated as signed or unsigned doesn't affect that.
|
|
|
|
LoyceV
Legendary
Offline
Activity: 3416
Merit: 17280
Thick-Skinned Gang Leader and Golden Feather 2021
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 27, 2022, 07:32:27 AM |
|
Good point. Also, moving 1 satoshi even if it worked, would always require 1*[size of tx] in fees. So the fee would be [size of tx] times larger than the actual amount if we actually attempted to transact the smallest possible amount. I guess it would have been smart if satoshi designed Bitcoin such that the fee can be smaller than any sendable amount. In other words; the minimum fee should be smaller than the minimum transfer value. As far as I know, there is no minimum fee. Miners can include transactions without fee (or 1 sat, if they want). The 1 sat/vbyte minimum is "only" the default setting of most nodes. A few years back I read about plans to lower this to 0.1 sat/vbyte, but it wasn't implemented. Even 0.01€/sat or 100sat/€ would be rather high; resulting in a minimum fee of 2€ at the very least. This would be the case if / when Bitcoin reaches a price of €1m per BTC, which doesn't seem too outrageous. By then, small transactions would have to happen off-chain to get lower fees.
|
|
|
|
348Judah (OP)
|
![](https://bitcointalk.org/Themes/custom1/images/post/xx.gif) |
September 30, 2022, 12:03:20 PM |
|
-snip- some assume the reason to it decimal point of numbers as base on the software design capacity he used then while some give contrary opinion, what Satoshi did then was is base on the fact that he never expected the outcome to go global with adoption to this time or because it's part of his limitation to the extent to which bitcoin can go base on it finite supply? please i need the experience members to shed more light on this.
Check out this link to Bitcoin's old code ( Sep 7, 2010): /bitcoin/bitcoin/blob/41016bfc46b70aace013ffd29143a27bc7288e48/main.h#L19-L20Even back then, the " COIN" ( 1BTC in satoshi) is already the same as it is today: /bitcoin/bitcoin/blob/master/src/consensus/amount.h#L13-L16Your question seem to be greatly influenced by that Tweet ( the source in the OP): That was 2010, users at that time mostly send whole Bitcoin. Showing beyond two decimal value in the UI is just pointless. But since the author is talking about " no one expected" ( even satoshi), then he's just using it to for publicity since as you can see in the links above, Bitcoin from 2010 was already prepared for that fast paced adoption. Thank you for the information, now i understand the main idea from Satoshi mindset right from the beginning, nothing changed about it but people entirely give a different approach for misconception, every other suggestions and comments were also well acknowledged concerning this and I've got more clearer picture to the fact behind the UI precision value system, thank you all
|
|
|
|
|