bmresearch / Solnet

Solana's .NET SDK and integration library.
https://blockmountain.io/Solnet
MIT License
324 stars 130 forks source link

Is there a way to verify signed message that was signed with nacl on client side? #238

Closed nukec closed 3 years ago

nukec commented 3 years ago

For instance this is how message is signed on client side with nacl: https://github.com/solana-labs/wallet-adapter/blob/master/packages/starter/example/components/SignMessage.tsx

Is there a way to verify signed message with having public key with solnet on server side?

hoakbuilds commented 3 years ago

You can replicate this function in the PublicKey class https://github.com/bmresearch/Solnet/blob/master/src/Solnet.Wallet/PublicKey.cs#L100

These methods were implemented but you would need the key pair to actually verify using the PublicKey instance, you can however use the Ed25519 class from Chaos.NaCl dependency to do it