Bitcoin Forum
April 30, 2024, 08:12:49 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1] 2 »  All
  Print  
Author Topic: Verifying a signed message *without* a Bitcoin client installed?  (Read 7433 times)
themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 02, 2013, 12:13:18 AM
 #1

If I have a Bitcoin address and a message signed with the private key of that address, is there a way to verify the signature with standard Unix commands?
1714507969
Hero Member
*
Offline Offline

Posts: 1714507969

View Profile Personal Message (Offline)

Ignore
1714507969
Reply with quote  #2

1714507969
Report to moderator
1714507969
Hero Member
*
Offline Offline

Posts: 1714507969

View Profile Personal Message (Offline)

Ignore
1714507969
Reply with quote  #2

1714507969
Report to moderator
1714507969
Hero Member
*
Offline Offline

Posts: 1714507969

View Profile Personal Message (Offline)

Ignore
1714507969
Reply with quote  #2

1714507969
Report to moderator
"With e-currency based on cryptographic proof, without the need to trust a third party middleman, money can be secure and transactions effortless." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714507969
Hero Member
*
Offline Offline

Posts: 1714507969

View Profile Personal Message (Offline)

Ignore
1714507969
Reply with quote  #2

1714507969
Report to moderator
1714507969
Hero Member
*
Offline Offline

Posts: 1714507969

View Profile Personal Message (Offline)

Ignore
1714507969
Reply with quote  #2

1714507969
Report to moderator
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
June 02, 2013, 12:18:10 AM
 #2

Is a python script (no dependency) ok to use?

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 02, 2013, 12:23:23 AM
 #3

Is a python script (no dependency) ok to use?

Yeah, i'm actually looking to do it in Ruby, but i'm guessing i can convert what is thrown at me to my language of choice. Smiley
jackjack
Legendary
*
Offline Offline

Activity: 1176
Merit: 1233


May Bitcoin be touched by his Noodly Appendage


View Profile
June 02, 2013, 12:33:38 AM
 #4

This is the Bitcoin signature/verification module I made for Armory:
https://github.com/jackjack-jj/jasvet/blob/master/jasvet.py

The function you're looking for is verify_message_Bitcoin(address, signature, message), line 387
Example:
  • address: 13C5HZKutjMDeuc7f5mPj6XGpJCZu7xKh2
  • signature: H55JIuwEi4YXzINOzx2oU6VsfBcTOScpFtp10pP/M4EWV336ClH65SObwPXnRf/fMXDu8hs8nweB42CtpWgngeM=
  • message: aaa

Feel free to ask me anything that isn't clear

Own address: 19QkqAza7BHFTuoz9N8UQkryP4E9jHo4N3 - Pywallet support: 1AQDfx22pKGgXnUZFL1e4UKos3QqvRzNh5 - Bitcointalk++ script support: 1Pxeccscj1ygseTdSV1qUqQCanp2B2NMM2
Pywallet: instructions. Encrypted wallet support, export/import keys/addresses, backup wallets, export/import CSV data from/into wallet, merge wallets, delete/import addresses and transactions, recover altcoins sent to bitcoin addresses, sign/verify messages and files with Bitcoin addresses, recover deleted wallets, etc.
themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 02, 2013, 12:52:29 AM
 #5

From a fairly quick skim through the code, it looks pretty straight forward as written (hahah, though a little more complex than I was hoping!).  The rest of my weekend might be making a Ruby Gem for this. Smiley

Do you have tests for this?  I'd love to duplicate some of the tests also.
themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 02, 2013, 01:25:48 AM
 #6

Just noticed some tests at the bottom: https://github.com/jackjack-jj/jasvet/blob/master/jasvet.py#L551-L579
themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 02, 2013, 09:35:32 AM
 #7

I released a Ruby Gem to verify signatures. More information:

https://github.com/michaelgpearce/bitcoin-cigs

https://bitcointalk.org/index.php?topic=223426
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
June 10, 2013, 04:51:41 PM
 #8

Any kind sould will do it in php?  Grin
piotr_n
Legendary
*
Offline Offline

Activity: 2053
Merit: 1354


aka tonikt


View Profile WWW
June 10, 2013, 05:44:53 PM
 #9

You can also have a look at a tool called versigmsg, from my gocoin project.
https://github.com/piotrnar/gocoin/blob/master/tools/versigmsg.go

If you build it, it end up as a single executable, about 2MB big.

Check out gocoin - my original project of full bitcoin node & cold wallet written in Go.
PGP fingerprint: AB9E A551 E262 A87A 13BB  9059 1BE7 B545 CDF3 FD0E
themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 11, 2013, 02:18:28 AM
 #10

Any kind sould will do it in php?  Grin

Put up a bounty.
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
June 11, 2013, 05:14:31 AM
 #11

I made a standalone C++ tool based on stripped-down bitcoin reference source.  Just depends on OpenSSL.  It should be easy to integrate into any language that can spawn another process and receive its return code, although a native library would probably be better if that's available to you.  https://github.com/scintill/bitcoin-signature-tools

I just added a php demo: https://github.com/scintill/bitcoin-signature-tools/blob/master/tests/verifymessage.php

I would do it in native PHP (a bignum extension required) with this ECC library for a bounty if anyone's interested.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
Raoul Duke
aka psy
Legendary
*
Offline Offline

Activity: 1358
Merit: 1002



View Profile
June 11, 2013, 09:08:24 AM
 #12

I would do it in native PHP (a bignum extension required) with this ECC library for a bounty if anyone's interested.

I'll contribute 0.5 BTC for said bounty.
themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 11, 2013, 09:48:24 AM
 #13

We could also use a JavaScript library while everyone is at it. Smiley
serp
Sr. Member
****
Offline Offline

Activity: 245
Merit: 250


@serp


View Profile WWW
June 11, 2013, 03:06:22 PM
 #14

We could also use a JavaScript library while everyone is at it. Smiley

This is covered by https://github.com/bitcoinjs/bitcoinjs-lib

themgp (OP)
Newbie
*
Offline Offline

Activity: 56
Merit: 0


View Profile
June 11, 2013, 04:24:22 PM
 #15

We could also use a JavaScript library while everyone is at it. Smiley

This is covered by https://github.com/bitcoinjs/bitcoinjs-lib

Perfect.
akabmikua
Full Member
***
Offline Offline

Activity: 223
Merit: 100



View Profile
June 11, 2013, 05:58:22 PM
 #16

We could also use a JavaScript library while everyone is at it. Smiley

This is covered by https://github.com/bitcoinjs/bitcoinjs-lib

Perfect.

Ok with JS? Why not try http://brainwallet.org/#verify

It works offline and is pretty good.

BTC: 16V3WVdW1oXbgAdDHKHdvJ9Msm4CSDrigf
Always, respect. Join CEX.IO and we both get advatage.
serp
Sr. Member
****
Offline Offline

Activity: 245
Merit: 250


@serp


View Profile WWW
June 11, 2013, 08:03:16 PM
 #17

Ok with JS? Why not try http://brainwallet.org/#verify

It works offline and is pretty good.

If you look at the source you will see that the brainwallet you linked uses the bitcoinlib-js linked above.  Using the brainwallet software offline is fine if you are just doing one manually every now and then.  If you are wanting to incorporate the functionality into your own code then it is probably best to use the core library or just write your own.

scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
June 17, 2013, 06:17:30 AM
 #18

I'll contribute 0.5 BTC for said bounty.

OK, thanks.  I've got a first draft of some code that isn't working yet (the public-key recovery is a bit tricky), but should have most of what it needs.  So I need to fix the bug, do some test cases, and clean it up.  I'll try to have that done in the next day or so.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
July 10, 2013, 05:12:39 PM
 #19

I finished the PHP code and put it at https://github.com/scintill/php-bitcoin-signature-routines for those who are interested.

Let me know if you find any problems or have questions.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
November 30, 2013, 02:06:25 AM
 #20

I've been asked by someone in newbie jail, or unable to register, to post here this online signature verification tool he created: coinig.com.  (Some CYA: this is not an endorsement of the correct functionality, security, privacy, etc. of the tool, just sharing a link.)

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
Pages: [1] 2 »  All
  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!