<p>There are a lot of questions on the Bitcoin SE about blocks, but remarkably I couldn't find any that explicitly lay out what a block is.</p>

<p>A blocks has two things: A block header and a list of transactions. </p>

<blockquote>
  <p>Block:</p>
  
  <ul>
  <li>Block Header
  
  <ul>
  <li>Version Number (4 byte integer)</li>
  <li>Previous Block Id (32 byte hash)</li>
  <li>Merkle Root (32 byte hash)</li>
  <li>Time (4 byte integer)</li>
  <li>Difficulty (4 byte integer)</li>
  <li>Nonce (4 byte integer)</li>
  </ul></li>
  <li>List of Transactions
  
  <ul>
  <li>Number of transactions in List</li>
  <li>Tx1</li>
  <li>Tx2</li>
  <li>...</li>
  <li>TxN</li>
  </ul></li>
  </ul>
</blockquote>

<p>In the block header part of the block:</p>

<ol>
<li>The version number is a parameter to help in updating how blocks are treated by the network. </li>
<li>The reference to the hash of the previous block is what makes the group of blocks a "block chain". </li>
<li>The merkle root is hash that can be used to prove that a transaction is in the block without providing all of the details of the block (this is a bit complicated, see <a href="https://bitcoin.stackexchange.com/questions/10479/what-is-the-merkle-root">this</a> for more info). </li>
<li>The time field is to show the network what time the block was solved at, and to help in calculating the difficulty parameter.</li>
<li>The difficulty (or <code>nBits</code> as it is called in the code) is shorthand for how difficult it is to solve the block. Essentially, it encodes a target value, and the hash of the block (when treated as a 256 bit integer) must be below that target value to be considered solved.</li>
<li>The nonce (number used once) is just an integer that miners can change repeatedly to hash the header and get a different result each time, hoping to get a hash that is below the difficulty value encoded by the previous parameter. </li>
</ol>

<p>The list of transactions is fairly straightforward, it's just the number of transactions and then the transactions themselves concatenated together.</p>

<p>Take for example the genesis block. The raw bytes are:</p>

<blockquote>
  <p>0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000</p>
</blockquote>

<p>When we break this up, we can see what is in it:</p>

<pre>
01000000                                                          // Version
0000000000000000000000000000000000000000000000000000000000000000  // Hash Previous Block
3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a  // Merkle Root
29ab5f49                                                          // Time
ffff001d                                                          // Difficulty
1dac2b7c                                                          // Nonce
01                                                                // Number of Transactions
 Tx1:
 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000
</pre>

<p>When you hash the block header of the genesis block, you get:</p>

<pre><code>000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
</code></pre>

<p>See how it starts with all these zeroes? That's because many many tries were taken (changing the nonce each time) until the miner was lucky enough to find a nonce that makes the block header hash to a low enough value (look at the hash as a hex encoded integer, with the most significant bits on the left, and the least significant on the right).</p>

CC BY-SA 3.0
2015-01-23T21:09:27.207Z
2015-01-23T21:09:27.207Z
2017-04-13T12:47:33.583Z
morsecoder
<p>I know bitcoin has a block chain that is from my best representation a list of blocks. I know the block holds many transactions. But i'm still very much lost as to what a block is and how a block can be the function of the transactions at the time prior to the block being solved and how a block can have any number of transactions prior to it being solved and locked in. </p>

<p>I'm also lost on the process of "solving" a block. I know it requires computers encrypting the transaction. If a block is multiple transaction would that imply that you have to solve all the transactions to get the block.  </p>

CC BY-SA 3.0
2015-01-23T20:06:43.903Z
possible duplicate of http://bitcoin.stackexchange.com/questions/7330/whats-the-process-of-creating-a-block-on-the-blockchain?rq=1
Nick ODell
CC BY-SA 3.0
2015-01-23T22:51:00.777Z
@NickODell, similar, but I think this one is more about the structure of a block, and the other how to build it given the state of the block chain.
morsecoder
<transactions><blockchain><block><terminology>
What is a block?
Patrick W. McMahon
# What is a block?

(Asked by: username_0 on 2015-01-23)

I know bitcoin has a block chain that is from my best representation a list of blocks. I know the block holds many transactions. But i'm still very much lost as to what a block is and how a block can be the function of the transactions at the time prior to the block being solved and how a block can have any number of transactions prior to it being solved and locked in.

I'm also lost on the process of "solving" a block. I know it requires computers encrypting the transaction. If a block is multiple transaction would that imply that you have to solve all the transactions to get the block.

**Tags:** transactions, blockchain, block, terminology

> **Comments:**
> **username_1**: possible duplicate of http://bitcoin.stackexchange.com/questions/7330/whats-the-process-of-creating-a-block-on-the-blockchain?rq=1  
> **username_2**: @username_1, similar, but I think this one is more about the structure of a block, and the other how to build it given the state of the block chain.  

---

## 1 answers

### Answer by username_2 on 2015-01-23. Score: 7 | Accepted answer

There are a lot of questions on the Bitcoin SE about blocks, but remarkably I couldn't find any that explicitly lay out what a block is.

A blocks has two things: A block header and a list of transactions.

> Block:
>
> * Block Header
>   + Version Number (4 byte integer)
>   + Previous Block Id (32 byte hash)
>   + Merkle Root (32 byte hash)
>   + Time (4 byte integer)
>   + Difficulty (4 byte integer)
>   + Nonce (4 byte integer)
> * List of Transactions
>   + Number of transactions in List
>   + Tx1
>   + Tx2
>   + ...
>   + TxN

In the block header part of the block:

1. The version number is a parameter to help in updating how blocks are treated by the network.
2. The reference to the hash of the previous block is what makes the group of blocks a "block chain".
3. The merkle root is hash that can be used to prove that a transaction is in the block without providing all of the details of the block (this is a bit complicated, see [this](https://bitcoin.stackexchange.com/questions/10479/what-is-the-merkle-root) for more info).
4. The time field is to show the network what time the block was solved at, and to help in calculating the difficulty parameter.
5. The difficulty (or `nBits` as it is called in the code) is shorthand for how difficult it is to solve the block. Essentially, it encodes a target value, and the hash of the block (when treated as a 256 bit integer) must be below that target value to be considered solved.
6. The nonce (number used once) is just an integer that miners can change repeatedly to hash the header and get a different result each time, hoping to get a hash that is below the difficulty value encoded by the previous parameter.

The list of transactions is fairly straightforward, it's just the number of transactions and then the transactions themselves concatenated together.

Take for example the genesis block. The raw bytes are:

> 0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000

When we break this up, we can see what is in it:

```

01000000                                                          // Version
0000000000000000000000000000000000000000000000000000000000000000  // Hash Previous Block
3ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a  // Merkle Root
29ab5f49                                                          // Time
ffff001d                                                          // Difficulty
1dac2b7c                                                          // Nonce
01                                                                // Number of Transactions
 Tx1:
 01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000

```

When you hash the block header of the genesis block, you get:

```
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f

```

See how it starts with all these zeroes? That's because many many tries were taken (changing the nonce each time) until the miner was lucky enough to find a nonce that makes the block header hash to a low enough value (look at the hash as a hex encoded integer, with the most significant bits on the left, and the least significant on the right).


---

