<blockquote>
  <p>Lets say we have just put a block on a chain and there are no blocks at the moment that users mine. At that moment does a protocol create a new unique puzzle to be solved? Is the new puzzle known before that moment? Can different puzzles coexist at the same time (so that users solve different puzzles)?</p>
</blockquote>

<p>As I said in my previous answer, this is not how mining works. There is no central authority or protocol which hands out blocks to miners for them to work on. Rather each miner creates their own blocks and works on them. Each miner works on a unique block that is created independently of other miners.</p>

CC BY-SA 3.0
2017-10-21T17:17:21.737Z
Yes I understand that. I just thought that a new puzzle is created by protocol when a block is put on the chain. And then the miners try to solve that puzzle by creating their own blocks (with a value that can possibly solve the hash puzzle).
croraf
CC BY-SA 3.0
2017-10-21T17:15:41.593Z
2017-10-21T17:15:41.593Z
Ava Chow
<p>The "puzzle" metaphor may not be helpful.  The goal is always the same: create a block whose header has a sufficiently small hash value, less than the current <strong>target</strong>.</p>

<p>So every miner can create a block any way she wants, as long as it meets the general requirements of the protocol (all transactions are validly signed, block reward is no larger than the current standard value, etc), and then start varying the nonce value in hopes of finding one which makes the hash sufficiently small.  There is no single centralized authority or protocol that hands out blocks for people to work on.</p>

<p>In practice, this means that no two miners are ever working on exactly the same block.  Two different solo miners will have different blocks, because each will have a coinbase transaction that pays the reward to his own address.  Two different members of the same pool will be assigned different variants of the same block, in order to avoid duplication of work (perhaps each will put his own identifier somewhere in the block).</p>

<p>The <strong>target</strong> is, in some sense, uniquely determined by the protocol.  The Bitcoin protocol specifies how the target is to be computed, based on the timestamps of prior blocks; this is what ensures that it adjusts with the total mining power of the network to keep the block time approximately constant at 10 minutes.  It should be the case that all miners on the network are using the same target value to compare with their blocks.  </p>

<p>So in that sense, everyone is trying to solve the same "puzzle" (aiming for the same target), but everyone is trying a different approach to do so (a different candidate block).</p>

<p>The target only changes every 2016 blocks (approximately every two weeks).  So most of the time, you can know what the target will be after the next block: same as the current target.  If the next block would be a multiple of 2016, then you will need to wait until it is mined, because its timestamp will be involved in the computation of the next target.</p>

CC BY-SA 3.0
2017-10-21T17:19:59.033Z
I understand that protocol does not give block to mine, but I thought it gives the new puzzle when some block is put on the chain. That users create blocks and try to solve this puzzle. Well, can't it be said that the puzzle (to guess a valid hash) is given by the protocol?
croraf
CC BY-SA 3.0
2017-10-21T17:23:40.877Z
Are you talking about the *target*?  The "puzzle" is to create a block whose header has a hash value which is less than the target.  It's true that the protocol defines the algorithm by which the target shall be calculated, based on the times at which prior blocks were mined, and so in that sense the protocol "gives" the puzzle, but the way you're saying it is rather confusing.
Nate Eldredge
CC BY-SA 3.0
2017-10-21T17:25:20.803Z
I explained myself in the edit of comment, and we are at the same page I think.
croraf
CC BY-SA 3.0
2017-10-21T17:25:24.340Z
@croraf: I kind of wish you would stop using the word "puzzle".  It's not a standard technical term in the Bitcoin community, so people are not going to clearly understand what you mean by it, and confusion will result.  If you're reading some source that uses this term, I would suggest you look for something that uses more standard and precise language, since obviously you are looking for precise explanations.
Nate Eldredge
CC BY-SA 3.0
2017-10-21T17:29:25.343Z
Give me better term and I'll use it :). So my original question with "puzzle" changed with "target", can you answer that?
croraf
CC BY-SA 3.0
2017-10-21T17:31:09.350Z
@croraf There really is no puzzle or anything analogous. There is not anything which the protocol gives to miners to do; miners make the blocks themselves to mine it. The protocol gives miners a goal: to create a block which has a hash less than a give target. The protocol gives the target.
Ava Chow
CC BY-SA 3.0
2017-10-21T17:31:53.410Z
I consider this a "puzzle" to be solved: "to create a block which has a hash less than a give target"
croraf
CC BY-SA 3.0
2017-10-21T17:35:07.273Z
@croraf: I am not quite sure what your question would mean if you replace "puzzle" with "target", but I edited my answer to try to address it.
Nate Eldredge
CC BY-SA 3.0
2017-10-21T17:42:18.173Z
One comment on your updated answer. I don't think the target is the only thing that defines the "puzzle" but also a hashing function. (Maybe I'm saying something stupid :D). And that after each mined block a new hashing function is given miners use to achive the target?
croraf
CC BY-SA 3.0
2017-10-21T17:43:04.710Z
@croraf: True, in some sense the hash function is part of the puzzle, but it never changes.  The hash function is always SHA256D.  Also part of the "puzzle", in that sense, are the protocol's requirements for what makes a valid block, including the fact that it shall contain the hash of the previous block.
Nate Eldredge
CC BY-SA 3.0
2017-10-21T17:44:10.653Z
This is hashing family of functions I would say. But the actual functions change each block? Could this be correct? If not, solution of this block gives me the solution of every next block. Maybe I'm mixing terms - but something like that.
croraf
CC BY-SA 3.0
2017-10-21T17:45:43.293Z
I don't think that's a correct way to put it.  SHA256D is a single particular function which takes an input of arbitrary length and outputs a 256-bit hash.  We always use this function.  But the protocol does impose particular requirements for how the input ought to look, and the values do change from one block to the next (most obviously, the hash of the previous block).  As such you cannot use the same block twice in the chain.
Nate Eldredge
CC BY-SA 3.0
2017-10-21T17:47:49.860Z
Cool, thx! For more details I will check in documentation if needed.
croraf
CC BY-SA 3.0
2017-10-21T17:55:31.020Z
I just posted third part of the series of questions :).
croraf
CC BY-SA 3.0
2017-10-21T17:11:27.590Z
2017-10-21T17:34:35.920Z
2017-10-21T17:34:35.920Z
Nate Eldredge
<p>Why are transactions grouped into blocks (PART 2)?</p>

<ol start="3">
<li>Let's say we have just put a block on a chain. At that moment does a protocol create a new <strong>unique</strong> puzzle to be solved? Is the new puzzle known before that moment? Can different puzzles coexist at the same time (so that users solve different puzzles in parallel)?</li>
</ol>

<p>EDIT: Puzzle in this sense means a combination of target (that changes every 2016 blocks), a hashing function, and other protocol imposed requirements miners use to guess the solution.</p>

CC BY-SA 3.0
2017-10-21T17:40:46.177Z
As a minor rant, my personal opinion is that "informal" Bitcoin texts, although well meant, are responsible for a vast amount of confusion and misunderstanding.  Metaphors like "puzzle" invariably give a mistaken impression about something crucial.  People whose goal is to get a precise understanding should go straight to the formal technical documentation.
Nate Eldredge
CC BY-SA 3.0
2017-10-21T17:49:25.373Z
Well, for me word "puzzle" was very clear :).
croraf
<block><mining-theory>
Why are transactions grouped into blocks?(puzzle creation)
croraf
# Why are transactions grouped into blocks?(puzzle creation)

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

Why are transactions grouped into blocks (PART 2)?

3. Let's say we have just put a block on a chain. At that moment does a protocol create a new **unique** puzzle to be solved? Is the new puzzle known before that moment? Can different puzzles coexist at the same time (so that users solve different puzzles in parallel)?

EDIT: Puzzle in this sense means a combination of target (that changes every 2016 blocks), a hashing function, and other protocol imposed requirements miners use to guess the solution.

**Tags:** block, mining-theory

> **Comments:**
> **username_1**: As a minor rant, my personal opinion is that "informal" Bitcoin texts, although well meant, are responsible for a vast amount of confusion and misunderstanding.  Metaphors like "puzzle" invariably give a mistaken impression about something crucial.  People whose goal is to get a precise understanding should go straight to the formal technical documentation.  
> **username_0**: Well, for me word "puzzle" was very clear :).  

---

## 2 answers

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

The "puzzle" metaphor may not be helpful. The goal is always the same: create a block whose header has a sufficiently small hash value, less than the current **target**.

So every miner can create a block any way she wants, as long as it meets the general requirements of the protocol (all transactions are validly signed, block reward is no larger than the current standard value, etc), and then start varying the nonce value in hopes of finding one which makes the hash sufficiently small. There is no single centralized authority or protocol that hands out blocks for people to work on.

In practice, this means that no two miners are ever working on exactly the same block. Two different solo miners will have different blocks, because each will have a coinbase transaction that pays the reward to his own address. Two different members of the same pool will be assigned different variants of the same block, in order to avoid duplication of work (perhaps each will put his own identifier somewhere in the block).

The **target** is, in some sense, uniquely determined by the protocol. The Bitcoin protocol specifies how the target is to be computed, based on the timestamps of prior blocks; this is what ensures that it adjusts with the total mining power of the network to keep the block time approximately constant at 10 minutes. It should be the case that all miners on the network are using the same target value to compare with their blocks.

So in that sense, everyone is trying to solve the same "puzzle" (aiming for the same target), but everyone is trying a different approach to do so (a different candidate block).

The target only changes every 2016 blocks (approximately every two weeks). So most of the time, you can know what the target will be after the next block: same as the current target. If the next block would be a multiple of 2016, then you will need to wait until it is mined, because its timestamp will be involved in the computation of the next target.

> **Comments:**
> **username_0**: I understand that protocol does not give block to mine, but I thought it gives the new puzzle when some block is put on the chain. That users create blocks and try to solve this puzzle. Well, can't it be said that the puzzle (to guess a valid hash) is given by the protocol?  
> **username_1**: Are you talking about the *target*?  The "puzzle" is to create a block whose header has a hash value which is less than the target.  It's true that the protocol defines the algorithm by which the target shall be calculated, based on the times at which prior blocks were mined, and so in that sense the protocol "gives" the puzzle, but the way you're saying it is rather confusing.  
> **username_0**: I explained myself in the edit of comment, and we are at the same page I think.  
> **username_1**: @username_0: I kind of wish you would stop using the word "puzzle".  It's not a standard technical term in the Bitcoin community, so people are not going to clearly understand what you mean by it, and confusion will result.  If you're reading some source that uses this term, I would suggest you look for something that uses more standard and precise language, since obviously you are looking for precise explanations.  
> **username_0**: Give me better term and I'll use it :). So my original question with "puzzle" changed with "target", can you answer that?  
> **username_2**: @username_0 There really is no puzzle or anything analogous. There is not anything which the protocol gives to miners to do; miners make the blocks themselves to mine it. The protocol gives miners a goal: to create a block which has a hash less than a give target. The protocol gives the target.  
> **username_0**: I consider this a "puzzle" to be solved: "to create a block which has a hash less than a give target"  
> **username_1**: @username_0: I am not quite sure what your question would mean if you replace "puzzle" with "target", but I edited my answer to try to address it.  
> **username_0**: One comment on your updated answer. I don't think the target is the only thing that defines the "puzzle" but also a hashing function. (Maybe I'm saying something stupid :D). And that after each mined block a new hashing function is given miners use to achive the target?  
> **username_1**: @username_0: True, in some sense the hash function is part of the puzzle, but it never changes.  The hash function is always SHA256D.  Also part of the "puzzle", in that sense, are the protocol's requirements for what makes a valid block, including the fact that it shall contain the hash of the previous block.  
> **username_0**: This is hashing family of functions I would say. But the actual functions change each block? Could this be correct? If not, solution of this block gives me the solution of every next block. Maybe I'm mixing terms - but something like that.  
> **username_1**: I don't think that's a correct way to put it.  SHA256D is a single particular function which takes an input of arbitrary length and outputs a 256-bit hash.  We always use this function.  But the protocol does impose particular requirements for how the input ought to look, and the values do change from one block to the next (most obviously, the hash of the previous block).  As such you cannot use the same block twice in the chain.  
> **username_0**: Cool, thx! For more details I will check in documentation if needed.  
> **username_0**: I just posted third part of the series of questions :).  

---

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

> Lets say we have just put a block on a chain and there are no blocks at the moment that users mine. At that moment does a protocol create a new unique puzzle to be solved? Is the new puzzle known before that moment? Can different puzzles coexist at the same time (so that users solve different puzzles)?

As I said in my previous answer, this is not how mining works. There is no central authority or protocol which hands out blocks to miners for them to work on. Rather each miner creates their own blocks and works on them. Each miner works on a unique block that is created independently of other miners.

> **Comments:**
> **username_0**: Yes I understand that. I just thought that a new puzzle is created by protocol when a block is put on the chain. And then the miners try to solve that puzzle by creating their own blocks (with a value that can possibly solve the hash puzzle).  

---

