I decided to build a python GUI wrapper around monerod and monero-wallet-rpc. Following https://getmonero.org/knowledge-base/developer-guides/wallet-rpc and https://moneroexamples.github.io/python-json-rpc/ are great, but this requires a wallet to have already been created. Is there a way to generate a new address via API calls? My instinct says no but I thought I would ask. What is another option for wallet creation? Extracting the relevant wallet creation methods in the monero-project/monero source?


Current working solution:

#!/usr/bin/env python
from subprocess import PIPE, Popen

wallet_name = 'new'
wallet_pw   = 'new'

p = Popen(["./monero-wallet-cli", "--generate-new-wallet",
                      wallet_name, "--password", wallet_pw,
                      "--log-level", '1', '>stdout.log'],
out = p.communicate(input='0\n')[0]

This doesn't seem elegant, but it's my current solution. New wallet is created with user specified password, then I open monero-wallet-rpc as a process and make RPC calls from python.

2 Answers 2


There is no RPC to create an address. If there would be one, it would be one that would also "forget" the current one, so it would have limited usefulness.

If you want to have your own code to create addresses, you can either take code from wallet2.cpp and the cryptonote libraries, or use the Javascript version as a base: https://moneroaddress.org/


Using the MoneroPy library, you can create a new Mnemonic + Spend Key + View Key + Address in Python that is compatible with monero-wallet-cli. Documentation is still minimal because the code is still in heavy development, but you should be able to look at comments in accounts.py or look at the unit tests to infer how to do this.


After you install (eventually with just pip, but for now see README), all you need to do is randomly generate a mnemonic seed in a cryptographically secure pseudo-random way, and then calculate all your keys. This can be done very simply:

import moneropy
seed, sk, vk, addr = moneropy.account.gen_new_wallet()

Then, to use it with monero-wallet-rpc save it into the appropriate files (not implemented in MoneroPy).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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