<p>The truth is that "the point of getting coins" is before the "point of solving block" :)</p>

<p>The miner first creates the coinbase transaction with the reward to himself and tries to solve block after.</p>

CC BY-SA 3.0
2017-10-21T20:48:44.850Z
Hahahahahaha. Cool answer. And my edit above is also correct?
croraf
CC BY-SA 3.0
2017-10-21T20:30:11.063Z
2017-10-21T20:30:11.063Z
amaclin
<p>The block subsidy isn't awarded by anyone. It is <strong>taken</strong> by the miner, by virtue of creating a block that gives himself money.</p>

<p>The system's role in this is restricted to <em>permitting</em> blocks to indeed contain such an (otherwise unbalanced) payment.</p>

<p>If you have a fork with two branches, then within each branch there will be a payment to some miner. Which one is eventually treated as valuable by the world depends on which of the two gets built on. As far as the system is concerned, there are two possible versions of history, and both are valid. In one of them A gets paid, in the other one B gets paid. At some point, one of the two chains gets longer, and everyone switches to accepting that one.</p>

<p>In order to avoid random forks for flipflopping people's balancea (if they got paid by a block subsidy), bitcoin transaction outputs from coinbase (the type of transaction that credits the subsidy and fees to the mimer), they <em>must</em> be buried by 100 additional blocks before being spent. That is a special rule, called the maturity rule, which only applies to coinbase transactions.</p>

CC BY-SA 3.0
2017-10-21T21:09:13.820Z
2017-10-21T21:09:13.820Z
Pieter Wuille
<p>When miner creates a valid block he broadcasts that to the network. </p>

<p>It can happen that someone else did the same. So we have half nodes think that chain+A is correct, and other half that it is chain+B. This gets resolved when next block is solved.</p>

<ol>
<li><p>When are the coins given to the miner, or are they given to both miners?</p></li>
<li><p>How do the coins get sent to the miner?</p></li>
<li><p>Does the solved block contain the identity (public address) of the solver so the protocol can send him money?
<a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/Block_hashing_algorithm</a> - can't find that address here</p></li>
</ol>

<p>EDIT: Now it seems to me that both are rewarded, each inside his respective fork. Something like the <em>reward transaction</em> is put inside that chain-head. When one fork wins the respective reward stays as valid and the other fork is dropped by community. Am I correct?</p>

<blockchain><bitcoin-core><block><protocol><algorithms>
At which point and how does the miner who successfully solved hash get coins?
croraf
# At which point and how does the miner who successfully solved hash get coins?

(Asked by: username_0 on 2017-10-21)

When miner creates a valid block he broadcasts that to the network.

It can happen that someone else did the same. So we have half nodes think that chain+A is correct, and other half that it is chain+B. This gets resolved when next block is solved.

1. When are the coins given to the miner, or are they given to both miners?
2. How do the coins get sent to the miner?
3. Does the solved block contain the identity (public address) of the solver so the protocol can send him money?
   <https://en.bitcoin.it/wiki/Block_hashing_algorithm> - can't find that address here

EDIT: Now it seems to me that both are rewarded, each inside his respective fork. Something like the *reward transaction* is put inside that chain-head. When one fork wins the respective reward stays as valid and the other fork is dropped by community. Am I correct?

**Tags:** blockchain, bitcoin-core, block, protocol, algorithms


---

## 2 answers

### Answer by username_1 on 2017-10-21. Score: 1 | Accepted answer

The truth is that "the point of getting coins" is before the "point of solving block" :)

The miner first creates the coinbase transaction with the reward to himself and tries to solve block after.

> **Comments:**
> **username_0**: Hahahahahaha. Cool answer. And my edit above is also correct?  

---

### Answer by username_2 on 2017-10-21. Score: 6

The block subsidy isn't awarded by anyone. It is **taken** by the miner, by virtue of creating a block that gives himself money.

The system's role in this is restricted to *permitting* blocks to indeed contain such an (otherwise unbalanced) payment.

If you have a fork with two branches, then within each branch there will be a payment to some miner. Which one is eventually treated as valuable by the world depends on which of the two gets built on. As far as the system is concerned, there are two possible versions of history, and both are valid. In one of them A gets paid, in the other one B gets paid. At some point, one of the two chains gets longer, and everyone switches to accepting that one.

In order to avoid random forks for flipflopping people's balancea (if they got paid by a block subsidy), bitcoin transaction outputs from coinbase (the type of transaction that credits the subsidy and fees to the mimer), they *must* be buried by 100 additional blocks before being spent. That is a special rule, called the maturity rule, which only applies to coinbase transactions.


---

