5

I'm a bit new to the bitcoin system, so I apologize if this is a "noob" question.

A user attempts to take all the unverified transactions it knows about and aggregate them in a chain block. The same applies to all the users world wide - they all attempt to aggregate all the unverified transactions into a block chain with a 1 success every 10 minutes on a global scale rate

But - I imagine that when all the devices are trying to do this, all the devices have a slightly different list of unverified transactions, since it takes a while for a transaction to propagate to all the devices world-wide

So let's say device A and device B both create a block at the same time, when some transactions in A don't appear in B and vise-versa. Then, more block chains are created and after some time the shorter one is discarded - all the transactions which appeared as verified in the shorter block chain now become unverified again?

If this is the case, what happens to the transaction fees & the 25 bitcoin award given to the guy who created the "bad" block?

I mean, fine - the 25 bitcoin award could theoretically stay with the guy who created the block, since he did do the work, but the transaction fee? It would need to be paid to the next guy who verifies the transaction, shouldn't it?

Or in this case, would the user need to pay 2 transaction fees?

3

The blocks on the chain that loses are essentially forgotten. (It's better to call them losing blocks, than "bad" blocks, because they were legal and offered in good faith. They just lost a network race.)

Thus on the winning chain, there's no record of the losing-block reward, or the transaction fees. If there's no record of it in the common history, you don't have it. It's as if the reward and fees on the losing branch never happened.

Many transactions likely already existed in both blocks. (Most redundant blocks happen by accident, and can already contain most of the same transactions.) Despite these transactions, with their fees, appearing in two places for a time window of uncertainty, since only one set of consistent blocks will eventually win, those fees are only meaningfully spent, and then re-spendable, in the winning chain.

Any transactions missing from the winning chain are still eligible for inclusion, as long as they're still consistent with the cemented-history. Anyone building on the winning chain, who still knows about the unverified transactions, might add them on a subsequent block. Anyone interested in ensuring they're still widely-known may continue to broadcast them to peers.

  • But don't the fees & reward in-fact generate a new transaction which is then propagated into the system for new verification? How does the system know to discard them if the block in the "loosing" chain is discarded? – Gil Moshayof Feb 14 '14 at 6:42
  • 1
    No fees & rewards don't generate new transactions by themselves. Rewards are only spendable after a block has been buried 100 (i think) blocks deep. So there can't be any transactions touching the reward yet. Any other transactions can still go through on the next block as long as there is no conflict (double spend). – Jannes Feb 14 '14 at 10:16
  • Another way to think about it is: blocks are atomic, and include in them the block-reward, and sweep of transaction-fees, to the miner. The only thing that happens later is the decision to build on it, or not. If it (and its successors) are built on, it wins. If it wins, all those transactions/fees/rewards are spendable by their new owners, without any other steps necessary. They just refer-back to that block to use the funds. And if it loses, there's nothing extra to undo. Just leaving it out of the winning chain already means it, and all its contents, are irrelevant. – Quizzical Feb 15 '14 at 0:07
1

Only blocks that are part of the longest chain are considered valid. Each longest chain considers competing longest chains to be invalid until proven otherwise.

Example:

Block A was last.

Block B1 and B2 are discovered at almost the same moment in the network and broadcasted such that each is received by about half the network first. Let's assume

  • B1 verifies transactions T1 and T2.
  • B2 verifies transactions T2 and T3.

Now each half of the network tries to find the next block respectively building from B1 or B2.

  • Building on B1: Trying to find C1 referring to B1 as previous block. In its ancestral chain T3 is not verified and the miners will include it in C1.
  • Building on B2: Trying to find C2 referring to B2 as previous block. In its ancestral chain T1 is not verified and the miners will include it in C2.

For arguments sake, C1 is found first. B2 is not part of the longest chain anymore, and thus any miner that receives notice of C1 will cease to try finding C2, and instead try to find D1 based on C1. The reward of B2 is not valid in the longest chain, any transactions that were only confirmed in B2 will still be unconfirmed pool in the chain of C1.

The transaction fee ends up going to whatever miner found the block which confirms the transaction in the longest chain. Since each transaction can only be verified once this is unambiguous. Block rewards are unspendable until they are mature, i.e. there are 100 blocks deriving from it. At that point it is practically certain that there won't be a competing longer blockchain at any point in the future.

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.