6

While understanding the concept of block chain and proof of work, few things are confusing me. Miners always consider the longest chain(by difficulty) and work on expanding it. Now, lets say two miners (Miner A and Miner B) come up with the solution at the same time (almost same time) for a block, and they publicly announces their solution. Then, some miners get first the solution of A , later they see B has the solution as well (just opposite happens to some other miners, they get B first). So, the miners who saw A first starts working over A's solution for next block and saves other branch of B if it becomes longer. Now , tie will be broken when next proof of work found, and miners were working on other branch will switch to the longer one. Now, I have few questions:

  1. What will happen to transaction records which were stored in the rejected branch?

  2. Will there be any transaction records at all for both block branches? (then I suppose, new transaction records will be stored on last block before the branch).

  3. What will be the scenario of coinbase generation? if A wins, A gets the coinbase, later transactions should be stored in A's generated block. But, already solution of next block(Proof of Work) on the branch A is found. So, new transactions will be stored on next block (lets say generated by C..C gets the next coinbase). Is that means, there will be only one transaction record (coinbase) in the block generated by A?

4

This process, generally know as forking, creates two parallel chains that are incompatible, that is, there will be some transactions that will be valid against one chain but are not valid against the other.

  1. If there are parallel branches, a miner might keep track of both of them. Once a chain is rejected, transactions in that chain are checked against the accepted one. Incompatible or duplicate transactions are simply discarded, while the remaining can be held over to go in the next block (or blocks as there might be too many transactions for just one).

  2. Transaction records will remain in-tact for the accepted chain, but records for the rejected chain will be merged in to the old branch as described above. It would be impossible to attach these transactions to the final block before the branch, so, they are kept around by miners and put into the block chain as normal.

  3. There might be a bit of confusion here... once a block is mined, it can't be changed, so it's impossible to store further transactions in that block. Furthermore, this block will have exactly one coin-base transaction. Any transactions that happen after it is mined will each be stored in subsequent blocks that follow it, but each of these blocks will have exactly one coin-base transaction, as is specified by the bitcoin protocol. So yes, there will only be one coinbase transaction in the block generated by A.

  • There was an edit that added that coinbase transactions can't be spent until after 100 confirmations. I don't believe this to be true, nor can I find any evidence. Also, this information seemed extraneous to the actual answer. Thanks for the spelling correction on "mined"; however. – John Henry May 11 '15 at 0:23
  • Coinbase transactions indeed produce "immature coins" which can only be spent after 100 confirmations. You can read about it here: What was the goal of creating the feature of immature coins? – Murch Apr 9 '16 at 8:05
1

What will happen to transaction records which were stored in the rejected branch?

It depends. Other nodes will look at the rejected branch and try to include the transactions in future blocks, according to these rules:

  1. Duplicate transactions are discarded.
  2. Transactions that conflict (i.e. because of a double-spend attack) are discarded.
  3. The coinbase is never kept.
  4. The transactions must meet normal fee requirements.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.