<p>The double-SHA256 <em>is</em> the mining algorithm. Miners merely decide which transactions they wish to include in a block, and they an adjust the random <code>nonce</code> field in the block header. Additionally, they create the coinbase transaction (the first transaction in the block), which pays them out for the block reward. There is some additional information they can include in the coinbase transaction which makes no difference to the result, but merely allows them to attach some metadata (such as the name of their mining pool, to indicate they mined it).</p>

<p>The choice of transactions to include can be arbitrary, but the obvious approach is to include them prioritized by highest paying fee, because this maximizes the revenue the miner takes if they are successful.</p>

<p>Everything else is simply <em>random</em> numbers in order to try and find a hash which is below the target. The miners can choose how they generate those random numbers, or how they might partition the range of numbers to attempt between members of a mining pool to prevent duplication of work among the members of the pool.</p>

CC BY-SA 4.0
2019-02-17T22:26:10.293Z
2019-02-17T22:26:10.293Z
Mark H
<p>From <a href="https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc" rel="nofollow noreferrer">this</a>:</p>

<blockquote>
  <p>the arrival of a new block has special significance for a mining node. The competition among miners effectively ends with the propagation of a new block that acts as an announcement of a winner. To miners, receiving a valid new block means someone else won the competition and they lost. However, the end of one round of a competition is also the beginning of the next round. The new block is not just a checkered flag, marking the end of the race; it is also the starting pistol in the race for the next block.</p>
</blockquote>

<p>So I just wanted to clarify because I don't think I've seen it written down anywhere, that it's in a miners best interest to create their own algorithms to solve the computational challenges involved in mining. It's not as if every miner gets a standard algorithm and runs that. Please correct me if I'm wrong.</p>

<blockchain><mining-theory>
If miners are creating their own mining algorithms or using something standard
Lance Pollard
# If miners are creating their own mining algorithms or using something standard

(Asked by: username_0 on 2019-02-17)

From [this](https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch10.asciidoc):

> the arrival of a new block has special significance for a mining node. The competition among miners effectively ends with the propagation of a new block that acts as an announcement of a winner. To miners, receiving a valid new block means someone else won the competition and they lost. However, the end of one round of a competition is also the beginning of the next round. The new block is not just a checkered flag, marking the end of the race; it is also the starting pistol in the race for the next block.

So I just wanted to clarify because I don't think I've seen it written down anywhere, that it's in a miners best interest to create their own algorithms to solve the computational challenges involved in mining. It's not as if every miner gets a standard algorithm and runs that. Please correct me if I'm wrong.

**Tags:** blockchain, mining-theory


---

## 1 answers

### Answer by username_1 on 2019-02-17. Score: 3 | Accepted answer

The double-SHA256 *is* the mining algorithm. Miners merely decide which transactions they wish to include in a block, and they an adjust the random `nonce` field in the block header. Additionally, they create the coinbase transaction (the first transaction in the block), which pays them out for the block reward. There is some additional information they can include in the coinbase transaction which makes no difference to the result, but merely allows them to attach some metadata (such as the name of their mining pool, to indicate they mined it).

The choice of transactions to include can be arbitrary, but the obvious approach is to include them prioritized by highest paying fee, because this maximizes the revenue the miner takes if they are successful.

Everything else is simply *random* numbers in order to try and find a hash which is below the target. The miners can choose how they generate those random numbers, or how they might partition the range of numbers to attempt between members of a mining pool to prevent duplication of work among the members of the pool.


---

