merge
[electrum-nvc.git] / client / remote.php
1 <?
2 require_once 'jsonrpcphp/includes/jsonRPCClient.php';
3  
4 echo "<pre>\n";
5 echo "This page demonstrates the generation of new addresses by a neutralized Electrum wallet.\n\n";
6 echo "A neutralized wallet does not contain the seed that allows to generate private keys.\nIt contains a master public key that allows to create new addresses.\n\n";
7 echo "An attacker getting access to the neutralized wallet cannot steal the bitcoins.\n";
8 echo "The full wallet (with seed) is not stored on the webserver.\n\n";
9 echo "<form action=\"\" method=\"post\"><input type=\"submit\" name=\"submit\" value=\"Get new address\"/></form> ";
10
11 if($_POST['submit']) {
12   $daemon = new jsonRPCClient('http://foo:bar@ecdsa.org:8444/');
13   try{
14   $r = $daemon->getnewaddress();
15   if($r) {
16       echo '<br/>';
17       echo "<a href='bitcoin:$r'>bitcoin:$r</a>\n\n";
18     }
19   } catch(Exception $e) {
20     echo "error: cannot reach wallet daemon";
21   }
22 }
23 echo "</pre>";
24 ?>