Go-Ethereum – How to Generate a New Address Using Json-RPC

addressesgo-ethereumjson-rpc

Well, first of all, I am very new to Ethereum and maybe I am asking something stupid but my question is the following. I feel comfortable using json-rpc commands and I want to know how can I create a new Ethereum address.
In bitcoind the method that I am searching for is "getnewaddress" but I don't know if there is another way to do it in Ethereum. If someone could help me I'd be grateful

Best Answer

have a look at the documentation :

Creating a new account

 geth account new

Creates a new account and prints the address.

On the console, use:

 personal.newAccount("passphrase")

Over RPC (insecure solution)

  curl -X POST --data '{"jsonrpc":"2.0","method":"personal_newAccount","params":["passowrd"],"id":74}' http://localhost:8545

to use it you need to enable the personal Api geth --rpc --rpcapi "personal,eth,web3" more details : https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_newaccount

Related Topic