How to create an external account ( personal.newAccount()) equivalent in the ethereumj ? I know I could use the jsonrpc api to do so ? But I read https://github.com/ethereum/ethereumj/issues/335 , which says it could create an account, but it could not, it just generates the address, but does not include/add it to the keystore. How can I add this to the keystore.
Ethereumj – How to Create an Account
ethereumj
Best Answer
Firstly you will need the following Maven pom.xml dependency:
And here is the code to create a private key / account pair:
Running the code twice produces the following output:
Verifying the information with https://www.myetherwallet.com/#view-wallet-info:
And note that the accounts created in EthereumJ are all lowercase while the accounts generated from the private keys using MyEtherWallet are mixed case. This is because MyEtherWallet is using the new checksummed accounts. See Yet another cool checksum address encoding #55.