Closed elvis-hp closed 1 year ago
Looking at the linked example code, it's not a DER signature but a compact one. Try this instead: https://github.com/BitonicNL/verify-signed-message/blob/main/pkg/verify.go#L81
btcd
Hi, thank you for reply. But my project using new btcd lib, they had moved to another link, and some function not found! The link you sent me use btcd old lib.
Is the sig actually base64 encoded, then hex encoded as the variable name mentions? If so you'll need to actually decode it. Closing this for now (feel free to option up a discussion).
I got an error: "malformed signature: no header magic"
signature, err := ecdsa.ParseDERSignature(sigBytes)
signatureBase64Hex message is was signed from code: https://github.com/bitcoinjs/bitcoinjs-message with segwit format (p2wpkh).So, with the bellow code, how to Parse the message and verify it with status true. Thank you!
fullcode: