<p>The <a href="https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki" rel="nofollow noreferrer">specification for BIP34</a> was created to fix a vulnerability where it was possible to make two transactions with the same TXID. To fix this a nonce was added coinbase transaction, where the height of the block must be encoded in the first bytes of the first transactions input. The definition is for when that soft fork became enforced. </p>

CC BY-SA 3.0
2017-11-30T02:20:56.943Z
So consensus.BIP34Height is this nonce?
Dev Oskii
CC BY-SA 3.0
2017-11-30T02:21:29.487Z
It's when the soft fork became enforced. The nonce is the height.
Claris
CC BY-SA 3.0
2017-11-30T02:23:23.597Z
@eponymous, I read the specification, but it did not contain much info on vulnerability. Can you share how does one create 2 different transactions with same txID? or would you want me to create a new question for it?
sanket1729
CC BY-SA 4.0
2020-07-01T04:36:11.203Z
http://r6.ca/blog/20120206T005236Z.html contains more details about the exploit.
sanket1729
CC BY-SA 3.0
2017-11-30T02:11:08.210Z
2017-11-30T02:11:08.210Z
Claris
<p>In the bitcoin source code, I am looking at <code>chainparams.cpp</code>. I can see on <code>line 81</code> something called consensus.BIP34Height? What is that? I can't figure out what this is. </p>

<p>I'm not sure what else to ask other than what is this? I can't see any mention of it in the developer reference. </p>

<bitcoin-core><source-code><bip-34>
What is consensus.BIP34Height?
Dev Oskii
# What is consensus.BIP34Height?

(Asked by: username_0 on 2017-11-30)

In the bitcoin source code, I am looking at `chainparams.cpp`. I can see on `line 81` something called consensus.BIP34Height? What is that? I can't figure out what this is.

I'm not sure what else to ask other than what is this? I can't see any mention of it in the developer reference.

**Tags:** bitcoin-core, source-code, bip-34


---

## 1 answers

### Answer by username_1 on 2017-11-30. Score: 1 | Accepted answer

The [specification for BIP34](https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki) was created to fix a vulnerability where it was possible to make two transactions with the same TXID. To fix this a nonce was added coinbase transaction, where the height of the block must be encoded in the first bytes of the first transactions input. The definition is for when that soft fork became enforced.

> **Comments:**
> **username_0**: So consensus.BIP34Height is this nonce?  
> **username_1**: It's when the soft fork became enforced. The nonce is the height.  
> **username_2**: @eponymous, I read the specification, but it did not contain much info on vulnerability. Can you share how does one create 2 different transactions with same txID? or would you want me to create a new question for it?  
> **username_2**: http://r6.ca/blog/20120206T005236Z.html contains more details about the exploit.  

---

