<blockquote>
<p>My question is: what would happen if you had a secret key that produced a pubkey with an odd y-coordinate, e.g. 03af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3, but then simply ignore the first byte (03) and passed in af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3 to the taproot_tweak_pubkey function and sent funds to the resulting tweaked pubkey?</p>
</blockquote>
<p><a href="https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki" rel="nofollow noreferrer">BIP340</a> is a specification of Schnorr public keys and Schnorr signatures for Bitcoin. Every valid x coordinate on the secp256k1 curve has two possible y coordinates and so every secret key produces two possible Schnorr pubkeys (two possible y coordinates). <a href="https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki#design" rel="nofollow noreferrer">BIP340</a> chooses the y coordinate that is even as the valid BIP340 pubkey with the y coordinate that is odd defined as an invalid BIP340 pubkey. This was a design choice when BIP340 was finalized but now that design choice is active on the network you have to follow it to generate valid BIP340 signatures that will pass the BIP340 signature verification algorithm. Every full node running Taproot rules will only accept Schnorr signatures that follow the BIP340 rules. If you don't follow them you will produce invalid BIP340 signatures and you won't be able to spend from that output.</p>
<p>You could in theory locally store the x coordinate or the odd y coordinate and still be able to recover from it but anything that goes onchain (pubkey encoded in UTXO, future attempt to spend from that UTXO) has to follow the BIP340 rules.</p>
<blockquote>
<p>Would you still be able to spend the output via key path and script path? And if so, how?</p>
</blockquote>
<p>No if you have to produce a signature and you don't follow the prerequisites of the BIP340 signature algorithm you won't produce a valid BIP340 signature.</p>
<blockquote>
<p>And a similar question: what would happen if instead you actually did the point addition using the public key with an odd y-coordinate, e.g.:</p>
<p>Q = point_add(P_with_odd_y, point_mul(G, t))
Would the output still be spendable (from either key path or script path) in this case?</p>
</blockquote>
<p>Same answer. If you don't perform the Taproot tweak as the BIP341 rules specify and the BIP341 verification rules expect then you will fail any future attempt to spend from that output. These are all essentially consensus rules that need to be followed and enforced to prevent network splits.</p>

CC BY-SA 4.0
2022-10-10T11:54:38.977Z
2022-10-10T14:51:17.053Z
2022-10-10T14:51:17.053Z
Michael Folkson
<p>From BIP341 this example code shows how you can tweak an x-only pubkey:</p>
<pre><code>def taproot_tweak_pubkey(pubkey, h):
    t = int_from_bytes(tagged_hash(&quot;TapTweak&quot;, pubkey + h))
    if t &gt;= SECP256K1_ORDER:
        raise ValueError
    Q = point_add(lift_x(int_from_bytes(pubkey)), point_mul(G, t))
    return 0 if has_even_y(Q) else 1, bytes_from_int(x(Q))
</code></pre>
<p>(The function <code>lift_x</code> will returns a point (x, y) with an even y-coordinate.)</p>
<p>My question is: what would happen if you had a secret key that produced a pubkey with an odd y-coordinate, e.g. <code>03af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3</code>, but then simply ignore the first byte (<code>03</code>) and passed in <code>af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3</code> to the <code>taproot_tweak_pubkey</code> function and sent funds to the resulting tweaked pubkey?</p>
<p>Would you still be able to spend the output via key path and script path? And if so, how?</p>
<p>And a similar question: what would happen if instead you actually did the point addition using the public key with an odd y-coordinate, e.g.:</p>
<pre><code>Q = point_add(P_with_odd_y, point_mul(G, t))
</code></pre>
<p>Would the output still be spendable (from either key path or script path) in this case?</p>

<taproot><schnorr-signatures><p2tr><key-tweaking><x-only-pubkeys>
What would happen if you tweaked a public key with an odd y-coordinate?
Darius
# What would happen if you tweaked a public key with an odd y-coordinate?

(Asked by: username_0 on 2022-10-10)

From BIP341 this example code shows how you can tweak an x-only pubkey:

```
def taproot_tweak_pubkey(pubkey, h):
    t = int_from_bytes(tagged_hash("TapTweak", pubkey + h))
    if t >= SECP256K1_ORDER:
        raise ValueError
    Q = point_add(lift_x(int_from_bytes(pubkey)), point_mul(G, t))
    return 0 if has_even_y(Q) else 1, bytes_from_int(x(Q))

```

(The function `lift_x` will returns a point (x, y) with an even y-coordinate.)

My question is: what would happen if you had a secret key that produced a pubkey with an odd y-coordinate, e.g. `03af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3`, but then simply ignore the first byte (`03`) and passed in `af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3` to the `taproot_tweak_pubkey` function and sent funds to the resulting tweaked pubkey?

Would you still be able to spend the output via key path and script path? And if so, how?

And a similar question: what would happen if instead you actually did the point addition using the public key with an odd y-coordinate, e.g.:

```
Q = point_add(P_with_odd_y, point_mul(G, t))

```

Would the output still be spendable (from either key path or script path) in this case?

**Tags:** taproot, schnorr-signatures, p2tr, key-tweaking, x-only-pubkeys


---

## 1 answers

### Answer by username_1 on 2022-10-10. Score: 2 | Accepted answer

> My question is: what would happen if you had a secret key that produced a pubkey with an odd y-coordinate, e.g. 03af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3, but then simply ignore the first byte (03) and passed in af455f4989d122e9185f8c351dbaecd13adca3eef8a9d38ef8ffed6867e342e3 to the taproot\_tweak\_pubkey function and sent funds to the resulting tweaked pubkey?

[BIP340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki) is a specification of Schnorr public keys and Schnorr signatures for Bitcoin. Every valid x coordinate on the secp256k1 curve has two possible y coordinates and so every secret key produces two possible Schnorr pubkeys (two possible y coordinates). [BIP340](https://github.com/bitcoin/bips/blob/master/bip-0340.mediawiki#design) chooses the y coordinate that is even as the valid BIP340 pubkey with the y coordinate that is odd defined as an invalid BIP340 pubkey. This was a design choice when BIP340 was finalized but now that design choice is active on the network you have to follow it to generate valid BIP340 signatures that will pass the BIP340 signature verification algorithm. Every full node running Taproot rules will only accept Schnorr signatures that follow the BIP340 rules. If you don't follow them you will produce invalid BIP340 signatures and you won't be able to spend from that output.

You could in theory locally store the x coordinate or the odd y coordinate and still be able to recover from it but anything that goes onchain (pubkey encoded in UTXO, future attempt to spend from that UTXO) has to follow the BIP340 rules.

> Would you still be able to spend the output via key path and script path? And if so, how?

No if you have to produce a signature and you don't follow the prerequisites of the BIP340 signature algorithm you won't produce a valid BIP340 signature.

> And a similar question: what would happen if instead you actually did the point addition using the public key with an odd y-coordinate, e.g.:
>
> Q = point\_add(P\_with\_odd\_y, point\_mul(G, t))
> Would the output still be spendable (from either key path or script path) in this case?

Same answer. If you don't perform the Taproot tweak as the BIP341 rules specify and the BIP341 verification rules expect then you will fail any future attempt to spend from that output. These are all essentially consensus rules that need to be followed and enforced to prevent network splits.


---

