Reputation: 21
After connecting to a Tezos wallet, you can send over a payload requesting it be signed.
Given the signature, wallet address, and a pre-defined message (payload) what are the steps to determine the authenticity of that signature.
Upvotes: 2
Views: 322
Reputation: 198
import { verifySignature } from '@taquito/utils';
verifySignature(
payloadBytes,
publicKey,
updateAatarLinkDto.signature,
);
You need to include payloadBytes
and signature
to verify.
Upvotes: 1
Reputation: 995
You can do that in C# using Netezos library.
First, you need to obtain the public key for a given wallet address:
using Netezos.Rpc;
using var rpc = new TezosRpc("https://mainnet-tezos.giganode.io/");
var rawPubKey = await rpc.Blocks.Head.Context.Contracts[address].ManagerKey.GetAsync<string>();
Then you can verify the signature:
using Netezos.Keys;
var pubKey = PubKey.FromBase58(rawPubKey);
var isValid = pubKey.Verify(message, signature);
Upvotes: 1