Pages:
Author

Topic: Integer or float used in Bitcoin? - page 2. (Read 7404 times)

legendary
Activity: 3472
Merit: 4801
December 21, 2012, 12:56:40 PM
#9
This creates essentially two incompatible cryptocurrencies each calling themselves "bitcoin".
Assuming that there is anyone using the old one— the way you'd actually do this change is that you'd write it, validate it, test it.. and then agree that it would become active as of block  now+16 years (or whatever).  Then everyone has 16 years to update, and after than new blocks are interpreted the new way.

This sort of thing could be done for changes which are clearly necessary and uncontroversial— and I'd guess a precision increase would fit that bill if bitcoin ever deflated to the point where it seemed like it would eventually be an issue—, but it's not generally viable otherwise.

Agreed.  That would be why I originally stated:

. . . statements suggesting "infinitely divisible", and "we can just add more decimals" would not be quite as simple to implement as some people believe.  If it becomes necessary to do so, then it is possible, just not as easy to do as it is to say.
staff
Activity: 4284
Merit: 8808
December 21, 2012, 12:40:51 PM
#8
This creates essentially two incompatible cryptocurrencies each calling themselves "bitcoin".
Assuming that there is anyone using the old one— the way you'd actually do this change is that you'd write it, validate it, test it.. and then agree that it would become active as of block  now+16 years (or whatever).  Then everyone has 16 years to update, and after than new blocks are interpreted the new way.

This sort of thing could be done for changes which are clearly necessary and uncontroversial— and I'd guess a precision increase would fit that bill if bitcoin ever deflated to the point where it seemed like it would eventually be an issue—, but it's not generally viable otherwise.

legendary
Activity: 2058
Merit: 1452
legendary
Activity: 3472
Merit: 4801
December 21, 2012, 12:10:59 PM
#6
What would it take to update the protocol to, say, a 128-bit integer?
If you are suggesting that as a way to increase the number of decimal places a bitcoin can be split into, then it would take more than increasing the number of bits in the integer, you'd also have to multiply all values in the blockchain by some multiple of 10 to increase the number of digits in the values.  This would be a "hard fork", meaning that anybody who didn't upgrade, would continue to operate on the old system, and anybody who did upgrade would be operating on the new system.  This creates essentially two incompatible cryptocurrencies each calling themselves "bitcoin".
member
Activity: 62
Merit: 10
December 21, 2012, 11:48:03 AM
#5
What would it take to update the protocol to, say, a 128-bit integer?
legendary
Activity: 3472
Merit: 4801
December 21, 2012, 05:57:07 AM
#4
Values in bitcoind are 64-bit integers, with a convention that "a bitcoin" means put the decimal point 8 places from the right.
Which is why the "Satoshi" is currently the smallest unit of value that can be used in a transaction.

This is also why statements suggesting "infinitely divisible", and "we can just add more decimals" would not be quite as simple to implement as some people believe.  If it becomes necessary to do so, then it is possible, just not as easy to do as it is to say.
legendary
Activity: 2506
Merit: 1010
December 21, 2012, 12:56:37 AM
#3
Values in bitcoind are 64-bit integers, with a convention that "a bitcoin" means put the decimal point 8 places from the right.

The Bitcoin.org client will display the number according to the value of the units setting (i.e.,. BTC, mBTC, or uBTC).

For instance;

Here's the raw data for a transaction:
 - http://blockchain.info/rawtx/97990146ef27291626518b39b0217caa38276d5ed16306ef233d90d0c1414924

The inputs are:
 "value":5103074576    <--   51.03074576 BTC
 "value":4882066520    <---  48.82066520 BTC

There is just one output, and the value of it is:
 "value":9985141096    <--   99.85141096 BTC
pc
sr. member
Activity: 253
Merit: 250
December 20, 2012, 09:25:42 PM
#2
Values in bitcoind are 64-bit integers, with a convention that "a bitcoin" means put the decimal point 8 places from the right.
newbie
Activity: 22
Merit: 0
December 20, 2012, 09:12:12 PM
#1
What data type is used in Bitcoin to store the value of a transaction?

I doubt it's double or float due to rounding errors. My guess is that it's integer or long with a system for moving the decimal. Can someone help explain this?

I tried Google, but it said just "I don't know".

Thanks.
Pages:
Jump to: