monero-wallet-rpc is the Monero wallet with an HTTP JSON-RPC interface instead of a screen. It holds your keys, scans the chain through a node, and lets a program ask for the balance, create subaddresses, list incoming transfers or send XMR. It ships in every Monero CLI and GUI download, next to monerod and monero-wallet-cli. The safe way to start it is: on localhost, with --rpc-login, against a node you control, and as a view-only wallet unless your program genuinely needs to spend.
This guide follows the 0.18.5.4 source code (src/wallet/wallet_rpc_server.cpp and .h) and the official monero-wallet-rpc reference, checked in November 2026. The Monero documentation's own advice applies throughout: "Use stagenet for learning and development on top of monero-wallet-rpc." Our stagenet guide shows how to get test coins.
How monero-wallet-rpc fits in
your program --HTTP JSON-RPC--> monero-wallet-rpc --daemon RPC--> monerod --P2P--> network
- monerod stores the blockchain and never sees your keys.
- monero-wallet-rpc has the keys, scans for your outputs and builds transactions.
- Your program only talks to the wallet over HTTP on a port you choose.
You can point the wallet at a remote node with --daemon-address, but for a business the reference is direct: "For any real business you should be running your own full node." See how to run a Monero node.
Starting it
The syntax from the reference:
monero-wallet-rpc --rpc-bind-port <port> (--wallet-file <file> | --generate-from-json <file> | --wallet-dir <directory>) [options]
There is no default port: you must choose one. A production-style start:
./monero-wallet-rpc \
--rpc-bind-port 18088 \
--wallet-file /srv/monero/shop \
--password-file /srv/monero/shop.pass \
--rpc-login shop:LongRandomString \
--daemon-address 127.0.0.1:18081 \
--trusted-daemon \
--log-file /var/log/monero-wallet-rpc.log
What each piece does:
--rpc-bind-port: the port your program connects to. The bind IP defaults to 127.0.0.1, so the wallet is not reachable from other machines unless you change--rpc-bind-ipand confirm with--confirm-external-bind.--wallet-file: one wallet, opened at start.--wallet-dirinstead lets your programcreate_wallet,open_walletandclose_walletat runtime; the source refuses--passwordand--password-filetogether with--wallet-dir.--password-file: keeps the wallet password out of the process list and shell history.--trusted-daemon: tells the wallet the node is yours, which enables commands that rely on an honest node. Use--untrusted-daemonfor anything else.--tx-notify "/path/script %s": runs a program for each new incoming transaction, with%sreplaced by its hash.
Exactly one of --wallet-file, --generate-from-json or --wallet-dir is required; the source stops with "Must specify --wallet-file or --generate-from-json or --wallet-dir" otherwise.
Authentication: the login file you did not know about
HTTP authentication is on by default. There are three cases in the source:
--rpc-login user:password: those credentials are required.- Neither option: the wallet generates a random username and password and writes them to a file named
monero-wallet-rpc.<port>.loginin the working directory, for examplemonero-wallet-rpc.18088.login. Your program reads the credentials from there. --disable-rpc-login: no authentication. Fine for a throwaway stagenet test on your own machine, nothing else. The two options cannot be combined.
The login uses HTTP digest authentication, which most HTTP libraries support. With curl:
curl -s --digest -u shop:LongRandomString \
http://127.0.0.1:18088/json_rpc \
-d '{"jsonrpc":"2.0","id":"0","method":"get_balance","params":{"account_index":0}}'
Read-only setups
Most shops, donation pages and accounting tools only need to see incoming payments. Two layers keep a compromised server from spending:
- A view-only wallet. Create it from the primary address and the private view key; it can detect incoming payments but holds no spend key. Our view key guide shows how. One limit: a view-only wallet cannot by itself tell when your outputs are spent, so its balance can be too high if the same wallet also spends elsewhere.
--restricted-rpcon the wallet: "Restricts to view-only commands". Since Monero 0.18.5.0, sensitive methods are also restricted in this mode.
With both, a stolen server leaks your incoming payment history, but not your money.
Methods you will actually call
All methods go to POST /json_rpc. Amounts are integers in atomic units: 1 XMR = 1,000,000,000,000 piconero.
Balance and addresses
| Method | Use |
|---|---|
get_balance | Total and unlocked balance, per account and per subaddress |
get_address | The addresses of an account |
create_address | A new subaddress, optionally with a label |
label_address | Rename a subaddress |
get_address_index | Which account and index an address belongs to |
validate_address | Check an address before you send to it |
get_height | How far the wallet has scanned |
The common pattern for payments is one subaddress per order or per customer, created with create_address. Our subaddress guide explains why this beats payment IDs, and the payment ID article covers the older method.
Incoming payments
| Method | Use |
|---|---|
get_transfers | Transfers filtered by in, out, pending, failed, pool, by height range and subaddress |
get_transfer_by_txid | One transaction, including its confirmations |
incoming_transfers | Individual outputs you own, available or spent |
refresh | Scan now instead of waiting for auto-refresh |
A typical check loop: call get_transfers with in: true, pool: true for the order's subaddress index, show "seen" when it appears in the pool, and mark the order paid after the confirmations your risk allows. Monero outputs are spendable after 10 blocks; our article on how many confirmations Monero needs explains the numbers. You can check a hash on our explorer at any time.
Sending
| Method | Use |
|---|---|
transfer | Send to one or more destinations |
transfer_split | Same, split into several transactions if needed |
sweep_all | Send the whole unlocked balance of an account to one address |
sweep_single | Send one specific output |
sweep_dust | Spend outputs too small to be worth a normal transaction |
relay_tx | Broadcast a transaction you created with do_not_relay |
get_tx_key | The transaction key, for payment proofs |
Every send accepts a priority; get_default_fee_priority tells you what the wallet would use. Use do_not_relay: true with get_tx_metadata: true first if you want to inspect the fee before broadcasting. Our Monero transaction fee guide explains how the fee is set, and the sweep_all article covers consolidating outputs.
Proofs and signatures
| Method | Use |
|---|---|
get_tx_proof / check_tx_proof | Prove or verify a payment to an address |
check_tx_key | Verify a payment with the transaction key |
get_reserve_proof / check_reserve_proof | Prove you hold at least a given balance |
sign / verify | Sign a message with an address |
See how to check a Monero transaction and how to sign a message with Monero.
Cold signing and multisig
export_outputs, import_outputs, export_key_images, import_key_images, sign_transfer, describe_transfer and submit_transfer support a watch-only online wallet with an offline signer. The prepare_multisig / make_multisig / exchange_multisig_keys family handles multisig; see our Monero multisig guide.
Common problems
| Symptom | What is going on |
|---|---|
| The RPC URL does not answer right after start | The wallet is still syncing. The reference suggests syncing the wallet once in the GUI or CLI first |
| 401 Unauthorized | Wrong credentials, or the client is not using digest auth |
| "Must specify --wallet-file ..." | None of the three wallet options given |
| Balance higher than expected on a view-only wallet | It cannot see spends without key images; import them or use the full wallet |
transfer fails with "not enough unlocked money" | Funds received less than 10 blocks ago are still locked |
The reference also suggests keeping two wallet files for the same keys, one for manual use and one for the RPC, so a long resync in one does not block the other.
Security checklist
- Bind to 127.0.0.1 and reach it from your app on the same host or over a private network.
- Always use
--rpc-loginor the generated login file; never--disable-rpc-loginin production. - Use a view-only wallet and
--restricted-rpcwherever spending is not needed. - Keep only working funds in a hot wallet and sweep the rest to cold storage; see our guide to Monero cold storage.
- Run your own node with
--trusted-daemon, or treat the remote node as untrusted.
A minimal payment flow
The same five calls cover most checkouts:
- Create an address for the order.
{"jsonrpc":"2.0","id":"0","method":"create_address","params":{"account_index":0,"label":"order-1042"}}The answer contains the newaddressand itsaddress_index. Store both with the order. - Show it to the buyer, with the amount.
make_uribuilds amonero:payment URI that wallets can scan as a QR code. - Watch for the payment.
{"jsonrpc":"2.0","id":"0","method":"get_transfers","params":{"in":true,"pool":true,"account_index":0,"subaddr_indices":[1042]}}Pool entries mean "seen, not yet in a block". Entries underincarry aheightandconfirmations. - Decide when it is paid. Compare the summed
amountwith the order total, in atomic units, and wait for the number of confirmations your risk allows. - Move funds out of the hot wallet on a schedule with
transferorsweep_allto an address whose spend key is not on the server.
Two details avoid support tickets. Buyers sometimes pay in two transactions, so sum all incoming transfers to the subaddress rather than reading only the first. And exchanges sometimes pay from a batch, so the sending address tells you nothing; the subaddress is what identifies the order.
Keeping it running
monero-wallet-rpc refreshes on its own, but a few settings make it calmer in production:
- Run it under systemd with
--detachand--pidfile, or in the foreground with--non-interactivein a container. - Call
storefrom time to time, and always stop it withstop_walletso the cache is saved; a killed process may have to rescan. - Keep
--max-log-filesand--max-log-file-sizesensible, or hand rotation to logrotate. - Pin a
--daemon-addressyou control. Since 0.18.5.0 theset_daemonmethod also accepts allowed TLS fingerprints correctly, if you switch nodes at runtime.
Testing on stagenet first
Run the whole flow once on stagenet before touching real money: start monerod --stagenet (RPC on port 38081), start the wallet RPC with --stagenet --daemon-address 127.0.0.1:38081, fund it from a faucet, and walk through create, watch, confirm and sweep. Mistakes cost nothing there, and every method behaves the same as on mainnet. Our stagenet guide lists faucets and nodes.
Our recommendation
For developers following Monero releases and security notices, these Telegram channels are worth following:
- cryptoresearch@cryptoresearchOPEN@cryptoresearch: research and explainers
- Crypto_Crime_News@Crypto_Crime_NewsOPEN@Crypto_Crime_News: exploits, fake payment screenshots and scam warnings
FAQ
What port does monero-wallet-rpc use?
None by default. You must set one with --rpc-bind-port.
What is the monero-wallet-rpc login file?
If you set neither --rpc-login nor --disable-rpc-login, the wallet creates random credentials and writes them to monero-wallet-rpc.<port>.login.
Can monero-wallet-rpc run without spending rights?
Yes. Use a view-only wallet, and add --restricted-rpc to limit the API to view commands.
Does monero-wallet-rpc need its own node?
It needs a node, local or remote. For a business, run your own and start the wallet with --trusted-daemon.
How do I get notified of incoming payments?
Use --tx-notify to run a script for each new incoming transaction, or poll get_transfers.
Are amounts in XMR?
No, in atomic units. 1 XMR is 1,000,000,000,000 atomic units (piconero).
