<p>This Script is a 2-bytes-long version 1 witness program. It's a witness program to benefit from txid non-malleability. It's a version 1 program because <a href="https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program" rel="nofollow noreferrer">for version 0 any program not 20 or 32 bytes long is invalid</a>. It's 2 bytes long because it is the minimum length of a witness program.</p>
<p>The two bytes of the witness program <a href="https://delvingbitcoin.org/t/segwit-ephemeral-anchors/160/2?u=antoinep" rel="nofollow noreferrer">were chosen as a vanity address</a>. The bech32m encoding of the Script is <code>bc1pfeessrawgf</code>, which contains the word &quot;fees&quot;.</p>
<p>The Script is slightly different from your understanding. It's <code>OP_1 &lt;0x4e73&gt;</code>, or as a byte array <code>[0x51, 0x02, 0x4e, 0x73]</code>.</p>

CC BY-SA 4.0
2024-10-02T08:02:55.573Z
2024-10-02T08:02:55.573Z
Antoine Poinsot
<p>I am trying to understand the new <code>PayToAnchor</code> script, which is part of v28.0. Here is the script definition:</p>
<p><a href="https://github.com/bitcoin/bitcoin/blob/master/src/script/script.cpp#L207-L222" rel="nofollow noreferrer">https://github.com/bitcoin/bitcoin/blob/master/src/script/script.cpp#L207-L222</a></p>
<p>As I understand, the above script would translate to following:</p>
<p><code>op_true op_pushdata4 2 4e73</code></p>
<p>Can someone please confirm that this is correct understanding? Also, what the reason for this particular script for PayToAnchor? It appears that it is not validated - <a href="https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1946" rel="nofollow noreferrer">interpreter.cpp#VerifyWitnessProgram</a>, so the script could have been anything else. Is there any specific reason for using this particular script for PayToAnchor?</p>

<bitcoin-core-development><segregated-witness><output-script><pay-to-anchor>
Understanding v28.0 PayToAnchor script
Kevin
# Understanding v28.0 PayToAnchor script

(Asked by: username_0 on 2024-10-02)

I am trying to understand the new `PayToAnchor` script, which is part of v28.0. Here is the script definition:

<https://github.com/bitcoin/bitcoin/blob/master/src/script/script.cpp#L207-L222>

As I understand, the above script would translate to following:

`op_true op_pushdata4 2 4e73`

Can someone please confirm that this is correct understanding? Also, what the reason for this particular script for PayToAnchor? It appears that it is not validated - [interpreter.cpp#VerifyWitnessProgram](https://github.com/bitcoin/bitcoin/blob/master/src/script/interpreter.cpp#L1946), so the script could have been anything else. Is there any specific reason for using this particular script for PayToAnchor?

**Tags:** bitcoin-core-development, segregated-witness, output-script, pay-to-anchor


---

## 1 answers

### Answer by username_1 on 2024-10-02. Score: 4 | Accepted answer

This Script is a 2-bytes-long version 1 witness program. It's a witness program to benefit from txid non-malleability. It's a version 1 program because [for version 0 any program not 20 or 32 bytes long is invalid](https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki#witness-program). It's 2 bytes long because it is the minimum length of a witness program.

The two bytes of the witness program [were chosen as a vanity address](https://delvingbitcoin.org/t/segwit-ephemeral-anchors/160/2?u=antoinep). The bech32m encoding of the Script is `bc1pfeessrawgf`, which contains the word "fees".

The Script is slightly different from your understanding. It's `OP_1 <0x4e73>`, or as a byte array `[0x51, 0x02, 0x4e, 0x73]`.


---

