<p>The RPC interface is an authenticated interface - it requires a username and password to use it. By specifying <code>--user</code> with the RPC username, <code>curl</code> will prompt you to enter the passphrase before sending the request. <code>myusername</code> is just a placeholder for the RPC username that you actually use.</p>
<p>Note that this username and passphrase is unrelated to the wallet. The wallet does not have usernames, and the passphrase is specific to the wallet and provided in the RPC, not in HTTP headers.</p>

CC BY-SA 4.0
2021-09-27T02:58:27.070Z
it constantly fails so i do not know what's it. i use `http://uname:password@127....` stuff
Алексей Неудачин
CC BY-SA 4.0
2021-09-27T03:04:59.703Z
Fails how? You could add `-v` to get verbose output to get more info on what is going on. The example command works for me.
Ava Chow
CC BY-SA 4.0
2021-09-27T00:18:50.257Z
2021-09-27T00:18:50.257Z
Ava Chow
<pre><code>curl --user myusername --data-binary '{&quot;jsonrpc&quot;: &quot;1.0&quot;, &quot;id&quot;:&quot;curltest&quot;, &quot;method&quot;: &quot;encryptwallet&quot;, &quot;params&quot;: [&quot;my pass phrase&quot;] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/
</code></pre>
<p><a href="https://bitcoincore.org/en/doc/0.16.0/rpc/wallet/encryptwallet/" rel="nofollow noreferrer">https://bitcoincore.org/en/doc/0.16.0/rpc/wallet/encryptwallet/</a><br />
what's it?</p>
<p>looks  like username:password but why then it's called 'myusername'</p>

<wallet><server>
why --user used constantly in curl examples?
Алексей Неудачин
# why --user used constantly in curl examples?

(Asked by: username_0 on 2021-09-27)

curl --user myusername --data-binary '{"jsonrpc": "1.0", "id":"curltest", "method": "encryptwallet", "params": ["my pass phrase"] }' -H 'content-type: text/plain;' http://127.0.0.1:8332/

https://bitcoincore.org/en/doc/0.16.0/rpc/wallet/encryptwallet/
what's it?
looks  like username:password but why then it's called 'myusername'

**Tags:** wallet, server


---

## 1 answers

### Answer by username_1 on 2021-09-27. Score: 1

The RPC interface is an authenticated interface - it requires a username and password to use it. By specifying `--user` with the RPC username, `curl` will prompt you to enter the passphrase before sending the request. `myusername` is just a placeholder for the RPC username that you actually use.

Note that this username and passphrase is unrelated to the wallet. The wallet does not have usernames, and the passphrase is specific to the wallet and provided in the RPC, not in HTTP headers.

> **Comments:**
> **username_0**: it constantly fails so i do not know what's it. i use `http://uname:password@127....` stuff  
> **username_1**: Fails how? You could add `-v` to get verbose output to get more info on what is going on. The example command works for me.  

---

