Author

Topic: Verify a signed message in PHP. Without downloading anything (Read 1763 times)

member
Activity: 98
Merit: 10
Nah, I think OP's script is good enough. Not perfect tho
legendary
Activity: 1106
Merit: 1000
Nice tutorial, don't bashing a newbie guys, moreover he's not want to robbed your coin.
nice works!

Use this library and do it locally:

https://github.com/Bit-Wasp/bitcoin-php
That script requires some extensions, my version is pure PHP

Your script requires extensions too - JSON and cURL support are extensions.

Well this is right, op script is not pure php. but the script is simple I think, easy to understand.
sr. member
Activity: 412
Merit: 275
Use this library and do it locally:

https://github.com/Bit-Wasp/bitcoin-php
That script requires some extensions, my version is pure PHP

Your script requires extensions too - JSON and cURL support are extensions.
newbie
Activity: 28
Merit: 0
Gotta love it here, it's become as toxic as a children playground! You all need to grow up.
A newb posts a how-to with good intentions to educate or help others. What's the response? BC.info sucks, why are you using API, you should do it with this library instead, you should host a full node on your server and do JSON RPC, etc. 
Who cares what you think about BC.info and their wallet service? He's not telling anyone to store coins there. Their API is a free service that is actually useful, but you all like to take the popular choice that BC.info sucks, no matter the usage or implementation.

It's easy to be a critic. Why you don't you create your own how to's or tutorials?
I don't know if you're hating on me, but I didn't say to anyone to use that wallet. It's required to log onto the RPC Server

Not at all, I was hating on all the others that were bashing your tutorial. I sent you a tip.
Oh, thank you then!
legendary
Activity: 1442
Merit: 1179
Gotta love it here, it's become as toxic as a children playground! You all need to grow up.
A newb posts a how-to with good intentions to educate or help others. What's the response? BC.info sucks, why are you using API, you should do it with this library instead, you should host a full node on your server and do JSON RPC, etc. 
Who cares what you think about BC.info and their wallet service? He's not telling anyone to store coins there. Their API is a free service that is actually useful, but you all like to take the popular choice that BC.info sucks, no matter the usage or implementation.

It's easy to be a critic. Why you don't you create your own how to's or tutorials?
I don't know if you're hating on me, but I didn't say to anyone to use that wallet. It's required to log onto the RPC Server

Not at all, I was hating on all the others that were bashing your tutorial. I sent you a tip.
newbie
Activity: 28
Merit: 0
Gotta love it here, it's become as toxic as a children playground! You all need to grow up.
A newb posts a how-to with good intentions to educate or help others. What's the response? BC.info sucks, why are you using API, you should do it with this library instead, you should host a full node on your server and do JSON RPC, etc. 
Who cares what you think about BC.info and their wallet service? He's not telling anyone to store coins there. Their API is a free service that is actually useful, but you all like to take the popular choice that BC.info sucks, no matter the usage or implementation.

It's easy to be a critic. Why you don't you create your own how to's or tutorials?
I don't know if you're hating on me, but I didn't say to anyone to use that wallet. It's required to log onto the RPC Server
legendary
Activity: 1442
Merit: 1179
Gotta love it here, it's become as toxic as a children playground! You all need to grow up.
A newb posts a how-to with good intentions to educate or help others. What's the response? BC.info sucks, why are you using API, you should do it with this library instead, you should host a full node on your server and do JSON RPC, etc. 
Who cares what you think about BC.info and their wallet service? He's not telling anyone to store coins there. Their API is a free service that is actually useful, but you all like to take the popular choice that BC.info sucks, no matter the usage or implementation.

It's easy to be a critic. Why you don't you create your own how to's or tutorials?
newbie
Activity: 28
Merit: 0
Use this library and do it locally:

https://github.com/Bit-Wasp/bitcoin-php
That script requires some extensions, my version is pure PHP
legendary
Activity: 3612
Merit: 1564
newbie
Activity: 37
Merit: 0
Whats the benefit if you rely on an API anyway?

You reduce stress on disk space and you can cut back on bandwidth usage at the same time
sr. member
Activity: 538
Merit: 250
Why use the blockchain.info api? Blockchain.info has a terrible track record and their service isn't all that great. I would not use their api.
copper member
Activity: 1498
Merit: 1520
No I dont escrow anymore.
Whats the benefit if you rely on an API anyway?
You can save a lot of bandwidth and disk space. Also, it's much easier

https://chainquery.com/bitcoin-api/verifymessage
newbie
Activity: 28
Merit: 0
Whats the benefit if you rely on an API anyway?
You can save a lot of bandwidth and disk space. Also, it's much easier
copper member
Activity: 1498
Merit: 1520
No I dont escrow anymore.
Whats the benefit if you rely on an API anyway?
newbie
Activity: 28
Merit: 0
First go to http://www.blockchain.info/ and create a wallet.
Copy down the identifier.
Download the lite version of JSON-RPC PHP Client. http://jsonrpcphp.org/?page=download&lang=en

Include it in your php file, you want to use it.
Write your connect script like this:
Quote
$bitcoin = new jsonRPCClient('http://user:[email protected]/');

Next, create some variables:
Quote
$message = Your message; $address = Address; $signature = Signature
Create another variable that will have a value of true or false. This indicates the validity of the message.
Quote
$sig_valid = $bitcoin->verifymessage($address,$signature,$message)

Now check the state:
Quote
if($sig_valid) { //valid } else { //invalid }

So, for the lazy people, here's the full code:
Quote
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('http://user:[email protected]/');

$address;
$message;
$signature;

$sig_valid = $bitcoin->verifymessage($address,$signature,$message);
if($sig_valid) {
     //valid
} else {
     //invalid
}

?>

You can do more things with this: https://blockchain.info/hu/api/json_rpc_api

Happy programming! I'll post more programming tutorials soon! Also, if you have an idea, PM me and we can team up on it.

Tips are appreciated: 1Tipo4u5vkaNDjPd5A4wxPxmR4bEp8Bdb
Jump to: