<p>It's random.</p>

<p>The intent was choosing something long enough to avoid having someone accidentally create an output that matches, but short enough that it doesn't unnecessarily makes SegWit blocks larger.</p>

CC BY-SA 3.0
2017-09-10T06:03:30.527Z
Why was it not chosen to be some regular 4-byte string like all zeros or all ones or `0xAABBCCDD`? Will the probability of someone creating a null data output which matches the header increase if the header had some regular structure?
sarva
CC BY-SA 3.0
2017-09-08T17:19:20.590Z
2017-09-08T17:19:20.590Z
Pieter Wuille
<p>As per <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure" rel="nofollow noreferrer">BIP 141</a>, the witness Merkle root hash is stored in a <code>scriptPubkey</code> field of a coinbase transaction output with a header consisting of the 4-byte string <code>0xaa21a9ed</code>. What is the reasoning behind choosing this string? </p>

<p>Googling only yielded a reference to namecoin on a <a href="http://bitcoinstats.com/irc/bitcoin-dev/logs/2015/12/14#l1450098707.0" rel="nofollow noreferrer">bitcoin-dev IRC log</a>.   </p>

<segregated-witness><coinbase-transaction><witness-commitment>
Why is the bytestring 0xaa21a9ed used as the witness commitment header in SegWit?
sarva
# Why is the bytestring 0xaa21a9ed used as the witness commitment header in SegWit?

(Asked by: username_0 on 2017-09-08)

As per [BIP 141](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#commitment-structure), the witness Merkle root hash is stored in a `scriptPubkey` field of a coinbase transaction output with a header consisting of the 4-byte string `0xaa21a9ed`. What is the reasoning behind choosing this string?

Googling only yielded a reference to namecoin on a [bitcoin-dev IRC log](http://bitcoinstats.com/irc/bitcoin-dev/logs/2015/12/14#l1450098707.0).

**Tags:** segregated-witness, coinbase-transaction, witness-commitment


---

## 1 answers

### Answer by username_1 on 2017-09-08. Score: 0 | Accepted answer

It's random.

The intent was choosing something long enough to avoid having someone accidentally create an output that matches, but short enough that it doesn't unnecessarily makes SegWit blocks larger.

> **Comments:**
> **username_0**: Why was it not chosen to be some regular 4-byte string like all zeros or all ones or `0xAABBCCDD`? Will the probability of someone creating a null data output which matches the header increase if the header had some regular structure?  

---

