Bitcoin Forum
February 27, 2020, 09:19:35 AM *
News: Latest Bitcoin Core release: 0.19.0.1 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: The maximum number of coins in BC 0.8?  (Read 148 times)
Many Coins
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 06, 2018, 04:07:16 PM
 #1

Can I set the

Code:
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!

Here is my personal website: https://2winners.com/
1582795175
Hero Member
*
Offline Offline

Posts: 1582795175

View Profile Personal Message (Offline)

Ignore
1582795175
Reply with quote  #2

1582795175
Report to moderator
1582795175
Hero Member
*
Offline Offline

Posts: 1582795175

View Profile Personal Message (Offline)

Ignore
1582795175
Reply with quote  #2

1582795175
Report to moderator
1582795175
Hero Member
*
Offline Offline

Posts: 1582795175

View Profile Personal Message (Offline)

Ignore
1582795175
Reply with quote  #2

1582795175
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1582795175
Hero Member
*
Offline Offline

Posts: 1582795175

View Profile Personal Message (Offline)

Ignore
1582795175
Reply with quote  #2

1582795175
Report to moderator
1582795175
Hero Member
*
Offline Offline

Posts: 1582795175

View Profile Personal Message (Offline)

Ignore
1582795175
Reply with quote  #2

1582795175
Report to moderator
1582795175
Hero Member
*
Offline Offline

Posts: 1582795175

View Profile Personal Message (Offline)

Ignore
1582795175
Reply with quote  #2

1582795175
Report to moderator
DannyHamilton
Legendary
*
Offline Offline

Activity: 2338
Merit: 1718



View Profile
May 06, 2018, 04:13:10 PM
 #2

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 Offline

Activity: 322
Merit: 297

39twH4PSYgDSzU7sLnRoDfthR6gWYrrPoD


View Profile
May 06, 2018, 04:21:33 PM
Merited by suchmoon (1)
 #3

Can I set the

Code:
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 Offline

Activity: 2338
Merit: 1718



View Profile
May 06, 2018, 04:40:43 PM
Merited by suchmoon (2)
 #4

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.048828120 instead of 0.048828125.
Then again when the block reward is cut in half from 0.01220703 the next reward is 0.006103510 instead of 0.006103515.
Then from there the next reward is 0.003051750 instead of 0.003051755
Then 0.001525870 instead of 0.001525875
and 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
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 06, 2018, 05:30:46 PM
 #5

Thank you, but I'm not talking about this.

Suppose I set a reward of 1.000.000 per block.

Than
Code:
static const int64 MAX_MONEY = 1000000000000 * COIN;

Will this number (1000000000000) exceed the maximum allowed?

Here is my personal website: https://2winners.com/
Heisenberg_Hunter
Hero Member
*****
Offline Offline

Activity: 784
Merit: 814



View Profile WWW
May 06, 2018, 06:11:42 PM
 #6

Thank you, but I'm not talking about this.

Suppose I set a reward of 1.000.000 per block.

Than
Code:
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
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 06, 2018, 08:22:36 PM
 #7

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".

Here is my personal website: https://2winners.com/
cr1776
Legendary
*
Offline Offline

Activity: 2534
Merit: 1087


View Profile
May 06, 2018, 08:41:55 PM
 #8

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
Code:
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
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 06, 2018, 09:13:20 PM
 #9


There are obviously limitations in every programming language.

If you are still talking about
Code:
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!  Smiley

Here is my personal website: https://2winners.com/
Many Coins
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 07, 2018, 12:47:26 PM
 #10

...hmmm

But when I try to compile it, it say to me:

Code:
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?

Here is my personal website: https://2winners.com/
bob123
Legendary
*
Offline Offline

Activity: 1148
Merit: 1655



View Profile WWW
May 07, 2018, 12:53:12 PM
 #11

...hmmm

But when I try to compile it, it say to me:

Code:
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
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 07, 2018, 01:30:17 PM
 #12

Mind telling us what you are trying to create? Another bitcoin fork?

Yes Smiley

With MAX_MONEY = 13000000000000.

And it is unclear what exactly needs to be changed if

Quote
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

 Huh

Here is my personal website: https://2winners.com/
DannyHamilton
Legendary
*
Offline Offline

Activity: 2338
Merit: 1718



View Profile
May 07, 2018, 02:02:50 PM
 #13

And it is unclear what exactly needs to be changed if

Quote
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

 Huh

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
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 07, 2018, 02:17:18 PM
 #14


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:

Code:
int64 nSubsidy = 50 * COIN;

I do not understand why "50" for something else to multiply?

Here is my personal website: https://2winners.com/
Many Coins
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 07, 2018, 03:35:08 PM
 #15

found this

Code:
static const int64 COIN = 100000000;

Now it is clear...

...but it is unclear what to do))

Can I change variable type int64 in

Code:
int64 nSubsidy = 1000000000000 * COIN;

to... what?

int128?  Smiley

Tell me please.


Here is my personal website: https://2winners.com/
Many Coins
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 07, 2018, 03:44:13 PM
 #16

And if I just make less value

Code:
static const int64 COIN = 100000000;

in src\util.h

This will simply reduce the value after the decimal point?

And do not have to change anything else?

Here is my personal website: https://2winners.com/
bob123
Legendary
*
Offline Offline

Activity: 1148
Merit: 1655



View Profile WWW
May 07, 2018, 04:12:00 PM
 #17

int128?  Smiley

 Roll Eyes




And if I just make less value

Code:
static const int64 COIN = 100000000;

in src\util.h

This 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 Offline

Activity: 2338
Merit: 1718



View Profile
May 07, 2018, 04:14:02 PM
Merited by Xynerise (2)
 #18

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/0131103628

Then, 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
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 07, 2018, 04:42:08 PM
 #19


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?

Here is my personal website: https://2winners.com/
Many Coins
Jr. Member
*
Offline Offline

Activity: 238
Merit: 8

Web Dev (Laravel & Vue.js)


View Profile
May 07, 2018, 05:03:55 PM
 #20

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? Smiley

Just because he does not ask questions on the forum, but just silently makes mistakes in the code? ))

Here is my personal website: https://2winners.com/
Pages: [1] 2 »  All
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!