What is Nostr?
npub13zy…2rce
2025-03-12 09:03:18
in reply to nevent1q…cphc

npub13z…l2rce on Nostr: I can generate the correct event_id, but always get bad signature. Any wrong with my ...

I can generate the correct event_id, but always get bad signature. Any wrong with my sign?

from ecdsa import SigningKey, VerifyingKey, SECP256k1

# create event id
event_id = json_hash.hex()
print("event id:", event_id)
print("evnt id length:", len(event_id))

# signature the json_hash
signature = sk.sign(json_hash)

#convert to hex
sig_hex = signature.hex()
print("sig:", sig_hex)
print("sig length:", len(sig_hex))
Author Public Key
npub13zyg3zysfylqc6nwfgj2uvce5rtlck2u50vwtjhpn92wzyusprfsdl2rce