Skip to content
This repository was archived by the owner on May 22, 2024. It is now read-only.

Commit ec61b17

Browse files
committed
add sign byte for public key
1 parent 467c59d commit ec61b17

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

nostr/key.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
class PublicKey:
1010
def __init__(self, raw_bytes: bytes) -> None:
11-
self.raw_bytes= raw_bytes
11+
self.raw_bytes = raw_bytes
1212

1313
def bech32(self) -> str:
1414
converted_bits = bech32.convertbits(self.raw_bytes, 8, 5)
@@ -18,7 +18,7 @@ def hex(self) -> str:
1818
return self.raw_bytes.hex()
1919

2020
def verify_signed_message_hash(self, hash: str, sig: str) -> bool:
21-
pk = secp256k1.PublicKey(self.raw_bytes, True)
21+
pk = secp256k1.PublicKey(b"\x02" + self.raw_bytes, True)
2222
return pk.schnorr_verify(bytes.fromhex(hash), bytes.fromhex(sig), None, True)
2323

2424
class PrivateKey:

0 commit comments

Comments
 (0)