Significant Decimal Precision

Santos

New member
Decimal Places.

How many is enough ? Is it ever enough ? (have mentioned this before - can't find the post)

Currently BTC has 8. Clearly not enough. Soon-ish 1 sat will be 1 cent. Need to be able to chop it up less than that for micro-transactions.

One solution, add 8 more at the next fork - but I think this is Hard-Fork territory (unless you limit the processing of these higher precision amounts to ONLY segwit) ?

But that may not last forever.. then what - another fork ?

Is there a solution we can fork that works today and always ? A scalable solution to decimal precision ?

------------

Current transaction validity :

1) Make sure the sum of the inputs is greater than or equal to the sum of the outputs.

2) Check Input Script validity.

3) etc..


Make 2 changes.

1) Represent all numbers in their significant digit format to 16 significant digits. NOT as single satoshis, as a floating point number.

2) Make sure all inputs and outputs in any single transaction are in the same overlapping 16 significant digit range.

What does this mean ?

This means you can have a transaction that has milli-satoshis as long as the largest number in the transaction is less than 999 BTC.
You can have billi-satoshis as long as the largest number in the transaction is less than 99 BTC.

But you can go much lower.. you could be using 10-50 units as long as all the inputs and outputs were in the same sliding scale of magnitude. All the maths is ALWAYS computed to 16 significant digits, it's just the exponent that changes.

Now there is no limit to how many decimal places you can use, BUT you can't mix a million BTC and 1x10-50 BTC.. You would need to use multiple transactions to group together similar size outputs, until they were large enough to be mixed with larger values, or vice versa when trying to spend smaller amounts.

Issues :

1) Fees : may have to be handled separately, like CT. The very small BTC units may represent a coloured coin or token, so although individual values may be small the overall value of the transaction may be large.

2) Fungibility : You now cannot mix outputs with values more than 1016 apart. You can't add a quadrillionth of a satoshi and 1 million BTC in the same transaction. Can in 2 transactions. Does this matter ?
 

Kaiden

Member
Lucky Cryddit! ..

I still think extra decimal places are worth it.

What happens when BTC is worth $10 million ?
Smiley
 

Giovanni

Member
What happens when BTC is worth $10 million ?
Smiley
Then you won't get any change when spending $100 on a cheeseburger, since cents will be a forgotten memory at that point, and nobody will care that Bitcoin can't represent such trifling values.
 

Jesus

Member
Millisatoshi (msat), or 0.001 of a satoshi, is already the base unit on the Lightning Network. For one millisatoshi to equal one US cent, then one bitcoin would have to equal one billion dollars, which would give bitcoin (assuming all 21 million had been mined) a marketcap of 21 quadrillion dollars. This is more than global broad money, all the global real estate, all the money globally in stock markets, and all the global derivative markets combined, by a factor of 10. It will be a long, long time before we will need to subdivide further than one millisatoshi.

The question, then, is whether you think Lightning Network will become the main way in which people exchange bitcoin, and how often you think people will be closing channels. Since millisatoshi can't be broadcast to the main chain, if there is an discrepancy when a channel closes, then the value is simply floored to the nearest satoshi. At present, that means losing out on fractions of a cent, but in the hypothetical situation above, you could lose up to $10 on closing a channel.
 

Calvin

Member
Millisatoshi (msat), or 0.001 of a satoshi, is already the base unit on the Lightning Network. For one millisatoshi to equal one US cent, then one bitcoin would have to equal one billion dollars, which would give bitcoin (assuming all 21 million had been mined) a marketcap of 21 quadrillion dollars.
What happens when BTC is worth $10 million ?
Smiley
Those crazy price predictions will only happen if dollar is affected by a very high inflation. It would not be bitcoin increasing its value, but dollar losing it. At this point, some other pair would be used against BTC, some other fiat or even gold (?)
 

Camden

Member
Creating coloured coins and tokens will be a 'thing' at some point. L-BTC does it.

If you want to represent 21 million token units with 8 decimal places as a token you can either use 21 million BTC (not going to happen) or use MUCH smaller units.

You would need 16 decimal places to be able to colour 2.1 BTC that represented 21 mill to 8 decimal places.

The coloured tokens can be worth MUCH more than their BTC value.

I can see that most of you think we won't ever need to change the decimal precision.. but there are many use cases!
Grin


1)The token thing.

2)IoT M2M payments (something we are working on) will need machines to be able to pay each other micro amounts. A lot.

3) Better Lightning resolution

4) The invention of the stock markets increased global wealth 1000 fold. Crypto will do the same. These numbers will seem small in the coming years. Global wealth will be measured in Mega-Bucks (Million $$).

5) A catastrophe wipes out almost all coins. You find 0.005 BTC. You need to start an entirely new economy with those funds.

We're going to need a bigger boat decimal precision.
 

Jayce

Member
Those crazy price predictions will only happen if dollar is affected by a very high inflation. It would not be bitcoin increasing its value, but dollar losing it. At this point, some other pair would be used against BTC, some other fiat or even gold (?)
Why so pessimistic? There's possibility Bitcoin price going to the moon either because mass adaption or legalization on big country.
By then, people would feel Bitcoin transaction fee is expensive, even though it fees on Bitcoin is unchanged.
 

Rowan

Member
There are no decimal places in bitcoin and it is best we don't introduce them ever either. Floating point numeric types are a headache and can introduce bugs in a lot of implementations in different programming languages, not to mention they are slower.
With that said a simple solution can be this, which has the benefit of decreasing the transaction size too!
This is based on a naive research I did 2 years ago that showed changing every UInt32 in a block to CompactInt could empty the block size by up to 50 kilo bytes.

  • This assumes we do need this increase
  • For easy calculation price of bitcoin is assumed to be $1 million
  • Also the supply has to change from 21000000_00000000 to a fixed value of 21000000_00000000_00000000 (which is similar to 8 more decimal places)
The amount field in transactions can be changed from a UInt64 integral type to a new custom type that is similar to CompactInt but is mostly similar to what DER uses to encode lengths.
First bit, if set, indicates that first byte is the length of the bytes to read. The follow up bytes are the value itself.

To send $100 worth of bitcoin that is 0.00010000_00000000BTC in 16 decimal place representation and 0x0010a5d4e8 in little-endian hexadecimal representation we need 6 bytes. A first byte = 0x85(=0b10000101) followed by the amount. 0x850010a5d4e8. This saves up on 10 bytes.

This can be implemented using transaction version field. Every transaction that has version below 3 has amount field that is the current design of being a UInt64 and has to be multiplied by 108, every transaction with version 3+ has amount field set to the new format.

What this does is avoiding unnecessary complications while giving the implementations the advantage of speed and accuracy of regular integral numeric types. For 99% of the cases amounts sent are going to be smaller than a UInt64 so all the computations are fast and easy, anything bigger (worth >$1.84 billion) is going to be rare and computation requires 2 UInt64 which is still pretty easy, fast and 100% accurate.
Fee calculation and other conditions are still the same and easily calculated in this design.
 

Diego

Member
What happens when BTC is worth $10 million ?
Smiley
Then you won't get any change when spending $100 on a cheeseburger, since cents will be a forgotten memory at that point, and nobody will care that Bitcoin can't represent such trifling values.
That's not necessarily true. When the economy grows, then the value of a fixed/deflationary money supply will grow with it.

For example, 1 BTC is worth about $1 million if Bitcoin replaces all the money in the world, and 1 satoshi is worth about $0.01. But then if the economy grows at about 2% per year for 100 years, then 1 BTC will worth about $10 million in today's dollars, and 1 satoshi is worth $0.10. The price of a Big Mac Extra Value Meal will drop from 399 satoshis to 40 satoshis.
 

Cole

Member
When bitcoin gets to 10mil dollars these would be a problem. But it's nothing a fork can't fix
 

Maxwell

Member
Decimal Places.

How many is enough ? Is it ever enough ? (have mentioned this before - can't find the post)

Currently BTC has 8. Clearly not enough. Soon-ish 1 sat will be 1 cent. Need to be able to chop it up less than that for micro-transactions.

One solution, add 8 more at the next fork - but I think this is Hard-Fork territory (unless you limit the processing of these higher precision amounts to ONLY segwit) ?

But that may not last forever.. then what - another fork ?

Is there a solution we can fork that works today and always ? A scalable solution to decimal precision ?

------------

Current transaction validity :

1) Make sure the sum of the inputs is greater than or equal to the sum of the outputs.

2) Check Input Script validity.

3) etc..


Make 2 changes.

1) Represent all numbers in their significant digit format to 16 significant digits. NOT as single satoshis, as a floating point number.

2) Make sure all inputs and outputs in any single transaction are in the same overlapping 16 significant digit range.

What does this mean ?

This means you can have a transaction that has milli-satoshis as long as the largest number in the transaction is less than 999 BTC.
You can have billi-satoshis as long as the largest number in the transaction is less than 99 BTC.

But you can go much lower.. you could be using 10-50 units as long as all the inputs and outputs were in the same sliding scale of magnitude. All the maths is ALWAYS computed to 16 significant digits, it's just the exponent that changes.

Now there is no limit to how many decimal places you can use, BUT you can't mix a million BTC and 1x10-50 BTC.. You would need to use multiple transactions to group together similar size outputs, until they were large enough to be mixed with larger values, or vice versa when trying to spend smaller amounts.

Issues :

1) Fees : may have to be handled separately, like CT. The very small BTC units may represent a coloured coin or token, so although individual values may be small the overall value of the transaction may be large.

2) Fungibility : You now cannot mix outputs with values more than 1016 apart. You can't add a quadrillionth of a satoshi and 1 million BTC in the same transaction. Can in 2 transactions. Does this matter ?
dude you think 16 digits is too small? wow you think really freaking big.


16 digits will cover for hundreds if not thousands of years.

if a BTC is 1,111,111,111,111 usd then 0.0000000000000001 btc is 0.000111 usd

a btc needs to be worth 111,111,111,111,111 which is 111 trillion

and 111,111,111,111,111 x 0.0000000000000001 = 0.01111111

or 1.1 cents. I won't worry about btc being worth 111 trillion in the next 1000 years.
 

Ivan

Member
Ok.

I can see most of you think that we will never need more than the 8 we have 'because' .. it's enough. (At least for the next 100 years even at 2% expansion)

I think things are moving much faster than that ?

“Measured in current US dollars, total global wealth rose from USD 117 trillion in 2000 to 317 trillion in mid-2018, a rise of USD 200 trillion, equivalent to roughly 2.5 times global GDP.”

We'll soon have individual trillionaires..

There is zero chance we don't hit quintillions as a 'number' in the next 50 years.

Now - is Bitcoin going to live that long ?

I hear this mythical date in 2140 when we find the last scrap.. but does it have to be.. if only we could keep halving.. for-EVER!

Also - We'll be into mega-sexta-zetillions by then.. OF COURSE WE'LL NEED MORE RESOLUTION!! (then)

The M2M economy, as I mentioned earlier, works orders of magnitude lower down the real-time trough. They'll be chatting away hundreds of times a second, querying each other for data etc.. the 'yearly' spend per device will be less than $5.. chopped up millions of times. There are 5 billion Sim/WiFi enabled IoT devices launched a year as of today. Trillions to come. These numbers get really big.

May as well sort this out now.. no ?

Can you fork every time, maybe every 20 years.. add 8 decimal places ? I don't see it. Forks are hard and this is currently a hard fork. Although you could hard-fork a perpetual soft-fork mechanic to do this
Smiley
..hehe

Is there another scheme that works from day one ? - You could just add a decimal place automatically every million blocks or so. As hardware improves, it'll be able to handle it.

But I like the notion that the above scheme never needs better hardware.. for when these things are hardwired, on chip.

Anybody see any problems with it though ?
 
Top