<p>BIP 34 (the BIP that specifies block version 2 and block heights in coinbases) is not activated on regtest and is never activated.</p>

<blockquote>
  <p>How do block versions work in regtest mode?</p>
</blockquote>

<p>Block versions are actually version <code>0x20000000</code>, not version 1. This version allows for other soft forks like BIPs 65 and 66 be activated. Some other forks (BIP16, CSV, and Segwit) are activated by default, and BIP 34 is disabled.</p>

<blockquote>
  <p>Can I configure them?</p>
</blockquote>

<p>Yes, use the <code>-blockversion</code> command line option when starting <code>bitcoind</code></p>

<blockquote>
  <p>Do I need to mine a specific number of blocks?</p>
</blockquote>

<p>For BIP 34, no, you can't activate it without changing the software.</p>

CC BY-SA 3.0
2018-02-21T01:34:58.223Z
2018-02-21T01:34:58.223Z
Ava Chow
<p>I'm running a <code>bitcoind</code> instance in <code>regtest</code> mode, for automated testing purposes.</p>

<p>I'm having trouble with the fact that the blocks I mine are <code>version 1</code> blocks, which lack the block height in the coinbase transaction (my code relied on that).</p>

<p>How do block versions work in regtest mode? Can I configure them? Do I need to mine a specific number of blocks?</p>

<bitcoind><regtest>
Bitcoin regtest mode block versions
salezica
# Bitcoin regtest mode block versions

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

I'm running a `bitcoind` instance in `regtest` mode, for automated testing purposes.

I'm having trouble with the fact that the blocks I mine are `version 1` blocks, which lack the block height in the coinbase transaction (my code relied on that).

How do block versions work in regtest mode? Can I configure them? Do I need to mine a specific number of blocks?

**Tags:** bitcoind, regtest


---

## 1 answers

### Answer by username_1 on 2018-02-21. Score: 3 | Accepted answer

BIP 34 (the BIP that specifies block version 2 and block heights in coinbases) is not activated on regtest and is never activated.

> How do block versions work in regtest mode?

Block versions are actually version `0x20000000`, not version 1. This version allows for other soft forks like BIPs 65 and 66 be activated. Some other forks (BIP16, CSV, and Segwit) are activated by default, and BIP 34 is disabled.

> Can I configure them?

Yes, use the `-blockversion` command line option when starting `bitcoind`

> Do I need to mine a specific number of blocks?

For BIP 34, no, you can't activate it without changing the software.


---

