<p>You'll need to hash the block header, which is actually made up of 6 items: the version bit, the hash of the previous block, the merkle root of transactions you're including in your block, a timestamp, a target difficulty, and a nonce value. <a href="https://en.bitcoin.it/wiki/Block_hashing_algorithm" rel="nofollow noreferrer">This page on the bitcoin wiki contains more info</a>, I think you'll find it helpful. </p>

CC BY-SA 3.0
2018-01-04T19:15:06.473Z
Also, it is possible to retrieve much of the data required from Bitcoin Core's 'getblocktemplate' command. See [BIP-22](https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki)
Matthew Stannard
CC BY-SA 3.0
2018-01-04T18:56:53.810Z
2018-01-04T18:56:53.810Z
chytrik
<p>I read that i have to hash 3 things(previous block's header, nonce, current block contents) using the sha 256 algorithm to get a hash that has required number of zeros at the start, in order to add my block to the blockchain.</p>

<p>where are the specifications for combining to form a block?</p>

<p>I have a sha 256 program that can perform a hash. I need to know 
1. where to get the latest block?
2. what parts of the latest block to use?
3. where to get the latest transactions?
4. what parts of the latest transactions are to be put in a block?
etc</p>

<p>there must be specifications for these. can anyone please tell me where to find it?</p>

<p>Thanks much,
ms</p>

<mining-theory>
where to get specifications about how to make a block in bitcoin mining
user72463
# where to get specifications about how to make a block in bitcoin mining

(Asked by: username_0 on 2018-01-04)

I read that i have to hash 3 things(previous block's header, nonce, current block contents) using the sha 256 algorithm to get a hash that has required number of zeros at the start, in order to add my block to the blockchain.

where are the specifications for combining to form a block?

I have a sha 256 program that can perform a hash. I need to know
1. where to get the latest block?
2. what parts of the latest block to use?
3. where to get the latest transactions?
4. what parts of the latest transactions are to be put in a block?
etc

there must be specifications for these. can anyone please tell me where to find it?

Thanks much,
ms

**Tags:** mining-theory


---

## 1 answers

### Answer by username_1 on 2018-01-04. Score: 1

You'll need to hash the block header, which is actually made up of 6 items: the version bit, the hash of the previous block, the merkle root of transactions you're including in your block, a timestamp, a target difficulty, and a nonce value. [This page on the bitcoin wiki contains more info](https://en.bitcoin.it/wiki/Block_hashing_algorithm), I think you'll find it helpful.

> **Comments:**
> **username_2**: Also, it is possible to retrieve much of the data required from Bitcoin Core's 'getblocktemplate' command. See [BIP-22](https://github.com/bitcoin/bips/blob/master/bip-0022.mediawiki)  

---

