Bitcoin Forum
July 06, 2024, 10:58:10 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Verify Bitcoin address signed message in C#  (Read 1063 times)
apbarratt (OP)
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
March 05, 2014, 10:15:50 AM
 #1

Hi guys,

I've been searching everywhere for this but can't find it anywhere.  I'd like to verify a signed message's signature as being generated by a specific Bitcoin address using C#.

I'm not a strong crypto-coder so I was hoping for a pre-made solution, I found the code at http://stackoverflow.com/a/20400041 though this only seems to verify that the signature is valid, not that it came from a specified address.

In essence, I am looking for a method like so

Code:
public static bool VerifySignature(string address, string message, string signature)
{
    //jiggery pokery that likely uses the wonderful Bouncy Castle

    return (Signature valid and generated by specified address)
}

I found similar tools that do this in Python but would really appreciate a C# method and I suspect many others will appreciate it too.  Does anyone know where I should look?  It's entirely possible I've just been using the wrong search terms in my hunt Smiley

Andy
mcaizgk2
Member
**
Offline Offline

Activity: 66
Merit: 10


View Profile
March 06, 2014, 02:43:56 PM
 #2

You can verify the message as a whole using the verifymessage bitcoind' API RPC command. Take a look at: https://github.com/GeorgeKimionis/BitcoinLib for a working C# implementation, you then need to call: VerifyMessage(String bitcoinAddress, String signature, String message).
ning
Full Member
***
Offline Offline

Activity: 173
Merit: 100



View Profile
March 08, 2014, 01:41:17 PM
 #3

There's also an Erlang implementation:

https://bitcointalk.org/index.php?topic=336430
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!