Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 06, 2018, 04:07:16 PM |
|
Can I set the static const int64 MAX_MONEY = 84000000 * COIN; from 84.000.000 to 1.000.000.000.000 in src/main.h ? Will not this be too large a number? Thank you!
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4790
|
|
May 06, 2018, 04:13:10 PM |
|
Since MAX_MONEY isn't actually used for controling how many coins are created, setting it bigger will just introduce some potential bugs.
|
|
|
|
Xynerise
Sr. Member
Offline
Activity: 322
Merit: 363
39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD
|
|
May 06, 2018, 04:21:33 PM |
|
Can I set the static const int64 MAX_MONEY = 84000000 * COIN; from 84.000.000 to 1.000.000.000.000 in src/main.h ? Will not this be too large a number? Thank you! As Danny said, Max_money has no effect whatsoever on the amount of coins. Instead bitcoin uses the block subsidy and halving schedule in order to calculate the total max amount of coins. There are 50 Bitcoins created every block (starting from genesis block) and the amount halves every 210,000 blocks (~4 years) Summing that gives us 21,000,000 coins max for bitcoin.
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4790
|
|
May 06, 2018, 04:40:43 PM |
|
There are 50 Bitcoins created every block (starting from genesis block) and the amount halves every 210,000 blocks (~4 years) Summing that gives us 21,000,000 coins max for bitcoin. Additionally, the number of coins created are managed as integers at the satoshi (0.00000001 BTC) level. Any decimal amount is simply truncated. Therefore, when the block reward is cut in half from 0.09765625 the next reward is 0.04882812 0 instead of 0.04882812 5. Then again when the block reward is cut in half from 0.01220703 the next reward is 0.00610351 0 instead of 0.00610351 5. Then from there the next reward is 0.00305175 0 instead of 0.00305175 5Then 0.00152587 0 instead of 0.00152587 5and so on... After you subtract out all those missing half-satoshis, the end result when the reward is cut from 0.00000001 to 0.0 is that only 20999999.9769 BTC have actually been mined. Furthermore, early on, there was a bug in someone's mining software. Because of the bug, they awarded themselves LESS than the maximum allowed block reward. This (along with other transaction effects) has resulted in more than 135.20897145 BTC missing from the UTXO in the blockchain. As such, there will never actually be more than 20999864.7679 BTC in the UTXO once all the bitcoins have been mined.
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 06, 2018, 05:30:46 PM |
|
Thank you, but I'm not talking about this. Suppose I set a reward of 1.000.000 per block.Than static const int64 MAX_MONEY = 1000000000000 * COIN;
Will this number (1000000000000) exceed the maximum allowed?
|
|
|
|
Heisenberg_Hunter
Legendary
Offline
Activity: 1584
Merit: 1280
Heisenberg Design Services
|
|
May 06, 2018, 06:11:42 PM |
|
Thank you, but I'm not talking about this. Suppose I set a reward of 1.000.000 per block.Than static const int64 MAX_MONEY = 1000000000000 * COIN;
Will this number (1000000000000) exceed the maximum allowed? No. MAX_MONEY constant will prevent us to from doing a transaction not more than 1000000000000 . Max_Money has nothing to do with supply, it will just check weather the transaction is valid and is the transaction not more than the maximum coins. Your rewards (1 million) are for the initial blocks, it would decrease as years pass by and the final coin count will be surely less than 1000000000000 (considering your case)
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 06, 2018, 08:22:36 PM |
|
No. MAX_MONEY constant will prevent us to from doing a transaction not more than 1000000000000 . Max_Money has nothing to do with supply, it will just check weather the transaction is valid and is the transaction not more than the maximum coins. Your rewards (1 million) are for the initial blocks, it would decrease as years pass by and the final coin count will be surely less than 1000000000000 (considering your case)
Thank you! But can there be any limitations in the language (C++)? I remember that this is possible and somehow related to data types. For example, a "nonce" can not be more than a certain value - it is necessary to increment the value of "time".
|
|
|
|
cr1776
Legendary
Offline
Activity: 4144
Merit: 1307
|
|
May 06, 2018, 08:41:55 PM |
|
No. MAX_MONEY constant will prevent us to from doing a transaction not more than 1000000000000 . Max_Money has nothing to do with supply, it will just check weather the transaction is valid and is the transaction not more than the maximum coins. Your rewards (1 million) are for the initial blocks, it would decrease as years pass by and the final coin count will be surely less than 1000000000000 (considering your case)
Thank you! But can there be any limitations in the language (C++)? I remember that this is possible and somehow related to data types. For example, a "nonce" can not be more than a certain value - it is necessary to increment the value of "time". There are obviously limitations in every programming language. If you are still talking about static const int64 MAX_MONEY = 84000000 * COIN;
then you are dealing with an int64 value 8 bytes, 64 bits: Int64 -- (-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807). (Or if it uint64 is unsigned, then 0 to double that.) Is that what you are asking?
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 06, 2018, 09:13:20 PM |
|
There are obviously limitations in every programming language. If you are still talking about static const int64 MAX_MONEY = 84000000 * COIN;
then you are dealing with an int64 value 8 bytes, 64 bits: Int64 -- (-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807). (Or if it uint64 is unsigned, then 0 to double that.) Is that what you are asking? YES! This is it! Thank you SO MUCH, Bro!
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 07, 2018, 12:47:26 PM |
|
...hmmm But when I try to compile it, it say to me: src/main.h:55:47: warning: integer overflow in expression [-Woverflow] static const int64 MAX_MONEY = 13000000000000 * COIN; What can I do with it? //Or nothing needs to be done?
|
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
May 07, 2018, 12:53:12 PM |
|
...hmmm But when I try to compile it, it say to me: src/main.h:55:47: warning: integer overflow in expression [-Woverflow] static const int64 MAX_MONEY = 13000000000000 * COIN; What can I do with it? //Or nothing needs to be done? An overflow is accomplished when you perform an arithmetic operation (e.g. multiplying) which results in an result bigger than possible to be represented by the chosen size of the data type. So you have either to choose another data type or use a work around. Mind telling us what you are trying to create? Another bitcoin fork?
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 07, 2018, 01:30:17 PM |
|
Mind telling us what you are trying to create? Another bitcoin fork?
Yes With MAX_MONEY = 13000000000000. And it is unclear what exactly needs to be changed if Int64 -- (-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807). (Or if it uint64 is unsigned, then 0 to double that.) 13000000000000 < 9,223,372,036,854,775,807
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4790
|
|
May 07, 2018, 02:02:50 PM |
|
And it is unclear what exactly needs to be changed if Int64 -- (-9,223,372,036,854,775,808 to +9,223,372,036,854,775,807). (Or if it uint64 is unsigned, then 0 to double that.) 13000000000000 < 9,223,372,036,854,775,807 What did you set the value of COIN to? What is the result of multiplying the value of COIN by 13000000000000? Is it greater than 9,223,372,036,854,775,807 ? You probably shouldn't be messing around with programming if you don't understand anything about programming. You are likely to introduce bugs and security flaws without knowing it.
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 07, 2018, 02:17:18 PM |
|
What did you set the value of COIN to?
What is the result of multiplying the value of COIN by 13000000000000? Is it greater than 9,223,372,036,854,775,807 ?
I do not know what this variable is - COIN. Can you tell me? This is for example also here: int64 nSubsidy = 50 * COIN; I do not understand why "50" for something else to multiply?
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 07, 2018, 03:35:08 PM |
|
found this static const int64 COIN = 100000000; Now it is clear... ...but it is unclear what to do)) Can I change variable type int64 in int64 nSubsidy = 1000000000000 * COIN; to... what? int128? Tell me please.
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 07, 2018, 03:44:13 PM |
|
And if I just make less value static const int64 COIN = 100000000; in src\util.hThis will simply reduce the value after the decimal point? And do not have to change anything else?
|
|
|
|
bob123
Legendary
Offline
Activity: 1624
Merit: 2481
|
|
May 07, 2018, 04:12:00 PM |
|
int128? And if I just make less value static const int64 COIN = 100000000; in src\util.hThis will simply reduce the value after the decimal point? And do not have to change anything else? You do realize that 'reducing the value after the decimal point' does give you less (smallest) possible units? It doesn't matter whether you have 100.000.000 ShitCoins with 100.000.000 shitoshis each or 100.000.000.000.000 shitcoins with 100 shitoshis each. You are basically just changing what you define as one shitcoin (1 shitcoin = x shitoshis). You are not only missing the whole point, but also seem to be unable to set up a proper crypto currency design. Please do not create another forked coin (excluding educational purpose, of course). It won't have any value.
|
|
|
|
DannyHamilton
Legendary
Offline
Activity: 3472
Merit: 4790
|
|
May 07, 2018, 04:14:02 PM |
|
This forum is to discuss Bitcoin. If you want to gain a beginner level understanding of how to program in C or C++, you'll need to look elsewhere. Read this book until you understand it. It will answer most of your questions. https://www.amazon.com/Programming-Language-2nd-Brian-Kernighan/dp/0131103628Then, if you still have questions, come back and ask. Your profile says: "I can make a bitcoin clone for your money". I am not going to do the work for you. You want to get paid, then do the work yourself. If you are unable, then your customers need to pay SOMEONE ELSE that actually knows what they are doing.
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 07, 2018, 04:42:08 PM |
|
It doesn't matter whether you have 100.000.000 ShitCoins with 100.000.000 shitoshis each or 100.000.000.000.000 shitcoins with 100 shitoshis each.
Yes, I understand that. You are not only missing the whole point, but also seem to be unable to set up a proper crypto currency design.
And it is possible more in detail? What does "proper crypto currency design" mean?
|
|
|
|
Many Coins (OP)
Member
Offline
Activity: 266
Merit: 11
Lord Shiva
|
|
May 07, 2018, 05:03:55 PM |
|
I am not going to do the work for you. You want to get paid, then do the work yourself. If you are unable, then your customers need to pay SOMEONE ELSE that actually knows what they are doing.
And how do you know that he really knows this? Just because he does not ask questions on the forum, but just silently makes mistakes in the code? ))
|
|
|
|
|