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=enInclude it in your php file, you want to use it.
Write your connect script like this:
Next, create some variables:
$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.
$sig_valid = $bitcoin->verifymessage($address,$signature,$message)
Now check the state:
if($sig_valid) { //valid } else { //invalid }
So, for the lazy people, here's the full code:
<?php
require_once 'jsonRPCClient.php';
$bitcoin = new jsonRPCClient('
http://user:password@rpc.blockchain.info/');$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_apiHappy 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