Closed robotlovecoffee closed 1 month ago
It seems this method was removed starting with version 7 - I too was wondering how to validate a signature via NBitcoin, specifically from a segwit bech32 address - does the library currently not support this? If not, can anyone recommend any alternatives?
Been working on something custom in the meantime, but it's been tough (new to bc and crypto in general)
You could fork the repo and go back to version previous to 7?
@TylerOlsen Did you get an alternative for this. I just had the same issue
@Cadey I did find an alternative, I specifically needed to verify BIP322 messages signed with a taproot address (for ordinals) so this may not be applicable to you, but I just cloned the branch of btc-core that supported this (https://github.com/bitcoin/bitcoin/pull/24058) and verified messages via RPC - problem solved!
I highly recommend doing something similar, because I spent too much time trying to build my own implementation that just wouldn't work 😂 the above should only take an hour of work and a few hours of downloading for a pruned node.
Good luck!
Your uses case is exactly the same as mine :) Need to validate messages signed with a taproot address :)
@TylerOlsen sorry to bother you again, I did try to validate the message with a node but it keeps rejecting it.
Ive tried making sure the "Magicbytes" are included in the message which did catch me out at first, but its like the verifyMessage function doesn't support taproot addresses or something.....
Ohhhh sorry, I see what you did. You compiled a node from that branch.... sorry, didnt read what you said properly
BIP322 has been merged which brings back supports through it (it is backward compatible) See https://github.com/MetacoSA/NBitcoin/pull/1224/files#diff-7a7679ce5e15cbfe8fcf1bfdf8afa147e91bde233e73c080c2d5b2649f8bfbf7R10 for examples
I'm trying to do a simple verification of an address and the samples provide code that will not compile.
'BitcoinPubKeyAddress' does not contain a definition for 'VerifyMessage' and no accessible extension method 'VerifyMessage' accepting a first argument of type 'BitcoinPubKeyAddress' could be found (are you missing a using directive or an assembly reference?) [NBitcoinTraining]
I just want to provide a message, have the user sign and return back to the program and then verify that it is correct.