File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1818//!
1919
2020pub use secp256k1:: schnorrsig:: { PublicKey , KeyPair } ;
21- use secp256k1:: { Secp256k1 , Verification } ;
21+ use secp256k1:: { Secp256k1 , Verification , constants } ;
2222use hashes:: Hash ;
2323use util:: taproot:: { TapBranchHash , TapTweakHash } ;
2424use core:: fmt;
@@ -79,7 +79,6 @@ impl TapTweak for UntweakedPublicKey {
7979 }
8080}
8181
82-
8382impl TweakedPublicKey {
8483 /// Creates a new [`TweakedPublicKey`] from a [`PublicKey`]. No tweak is applied, consider
8584 /// calling `tap_tweak` on an [`UntweakedPublicKey`] instead of using this constructor.
@@ -97,4 +96,11 @@ impl TweakedPublicKey {
9796 & self . 0
9897 }
9998
99+ /// Serialize the key as a byte-encoded pair of values. In compressed form
100+ /// the y-coordinate is represented by only a single bit, as x determines
101+ /// it up to one bit.
102+ #[ inline]
103+ pub fn serialize ( & self ) -> [ u8 ; constants:: SCHNORRSIG_PUBLIC_KEY_SIZE ] {
104+ self . 0 . serialize ( )
105+ }
100106}
You can’t perform that action at this time.
0 commit comments