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.


1 Answer 1


The specification for BIP34 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.

  • So consensus.BIP34Height is this nonce? Nov 30, 2017 at 2:20
  • It's when the soft fork became enforced. The nonce is the height.
    – Claris
    Nov 30, 2017 at 2:21
  • @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
    Nov 30, 2017 at 2:23
  • r6.ca/blog/20120206T005236Z.html contains more details about the exploit.
    – sanket1729
    Jul 1, 2020 at 4:36

Not the answer you're looking for? Browse other questions tagged or ask your own question.