<p>You need to run either Bitcoin-Qt or bitcoind on your system.  Create a bitcoin.conf file containing the following lines:</p>

<pre><code>rpcuser=your-userid
rpcpassword=your-password
server=1
</code></pre>

<p>You can then connect to your bitcoin node by specifying address 127.0.0.1 and port 8332.  Use the userid and password you specified in the bitcoin.conf file.</p>

<p>While it is possible to open port 8332 to allow remote users to connect to the local node, this is not a good idea for security reasons because it allows access to your wallet.  Instead, your users would communicate with your application and your application would then make the necessary RPC calls to the local node.</p>

CC BY-SA 3.0
2013-12-05T16:13:23.900Z
Thanks Ron, that makes sense. So if I wanted to create a wallet service, where each user creates their own account on my site, and each account is associated with a wallet, then I'd have to have multiple wallets on my server right? One for each user?
bitcoin_lovezzzz
CC BY-SA 3.0
2013-12-05T16:33:31.837Z
A single wallet can have multiple bitcoin addresses.  So you would generate a bitcoin address for each user to allow them to send coins to their account.  Partial withdrawals would be handled by sending the change back to the receive address or to a new change address.  For the strongest security, bitcoin addresses should not be reused.  So your application should allow users to create new addresses as needed.  Your application would then need a database to associate bitcoin addresses with user accounts.
ScripterRon
CC BY-SA 3.0
2013-12-05T16:04:46.803Z
2013-12-10T16:43:58.390Z
2013-12-10T16:43:58.390Z
ScripterRon
<p>So I just started writing a rails app that will be an online wallet. I'm looking over the API code examples for connecting to the bitcoin network at <a href="https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)" rel="nofollow">https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)</a>. </p>

<p>PHP was the easiest example, seen here </p>

<pre><code>  require_once 'jsonRPCClient.php';

  $bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');

  echo "&lt;pre&gt;\n";
  print_r($bitcoin-&gt;getinfo()); echo "\n";
  echo "Received: ".$bitcoin-&gt;getreceivedbylabel("Your Address")."\n";
  echo "&lt;/pre&gt;";
</code></pre>

<p>So I'm presuming that it connects to the bitcoin network via a username and password. Couple of questions.</p>

<p><strong>What username/password?</strong> I bought bitcoin on coinbase, then exported it to a paper wallet. What user/pass is associated with my bitcoin? I thought it was just public/private key? </p>

<p><strong>Why port 8332?</strong> </p>

<p><strong>Why 127.0.0.1? Could it be any address?</strong></p>

CC BY-SA 3.0
2013-12-10T16:47:08.170Z
Pick any username and password that you want.  The values are used only for RPC connections.  Port 8332 is the default port used by bitcoin for RPC connections and 127.0.0.1 is the localhost address (that is, connecting to 127.0.0.1 means you are connecting to a service running on the local system).  You can change the port number if you have a conflict on your system by specifying rpcport in bitcoin.conf.
ScripterRon
<bitcoind><client>
How do you connect to the Bitcoin Client?
bitcoin_lovezzzz
# How do you connect to the Bitcoin Client?

(Asked by: username_0 on 2013-12-05)

So I just started writing a rails app that will be an online wallet. I'm looking over the API code examples for connecting to the bitcoin network at <https://en.bitcoin.it/wiki/API_reference_(JSON-RPC)>.

PHP was the easiest example, seen here

```
  require_once 'jsonRPCClient.php';

  $bitcoin = new jsonRPCClient('http://user:password@127.0.0.1:8332/');

  echo "<pre>\n";
  print_r($bitcoin->getinfo()); echo "\n";
  echo "Received: ".$bitcoin->getreceivedbylabel("Your Address")."\n";
  echo "</pre>";

```

So I'm presuming that it connects to the bitcoin network via a username and password. Couple of questions.

**What username/password?** I bought bitcoin on coinbase, then exported it to a paper wallet. What user/pass is associated with my bitcoin? I thought it was just public/private key?

**Why port 8332?**

**Why 127.0.0.1? Could it be any address?**

**Tags:** bitcoind, client

> **Comments:**
> **username_1**: Pick any username and password that you want.  The values are used only for RPC connections.  Port 8332 is the default port used by bitcoin for RPC connections and 127.0.0.1 is the localhost address (that is, connecting to 127.0.0.1 means you are connecting to a service running on the local system).  You can change the port number if you have a conflict on your system by specifying rpcport in bitcoin.conf.  

---

## 1 answers

### Answer by username_1 on 2013-12-05. Score: 2 | Accepted answer

You need to run either Bitcoin-Qt or bitcoind on your system. Create a bitcoin.conf file containing the following lines:

```
rpcuser=your-userid
rpcpassword=your-password
server=1

```

You can then connect to your bitcoin node by specifying address 127.0.0.1 and port 8332. Use the userid and password you specified in the bitcoin.conf file.

While it is possible to open port 8332 to allow remote users to connect to the local node, this is not a good idea for security reasons because it allows access to your wallet. Instead, your users would communicate with your application and your application would then make the necessary RPC calls to the local node.

> **Comments:**
> **username_0**: Thanks Ron, that makes sense. So if I wanted to create a wallet service, where each user creates their own account on my site, and each account is associated with a wallet, then I'd have to have multiple wallets on my server right? One for each user?  
> **username_1**: A single wallet can have multiple bitcoin addresses.  So you would generate a bitcoin address for each user to allow them to send coins to their account.  Partial withdrawals would be handled by sending the change back to the receive address or to a new change address.  For the strongest security, bitcoin addresses should not be reused.  So your application should allow users to create new addresses as needed.  Your application would then need a database to associate bitcoin addresses with user accounts.  

---

