Author

Topic: The Decimal Place of Bitcoin Round off Value a Limitation? (Read 296 times)

hero member
Activity: 714
Merit: 521
-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-L20
Even back then, the "COIN" (1BTC in satoshi) is already the same as it is today: /bitcoin/bitcoin/blob/master/src/consensus/amount.h#L13-L16

Your 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
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
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.
legendary
Activity: 3472
Merit: 10611
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.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
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.
legendary
Activity: 4466
Merit: 3391
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
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
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?
legendary
Activity: 4466
Merit: 3391
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.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
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.
staff
Activity: 3458
Merit: 6793
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.
legendary
Activity: 4466
Merit: 3391
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#L12

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.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
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.
legendary
Activity: 3472
Merit: 10611
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#L12

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.
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.
hero member
Activity: 882
Merit: 5834
not your keys, not your coins!
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
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
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.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
-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-L20
Even back then, the "COIN" (1BTC in satoshi) is already the same as it is today: /bitcoin/bitcoin/blob/master/src/consensus/amount.h#L13-L16

Your 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.
legendary
Activity: 4466
Merit: 3391
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.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
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.
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
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.
legendary
Activity: 3472
Merit: 10611
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).
hero member
Activity: 714
Merit: 521
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
Jump to: