12

I know how to create wallet manually, however I would not like to take my clients out of website (I doubt anyone would) and would rather do their wallet creation behind the scenes when they register on website.

At first I was thinking of building wallet creation myself, but then it hit me that everyone who is trying to build a system for non technical users will try to do the same - generate wallet behind the scenes... and that someone very likely has built an API to do this already...

Is there an API to create Ether wallet?

1
  • 1
    Using a 3rd-party API for your clients' funds, means those funds could be stolen or lost by the 3rd-party. Generally not recommended and probably only worth considering those that have a track record of customers, security, and possibly has insurance.
    – eth
    Commented Jan 25, 2020 at 12:40

4 Answers 4

4

BlockCypher is your answer, and it's been used by top organizations in the crypto space including exchanges. Both Private and Public keys of ETH or BTC are generated instantly and deleted from their server but you get to store in a db, assign to user or do whatever you want with it.

Get Token at https://accounts.blockcypher.com/

FREE plan comes with:

2000 Requests Per Day

200 Requests Per Hour

3 Requests Per Second

To generate ETH address and key (ETH Address are in Hex-encoded, Make sure to add 0x in front):

curl -sX POST https://api.blockcypher.com/v1/eth/main/addrs?token=YOURTOKEN

To generate BTC address and key:

curl -sX POST https://api.blockcypher.com/v1/btc/main/addrs?token=YOURTOKEN

See Documentation https://www.blockcypher.com/dev/ethereum/#block-height-endpoint

NOTE: Always generate over HTTPS, otherwise your private keys can be MITM'd.

Although it might not be advisable to use this for long term projects, so i also suggest Pre-generated address technique which can be adopted to create cold-wallet on fly.

2
  • Through Blockcypher you can have the all the wallet service or You can actually create your own wallet?
    – Sagar Shah
    Commented Aug 8, 2018 at 14:45
  • 1
    @SagarShah Blockcypher have a running node for all the coins they support. So there is API endpoint to push transactions to the blockchain or track deposits too, so you can use their service to run a wallet if you want. But they could be expensive when using their webhooks.
    – Julius
    Commented Aug 8, 2018 at 19:01
5

You could use JSON RPC to create a wallet and set password. But PHP and geth don't go well together, it will limit your app. I recommend going directly with web3.js, and by the way, myetherwallet is a very nice code and open-source so you could integrate as on site wallet.

For generating wallet thought JSON-RPC (pass sent over the network):

//create eth wallet supplying pass, return wallet address if created

function getethwallet($pass) {

    $url = "http://node.ip:8545";   
    $data = array(
                 "jsonrpc" => "2.0",
                 "method" => "personal_newAccount",
                 "params" => array($pass),
                 "id" => "1"
                 );

    $json_encoded_data = json_encode($data);


$ch = curl_init($url);                                                                      
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "POST");                                                                     
curl_setopt($ch, CURLOPT_POSTFIELDS, $json_encoded_data);                                                                  
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);                                                                      
curl_setopt($ch, CURLOPT_HTTPHEADER, array(                                                                          
    'Content-Type: application/json',                                                                                
    'Content-Length: ' . strlen($json_encoded_data))                                                                       
);                                                                                                                   

$result = json_decode(curl_exec($ch));
curl_close($ch);

        $parsed = $result->result;

return $parsed;
}   
0
3

No, there are no such services because of obvious reasons.

If you trust a 3rd party with your wallet creation they can store the keys which is a serious problem.

If you think you are non technical and can do the API call you can do more with myetherwallet.com offline build. It will help you run the entire myetherwallet.com in your local machine, even without internet.

Steps: Make sure you have nodejs and git installed.

  1. git clone https://github.com/MyEtherWallet/MyEtherWallet.git mew --depth=1
  2. cd mew
  3. npm i
  4. npm run build

This will create a folder named build in mew/build which will help you do this.

PS: Please do not trust any 3rd party with you wallet keys, if you store considerable amount of coins.

6
  • Hi niksmac, but isn't it the same if I use MyEtherWallet manually, they still can store all the data before giving it to me.... Commented Jun 29, 2017 at 5:08
  • 2
    No the source code is public and the community had verified the source.
    – niksmac
    Commented Jun 29, 2017 at 5:10
  • What I meant if I go to myetherwallet.com and the create wallet there... It would be equivalent of having to trust them with my keys since they gave them to me... but then if I am willing to trust myetherwallet then there might be another 'trustworthy API' that does this... and to my clients I would be that 3rd party... Commented Jun 29, 2017 at 5:12
  • @MatasVaitkevicius No, the source code is public and the community had verified the source.
    – niksmac
    Commented Jun 29, 2017 at 15:14
  • @MatasVaitkevicius This answer says to obtain the offline build by cloning the open source repo...
    – eth
    Commented Jan 25, 2020 at 12:27
3

Quick and Easy with this command:

curl -sX POST https://api.blockcypher.com/v1/eth/main/addrs

1
  • If you could provide more detail with this answer, that would be good. Commented Jul 3, 2018 at 15:21

Not the answer you're looking for? Browse other questions tagged or ask your own question.