<p>Basically, you are solving a puzzle. A puzzle is to come with a nounce(number) which when added with the block header and hashed, hash should start with some number of zeros.</p>

<p>Higher the number of zeros, difficult it is to come with the nouce for the given block header. According to the current hash power in the network, network adjusts the difficulty.</p>

<p>Implementation would look something like this:<br><br>
1) Generate block header for the given set of transactions <br>
2) Get the current network difficulty level ( number of zeros hash should start with )<br>
3) Plug in random numbers so that : hash( nounce + blockheader ) starts with given number of zeros<br>
4) Form a block and include nounce in the blockheader ( So that other node can verify your work )</p>

CC BY-SA 3.0
2018-02-26T19:12:19.873Z
2018-02-26T19:12:19.873Z
Preet
<p>I kept on learning how miner hash | decrypt | calculate all those infos that was given to them by the pool but I can't find how they do it, maybe there's a function something like:</p>

<pre><code>int hashThis( param1, param2, param3 )
{
  ..
  .. 
  return somthingCanBeUsedToInformThePoolOfSucces
}

int Submit()
{
  param = hashThis(param1, param2, param3 )
  submitTothePool(param)
}
</code></pre>

<p>That is how know mining is, but I don't know how to implement the function <code>hashThis()</code>, that's why I asked maybe you have a goal to reach, and return it when you reached it </p>

<mining-theory>
What is my goal | Objectives when mining?
user77602
# What is my goal | Objectives when mining?

(Asked by: username_0 on 2018-02-23)

I kept on learning how miner hash | decrypt | calculate all those infos that was given to them by the pool but I can't find how they do it, maybe there's a function something like:

```
int hashThis( param1, param2, param3 )
{
  ..
  .. 
  return somthingCanBeUsedToInformThePoolOfSucces
}

int Submit()
{
  param = hashThis(param1, param2, param3 )
  submitTothePool(param)
}

```

That is how know mining is, but I don't know how to implement the function `hashThis()`, that's why I asked maybe you have a goal to reach, and return it when you reached it

**Tags:** mining-theory


---

## 1 answers

### Answer by username_1 on 2018-02-26. Score: 0

Basically, you are solving a puzzle. A puzzle is to come with a nounce(number) which when added with the block header and hashed, hash should start with some number of zeros.

Higher the number of zeros, difficult it is to come with the nouce for the given block header. According to the current hash power in the network, network adjusts the difficulty.

Implementation would look something like this:  
  
1) Generate block header for the given set of transactions   
2) Get the current network difficulty level ( number of zeros hash should start with )  
3) Plug in random numbers so that : hash( nounce + blockheader ) starts with given number of zeros  
4) Form a block and include nounce in the blockheader ( So that other node can verify your work )


---

