<p>the problem is an incorrect implementation of BIP-0034 in my code, I thought the length of height should be at least 3 bytes which I was wrong,</p>
<p>&quot;Coding Enthusiast&quot; says :
&quot;The block height has to be pushed with the minimal number of bytes:
Since BIP-34 activates at block 500 on RegTest, this is ignored on all blocks from height 1 to 499 and from block height 500 it starts being enforced and the invalid push is rejected.&quot;</p>
<p>the description of the answer is here: bitcointalk.org/index.php?topic=5293244.0</p>

CC BY-SA 4.0
2021-02-24T11:37:39.643Z
2021-02-24T11:47:37.190Z
2021-02-24T11:47:37.190Z
Ali Harsini
<p>Mining in RegTest mode goes well until it's reach block height=500, then server return (bad-cb-height) any idea what is wrong with this coninbase:<br/>
02000000<br/>
01<br/>
0000000000000000000000000000000000000000000000000000000000000000<br/>
ffffffff<br/>
2a<br/>
03f40100
2508000000313130311a00000052797a656e2e33363030582e69732e617765736f6d652e2e2e<br/>
00000000<br/>
01<br/>
40be402500000000<br/>
16<br/>
001420f897e733695493cc731b0b4b80352fb9a826f<br/>
000000000<br/></p>

CC BY-SA 4.0
2021-01-27T18:59:20.107Z
https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki
Claris
CC BY-SA 4.0
2021-02-24T06:47:33.933Z
Adding an answer to your own question is encouraged!
Claris
CC BY-SA 4.0
2021-02-24T11:01:37.827Z
the answer is here: https://bitcointalk.org/index.php?topic=5293244.0
Ali Harsini
<transactions><coinbase-transaction><height>
Bitcoin in RegTest throw (bad-cb-height) at block No. 500
Ali Harsini
# Bitcoin in RegTest throw (bad-cb-height) at block No. 500

(Asked by: username_0 on 2021-01-27)

Mining in RegTest mode goes well until it's reach block height=500, then server return (bad-cb-height) any idea what is wrong with this coninbase:  
02000000  
01  
0000000000000000000000000000000000000000000000000000000000000000  
ffffffff  
2a  
03f40100
2508000000313130311a00000052797a656e2e33363030582e69732e617765736f6d652e2e2e  
00000000  
01  
40be402500000000  
16  
001420f897e733695493cc731b0b4b80352fb9a826f  
000000000

**Tags:** transactions, coinbase-transaction, height

> **Comments:**
> **username_1**: https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki  
> **username_1**: Adding an answer to your own question is encouraged!  
> **username_0**: the answer is here: https://bitcointalk.org/index.php?topic=5293244.0  

---

## 1 answers

### Answer by username_0 on 2021-02-24. Score: 1 | Accepted answer

the problem is an incorrect implementation of BIP-0034 in my code, I thought the length of height should be at least 3 bytes which I was wrong,

"Coding Enthusiast" says :
"The block height has to be pushed with the minimal number of bytes:
Since BIP-34 activates at block 500 on RegTest, this is ignored on all blocks from height 1 to 499 and from block height 500 it starts being enforced and the invalid push is rejected."

the description of the answer is here: bitcointalk.org/index.php?topic=5293244.0


---

