<p>All miners are gathering transactions that they have heard about on the peer-to-peer gossip network.  This means that when someone broadcasts a transaction it gets propagated to all of the nodes it is connected to which then in turn share it with the nodes they are connected to etc etc...  These transactions are gathered by miners and stored in the mempool.  These are transactions that have not yet been included in a block or "confirmed".  The miner can choose which transactions it would like to include in the block, most miners gather as many TX's as they can to collect a larger reward, some do not some miners can build blocks with little or even no transactions included in it.  It is in the miners best interest to include as many tx's as possible to attain the fees generated by those tx's.  Miners take the aggregated transactions and the hash of the previous block and then generate a random nonce.  These items are all hashed together and if the hash of the block has an appropriate number of leading 0's to pass the current difficulty formula then a valid block has been found.  The miner then propagates the block the same way the transactions are distributed across the gossip network.  When the block is mined a coinbase transaction is created which the miner includes his address in, this address gets the block reward and fees for distribution (usually to a pool of miners).  The network continually adjusts the difficulty formula based on the hashing power of the network to ensure that one block is created about every 10 minutes.  There are some formulas in place to ensure the difficulty doesn't move too fast in the event of a large number of miners going offline at the same time.  Hope this answers your questions.    </p>

CC BY-SA 3.0
2017-03-23T20:15:06.267Z
2017-03-23T20:15:06.267Z
Mark S.
<p>Bitcoin newbie here: I'm trying to understand the concept of the blockchain but what I don't get is what's going on behind the scenes? </p>

<p>So let's say that there are only 10 miners in the universe and Alice sends 15 BTC to Bob, what happens now?</p>

<p>I understand that a verification needs to happen (to ensure that Alice has 15 BTC to transfer) </p>

<ol>
<li>Assume miner_1 gets this 'request' and verifies the request as valid. Does he build a block? </li>
<li>How a block is created? Is it created for every request? </li>
<li>How all nodes on the network are being updated that there
s a request/new block? </li>
<li>When SHA256(SHA256(transaction?) occurs? On verification or when adding a block? Is there a good example that shows how this works? </li>
<li>How the miner who managed to find the hash get's a reward? </li>
</ol>

CC BY-SA 3.0
2017-05-27T02:11:31.260Z
possible duplicate of https://bitcoin.stackexchange.com/q/12427/5406
Murch
<blockchain><mining-theory><mining-reward><verification>
Understanding blockchain 'under the hood' how a block is created
adhg
# Understanding blockchain 'under the hood' how a block is created

(Asked by: username_0 on 2017-03-23)

Bitcoin newbie here: I'm trying to understand the concept of the blockchain but what I don't get is what's going on behind the scenes?

So let's say that there are only 10 miners in the universe and Alice sends 15 BTC to Bob, what happens now?

I understand that a verification needs to happen (to ensure that Alice has 15 BTC to transfer)

1. Assume miner\_1 gets this 'request' and verifies the request as valid. Does he build a block?
2. How a block is created? Is it created for every request?
3. How all nodes on the network are being updated that there
   s a request/new block?
4. When SHA256(SHA256(transaction?) occurs? On verification or when adding a block? Is there a good example that shows how this works?
5. How the miner who managed to find the hash get's a reward?

**Tags:** blockchain, mining-theory, mining-reward, verification

> **Comments:**
> **username_1**: possible duplicate of https://bitcoin.stackexchange.com/q/12427/5406  

---

## 1 answers

### Answer by username_2 on 2017-03-23. Score: 1

All miners are gathering transactions that they have heard about on the peer-to-peer gossip network. This means that when someone broadcasts a transaction it gets propagated to all of the nodes it is connected to which then in turn share it with the nodes they are connected to etc etc... These transactions are gathered by miners and stored in the mempool. These are transactions that have not yet been included in a block or "confirmed". The miner can choose which transactions it would like to include in the block, most miners gather as many TX's as they can to collect a larger reward, some do not some miners can build blocks with little or even no transactions included in it. It is in the miners best interest to include as many tx's as possible to attain the fees generated by those tx's. Miners take the aggregated transactions and the hash of the previous block and then generate a random nonce. These items are all hashed together and if the hash of the block has an appropriate number of leading 0's to pass the current difficulty formula then a valid block has been found. The miner then propagates the block the same way the transactions are distributed across the gossip network. When the block is mined a coinbase transaction is created which the miner includes his address in, this address gets the block reward and fees for distribution (usually to a pool of miners). The network continually adjusts the difficulty formula based on the hashing power of the network to ensure that one block is created about every 10 minutes. There are some formulas in place to ensure the difficulty doesn't move too fast in the event of a large number of miners going offline at the same time. Hope this answers your questions.


---

