This is a very niche question regarding BIP340 and key tweaking with even-only public keys.
I feel my question may be a matter of opinion, since there doesn't appear to be an accepted right / wrong way to do things.
Key Tweaking
Let's say that you want to apply a series of tweaks to a secret key, and the returned key needs to have an even Y coordinate.
You have two operations available:
- [tweak] secret key (sec * tweak % N)
- [negate?] secret key (if pub(sec) == odd then sec * (N - 1))
You can apply the tweaks in two possible ways:
-
- [tweak], [tweak], [negate?]
-
- [tweak], [negate?], [tweak], [negate]
Both solutions are valid, and will produce the desired key. However, neither solution is compatible with the other, so all parties must agree on which method to use.
So what is the accepted solution here? The first solution requires less operations, but the second solution may also have some benefit?
The concept of even-only public keys is relatively new, so I'm not sure what the clear consensus is here.
Any feedback would be greatly appreciated!