简体   繁体   中英

How do you verify a signature originated from a given Tezos wallet?

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.

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);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM