Skip to main content
added 1 character in body
Source Link
Pieter Wuille
  • 109.7k
  • 9
  • 202
  • 318

SEC encoded public keys are either:

  • Uncompressed 65-byte encoding: 0x04 + [32-byte X coordinate] + [32-byte Y coordinate]
  • Compressed 33-byte encoding:
    • 0x02 + [32-byte X coordinate] (if Y coordinate is even)
    • 0x03 + [32-byte X coordinate] (if Y coordinate is odd).

P2TR outputoutputs don't use SEC encoded public keys at all, but raw "x-only" public keys, in which only the 32-byte X coordinate itself is revealed. The used BIP340 signature scheme is constructed in such a way that the Y coordinate does not matter.

SEC encoded public keys are either:

  • Uncompressed 65-byte encoding: 0x04 + [32-byte X coordinate] + [32-byte Y coordinate]
  • Compressed 33-byte encoding:
    • 0x02 + [32-byte X coordinate] (if Y coordinate is even)
    • 0x03 + [32-byte X coordinate] (if Y coordinate is odd).

P2TR output don't use SEC encoded public keys at all, but raw "x-only" public keys, in which only the 32-byte X coordinate itself is revealed. The used BIP340 signature scheme is constructed in such a way that the Y coordinate does not matter.

SEC encoded public keys are either:

  • Uncompressed 65-byte encoding: 0x04 + [32-byte X coordinate] + [32-byte Y coordinate]
  • Compressed 33-byte encoding:
    • 0x02 + [32-byte X coordinate] (if Y coordinate is even)
    • 0x03 + [32-byte X coordinate] (if Y coordinate is odd).

P2TR outputs don't use SEC encoded public keys at all, but raw "x-only" public keys, in which only the 32-byte X coordinate itself is revealed. The used BIP340 signature scheme is constructed in such a way that the Y coordinate does not matter.

Source Link
Pieter Wuille
  • 109.7k
  • 9
  • 202
  • 318

SEC encoded public keys are either:

  • Uncompressed 65-byte encoding: 0x04 + [32-byte X coordinate] + [32-byte Y coordinate]
  • Compressed 33-byte encoding:
    • 0x02 + [32-byte X coordinate] (if Y coordinate is even)
    • 0x03 + [32-byte X coordinate] (if Y coordinate is odd).

P2TR output don't use SEC encoded public keys at all, but raw "x-only" public keys, in which only the 32-byte X coordinate itself is revealed. The used BIP340 signature scheme is constructed in such a way that the Y coordinate does not matter.