<p>You have to load the wallet into bitcoin core before you can use it. So first, load all the wallets you want to use with <code>bitcoin-cli loadwallet</code>. To verify the loaded wallets, you can use <code>bitcoin-cli listwallets</code></p>
<p>After you have loaded the wallets you can specify the wallet in the connection. The format is <code>&lt;RPC IP address&gt;:&lt;RPC port&gt;/wallet/&lt;wallet name&gt;</code>, for example <code>https://127.0.0.1:8332/wallet/wallet1.dat</code>.</p>
<p>Info from wiki <a href="https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Multi-wallet_RPC_calls" rel="nofollow noreferrer">https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Multi-wallet_RPC_calls</a> and this discussion <a href="https://bitcointalk.org/index.php?topic=5398213.0" rel="nofollow noreferrer">https://bitcointalk.org/index.php?topic=5398213.0</a></p>

CC BY-SA 4.0
2024-01-26T10:19:11.053Z
2024-01-26T10:19:37.517Z
2024-01-26T10:19:37.517Z
Juha Siivikko
<p>I have been playing around a bit with Bitcoin Core (version 23.0), more specifically connecting to different wallets in Bitcoin Core through RPC in Python. I have found <a href="https://github.com/jgarzik/python-bitcoinrpc" rel="nofollow noreferrer">this</a> library and tried to connect to my wallet(s) using this code:</p>
<pre><code>from bitcoinrpc.authproxy import AuthServiceProxy

conn = AuthServiceProxy(&quot;http://myusername:mypassword@127.0.0.1:18332/wallet/testingwallet&quot;)
print(conn.getwalletinfo())
</code></pre>
<p>But when running this i get this stacktrace:</p>
<pre><code>Traceback (most recent call last):
  File &quot;/home/kebab/Desktop/pron/testing.py&quot;, line 24, in &lt;module&gt;
    print(a.getwalletinfo())
  File &quot;/home/kebab/.local/lib/python3.8/site-packages/bitcoinrpc/authproxy.py&quot;, line 141, in __call__
    raise JSONRPCException(response['error'])
bitcoinrpc.authproxy.JSONRPCException: -18: Requested wallet does not exist or is not loaded
</code></pre>
<p>Though what I have noticed is that if i load the wallet using <code>bitcoin-cli -testnet loadwallet testingwallet</code>. Then i can run RPC commands but only get info from that wallet!</p>
<p>And I have created my wallet using: <code>bitcoin-cli -testnet createwallet testingwallet</code></p>
<p>Any help on this would really be appreciated!</p>

<bitcoin-core><wallet><bitcoind><json-rpc><python>
Problems with multiple wallets on RPC in bitcoin-core
chilixxd
# Problems with multiple wallets on RPC in bitcoin-core

(Asked by: username_0 on 2022-05-11)

I have been playing around a bit with Bitcoin Core (version 23.0), more specifically connecting to different wallets in Bitcoin Core through RPC in Python. I have found this library and tried to connect to my wallet(s) using this code:
from bitcoinrpc.authproxy import AuthServiceProxy

conn = AuthServiceProxy("http://myusername:mypassword@127.0.0.1:18332/wallet/testingwallet")
print(conn.getwalletinfo())

But when running this i get this stacktrace:
Traceback (most recent call last):
  File "/home/kebab/Desktop/pron/testing.py", line 24, in 
    print(a.getwalletinfo())
  File "/home/kebab/.local/lib/python3.8/site-packages/bitcoinrpc/authproxy.py", line 141, in __call__
    raise JSONRPCException(response['error'])
bitcoinrpc.authproxy.JSONRPCException: -18: Requested wallet does not exist or is not loaded

Though what I have noticed is that if i load the wallet using bitcoin-cli -testnet loadwallet testingwallet. Then i can run RPC commands but only get info from that wallet!
And I have created my wallet using: bitcoin-cli -testnet createwallet testingwallet
Any help on this would really be appreciated!

**Tags:** bitcoin-core, wallet, bitcoind, json-rpc, python


---

## 1 answers

### Answer by username_1 on 2024-01-26. Score: 1

You have to load the wallet into bitcoin core before you can use it. So first, load all the wallets you want to use with `bitcoin-cli loadwallet`. To verify the loaded wallets, you can use `bitcoin-cli listwallets`

After you have loaded the wallets you can specify the wallet in the connection. The format is `:/wallet/`, for example `https://127.0.0.1:8332/wallet/wallet1.dat`.

Info from wiki <https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)#Multi-wallet_RPC_calls> and this discussion <https://bitcointalk.org/index.php?topic=5398213.0>


---

