Bitcoin Forum
November 07, 2024, 09:23:02 AM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Questions on the Mining Process  (Read 917 times)
kuloch (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
June 16, 2011, 07:47:17 AM
 #1

After spending most of last night and today reading up on BitCoin, I still have a few questions.  Please also correct me where I state something incorrectly.  Pointing me in the direction of good further reading on the subject is just as much appreciated as an answer.

As best I understand the BitCoin mining process:

BitCoin miners work with the existing accepted block chain to create a new block hash.  The new block itself contains recent transactions (since the last validated block?), a random number, and the previous (most recently validated) block's hash.  The new block is hashed until a hash is found that meets the current difficulty standards.  The new block is then published - presumably with its hash and the key required to validate it - in hope that it will be generally validated and yield a BitCoin minting (currently 50 BTC).

Question 1:
If Alice has just created a successful hash and publishes her new block to the network just moments after Bob has published his own block and hash, would the network then (likely) reject Alice's block in favor of Bob's probably already accepted block?

Question 2:
I'm asking this about the "original" BitCoin client at bitcoin.org, although I expect that all other miners generally do the same.  As the client receives notifications of published blocks and transactions, it presumably uses them in its block hashes? (and stops using "old" information as appropriate?)

Question 3:
I see a couple posts mentioning that mining has been removed from the "original" BitCoin client (in 0.3.22 ?).  I am using version 0.3.23-beta.  Does this mean that my client only maintains connection with some peers and downloads/validates publications?  (in addition to providing me with a "wallet" and a means of publishing transactions)

If so, then the only mining I have going on, despite having two "original" clients fired up, is the GUIminer running on my GPU with slush's pool?  (if this is the case, I highly agree that they need to update the main site that claims you're mining with that client; I thought I was until just a bit ago)

More questions are likely to come as I receive clarification.  In part, I'm trying to get a handle on how futile it is to do solo mining.

YinCoin YangCoin ☯☯First Ever POS/POW Alternator! Multipool! ☯ ☯ http://yinyangpool.com/ 
https://bitcointalk.org/index.php?topic=623937
Bwincoin - 100% Free POS. BCc7XkRRbzy7cJkg4QTrA7JzseTAHgmc2A
willphase
Hero Member
*****
Offline Offline

Activity: 767
Merit: 500


View Profile
June 16, 2011, 09:35:36 AM
 #2

After spending most of last night and today reading up on BitCoin, I still have a few questions.  Please also correct me where I state something incorrectly.  Pointing me in the direction of good further reading on the subject is just as much appreciated as an answer.

As best I understand the BitCoin mining process:

BitCoin miners work with the existing accepted block chain to create a new block hash.  The new block itself contains recent transactions (since the last validated block?), a random number, and the previous (most recently validated) block's hash.  The new block is hashed until a hash is found that meets the current difficulty standards.  The new block is then published - presumably with its hash and the key required to validate it - in hope that it will be generally validated and yield a BitCoin minting (currently 50 BTC).

Question 1:
If Alice has just created a successful hash and publishes her new block to the network just moments after Bob has published his own block and hash, would the network then (likely) reject Alice's block in favor of Bob's probably already accepted block?

Question 2:
I'm asking this about the "original" BitCoin client at bitcoin.org, although I expect that all other miners generally do the same.  As the client receives notifications of published blocks and transactions, it presumably uses them in its block hashes? (and stops using "old" information as appropriate?)

Question 3:
I see a couple posts mentioning that mining has been removed from the "original" BitCoin client (in 0.3.22 ?).  I am using version 0.3.23-beta.  Does this mean that my client only maintains connection with some peers and downloads/validates publications?  (in addition to providing me with a "wallet" and a means of publishing transactions)

If so, then the only mining I have going on, despite having two "original" clients fired up, is the GUIminer running on my GPU with slush's pool?  (if this is the case, I highly agree that they need to update the main site that claims you're mining with that client; I thought I was until just a bit ago)

More questions are likely to come as I receive clarification.  In part, I'm trying to get a handle on how futile it is to do solo mining.

1.  both blocks are considered 'equally valid' until another new block is created.  Because this new block has to use the hash from one of the previous blocks (otherwise it's invalid) at the time the new block attaches to one of the two blocks, the chain with the new block now becomes the 'best' chain and clients/miners will start attaching to this chain.

2. Yes

3. Yes - the bitcoin client now just forwards valid blocks/transactions on to other bitcoin clients as part of the p2p network, and does not attempt to generate new blocks.

HTH,

Will

kuloch (OP)
Member
**
Offline Offline

Activity: 70
Merit: 10


View Profile
June 16, 2011, 09:49:04 AM
 #3

1.  both blocks are considered 'equally valid' until another new block is created.  Because this new block has to use the hash from one of the previous blocks (otherwise it's invalid) at the time the new block attaches to one of the two blocks, the chain with the new block now becomes the 'best' chain and clients/miners will start attaching to this chain.

Ah, so they aren't validated simply upon being published, but rather by future publications using them and creating a more difficult (and longer) chain.

So what determines which of multiple branches that a given client will use for the next block?  Is this left up to each client's implementation?  Do they tend to go with the lowest timestamp (assuming that timestamps are recorded), or some other deterministic method?  Or is it stochastic, giving both blocks a "fair" chance?

YinCoin YangCoin ☯☯First Ever POS/POW Alternator! Multipool! ☯ ☯ http://yinyangpool.com/ 
https://bitcointalk.org/index.php?topic=623937
Bwincoin - 100% Free POS. BCc7XkRRbzy7cJkg4QTrA7JzseTAHgmc2A
Meni Rosenfeld
Donator
Legendary
*
Offline Offline

Activity: 2058
Merit: 1054



View Profile WWW
June 16, 2011, 07:09:11 PM
 #4

1.  both blocks are considered 'equally valid' until another new block is created.  Because this new block has to use the hash from one of the previous blocks (otherwise it's invalid) at the time the new block attaches to one of the two blocks, the chain with the new block now becomes the 'best' chain and clients/miners will start attaching to this chain.

Ah, so they aren't validated simply upon being published, but rather by future publications using them and creating a more difficult (and longer) chain.

So what determines which of multiple branches that a given client will use for the next block?  Is this left up to each client's implementation?  Do they tend to go with the lowest timestamp (assuming that timestamps are recorded), or some other deterministic method?  Or is it stochastic, giving both blocks a "fair" chance?
The branch representing the highest total difficulty (barring changes in difficulty, this is simply the one with the longest chain of blocks) is chosen to be built upon. In case of a tie, the one the client saw first is chosen.

Note that the client doesn't now try to calculate hashes, but it does provide getwork to miner software.

1EofoZNBhWQ3kxfKnvWkhtMns4AivZArhr   |   Who am I?   |   bitcoin-otc WoT
Bitcoil - Exchange bitcoins for ILS (thread)   |   Israel Bitcoin community homepage (thread)
Analysis of Bitcoin Pooled Mining Reward Systems (thread, summary)  |   PureMining - Infinite-term, deterministic mining bond
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!