Bitcoin Forum

Other => Beginners & Help => Topic started by: vozho on November 20, 2013, 05:29:15 AM



Title: some technical questions about mining
Post by: vozho on November 20, 2013, 05:29:15 AM
Even though I've read about mining,I'm still confused about some things  :-[
Can you answer me these?

1)Does miner analyze all existing blocks when it mines for new ones?Or no?And why is it that after 2016 blocks difficulty increases,is that hardcoded or just mathematically calculated?

2)How easy it is to mine,if,for example,only genesis block existed?Or maybe if only 5 blocks existed so far(for example,you were one one the earliest miners ever).Was it super easy?(this is related to 1. question).

3)What happens when the block is mined?Does it contain transactions?Is that how pool works-when it mines a block,it contains transactions where sender is administrator of the pool,and receivers are those who were working on a block?And if you solo mined and found a block,you just sent 50BTC to yourself?

Thanks.


Title: Re: some technical questions about mining
Post by: DannyHamilton on November 20, 2013, 10:36:16 PM
1)Does miner analyze all existing blocks when it mines for new ones

If you are mining in a mining pool, you just work on the block that has been supplied to you by the pool.  If you are solo mining, then your client verifies all the currently existing blocks as it initializes.  Then from then on, it only verifies new blocks as it receives them.  The mining software gets a new block to work on from the client and works only on hashing that block until it exhausts all possible variations, or someone else solves the block.

And why is it that after 2016 blocks difficulty increases,is that hardcoded or just mathematically calculated?

Yes.  It is hardcoded to perform the mathematical calculations every 2016 blocks.

2)How easy it is to mine,if,for example,only genesis block existed?Or maybe if only 5 blocks existed so far(for example,you were one one the earliest miners ever).Was it super easy?(this is related to 1. question).

Yes, it was "super easy".  This is because the difficulty would not yet have been adjusted very high yet.

3)What happens when the block is mined?

The mining software calculates a double SHA-256 hash of every variation of the block header that it can as fast as it can until it either finds a resulting hash value that is lower than the target difficulty, or until it received a solved block relayed by someone else.  If your miner is the first to find a suitable hash then the block is broadcast to all connected peers to be verified, added to the blockchain, and relayed to additional peers.

Does it contain transactions?

Yes.

Is that how pool works-when it mines a block,it contains transactions where sender is administrator of the pool,and receivers are those who were working on a block?

It depends on the pool, but generally a block contains a special "subsidy" transaction (called a coinbase transaction) that has "receivers" (called outputs) but no "senders" (called inputs).  This coinbase transaction can be set up to pay all the pools miners directly, or it can just pay it directly to the pool operator, and the pool operator can then send the appropriate transactions from there to any workers.

And if you solo mined and found a block,you just sent 50BTC to yourself?

It is 25 BTC right now (it has been for over a year) and will be for the next 3 years or so.  Then it will be 12.5 BTC for 4 years.


Title: Re: some technical questions about mining
Post by: vozho on November 22, 2013, 12:50:35 AM
thanks for the answers,man.