Bitcoin Forum

Other => Beginners & Help => Topic started by: adhoc on January 09, 2012, 02:57:19 PM



Title: Bitcoin generation transaction and difficulty adjustment - how are they decided?
Post by: adhoc on January 09, 2012, 02:57:19 PM
Hello,

I've been reading about bitcoins for some time, particularly about the protocol and the cryptographic basis of it, and it all seems very exciting. I've read Satoshi's original whitepaper which cleared up a number of questions I had about the protocol, but I still have two questions I need to clarify to be confident that I understand how bitcoins work:

1) The 50 bitcoin generation transaction included with every new block - how is this 50 number decided? I know the protocol is designed to gradually reduce and cap the number of coins at 21 million, but what stops someone releasing a miner which tries to give itself 1000 bitcoins in the generation transaction? Is there some kind of cryptographic assurance of how many bitcoins are allowed in this transaction or is it just hardcoded into the various clients and miners?

2) How is the difficulty/target agreed upon? It seems easy enough to calculate what the difficulty SHOULD be based on the block generation rate for the past X time (a week I think), but what stops the people who write GPU mining software from changing the algorithm to lower the difficulty? Especially given that it would, in the short term at least, be beneficial to the miners to have a lower-than-it-should-be difficulty in order to generate new blocks quicker.

Basically my question boils down to how the network maintains these universal variables without a malicious and/or selfish group of users being able to manipulate it.


Title: Re: Bitcoin generation transaction and difficulty adjustment - how are they decided?
Post by: DeathAndTaxes on January 09, 2012, 03:03:58 PM
1) The 50 bitcoin generation transaction included with every new block - how is this 50 number decided? I know the protocol is designed to gradually reduce and cap the number of coins at 21 million, but what stops someone releasing a miner which tries to give itself 1000 bitcoins in the generation transaction? Is there some kind of cryptographic assurance of how many bitcoins are allowed in this transaction or is it just hardcoded into the various clients and miners?

Other nodes.  Your coins only have validity if they are accepted by other clients.  Kinda like a dollar is only worth a dollar if someone will accept it.  If you mine a block which breaks protocol rules then it will be rejected by other clients and is worthless.  The "rules" (which are part of every client) says that the reward starts at 50 BTC and specifies the algorithm under which it is reduced (by halving) until 0 BTC (@ block 6,300,000).

Quote
2) How is the difficulty/target agreed upon? It seems easy enough to calculate what the difficulty SHOULD be based on the block generation rate for the past X time (a week I think), but what stops the people who write GPU mining software from changing the algorithm to lower the difficulty? Especially given that it would, in the short term at least, be beneficial to the miners to have a lower-than-it-should-be difficulty in order to generate new blocks quicker.

Same as #1.  All clients know how difficult every block should be.  If a block which doesn't match expected difficulty is detected then it is rejected and any work does is worthless.


Title: Re: Bitcoin generation transaction and difficulty adjustment - how are they decided?
Post by: adhoc on January 09, 2012, 03:06:29 PM
Ah ok, so is this one of the times where in order to manipulate the protocol you would have to have >50% of the mining power?


Title: Re: Bitcoin generation transaction and difficulty adjustment - how are they decided?
Post by: DeathAndTaxes on January 09, 2012, 03:13:55 PM
Ah ok, so is this one of the times where in order to manipulate the protocol you would have to have >50% of the mining power?


No even 99% of the hashing power wouldn't allow you to do that.

You need 51% of the nodes to accept our changes as valid and in doing so would fork the network. 

There would be Bitcoin legacy - which follows existing rules and Bitcoin new - which follows the new rules.

Hashing power only allows you to make a block.  For the block to have any validity it must be accepted by the network.   The peers collectively determine what is acceptable.


Title: Re: Bitcoin generation transaction and difficulty adjustment - how are they decided?
Post by: adhoc on January 09, 2012, 03:18:44 PM
That makes sense - thanks for clearing that up!