Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

VerifyMessage does not exist #1172

Open
robotlovecoffee opened this issue May 9, 2023 · 7 comments
Open

VerifyMessage does not exist #1172

robotlovecoffee opened this issue May 9, 2023 · 7 comments

Comments

@robotlovecoffee
Copy link

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.

@TylerOlsen
Copy link

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)

@knocte
Copy link
Contributor

knocte commented May 15, 2023

You could fork the repo and go back to version previous to 7?

@Cadey
Copy link

Cadey commented Jul 18, 2023

@TylerOlsen Did you get an alternative for this. I just had the same issue

@TylerOlsen
Copy link

TylerOlsen commented Jul 18, 2023

@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 (bitcoin/bitcoin#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!

@Cadey
Copy link

Cadey commented Jul 18, 2023

Your uses case is exactly the same as mine :) Need to validate messages signed with a taproot address :)

@Cadey
Copy link

Cadey commented Jul 18, 2023

@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.....

@Cadey
Copy link

Cadey commented Jul 18, 2023

Ohhhh sorry, I see what you did. You compiled a node from that branch.... sorry, didnt read what you said properly

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants