<p>The daemon can do mining using the <code>-gen</code> <a href="https://en.bitcoin.it/wiki/Running_Bitcoin" rel="nofollow">command line option</a>, but it's CPU mining and is impractical nowadays.</p>

<p>Using a separate mining app is practical. That separate mining app connects to a running <code>bitcoind</code> via its JSON-RPC API in order to facilitate <a href="https://en.bitcoin.it/wiki/Getwork" rel="nofollow">getwork</a> or <a href="https://en.bitcoin.it/wiki/Getblocktemplate" rel="nofollow">getblocktemplate</a> requests necessary for hashing.</p>

<p>The JSON-RPC API is configured in <code>bitcoin.conf</code> or at the <a href="https://en.bitcoin.it/wiki/Running_Bitcoin" rel="nofollow">command line</a> using these arguments:</p>

<pre><code>-rpcuser=&lt;user&gt;        Username for JSON-RPC connections
-rpcpassword=&lt;pw&gt;      Password for JSON-RPC connections
-rpcport=&lt;port&gt;        Listen for JSON-RPC connections on &lt;port&gt; (default: 8332 or testnet: 18332)
-rpcallowip=&lt;ip&gt;       Allow JSON-RPC connections from specified IP address
</code></pre>

CC BY-SA 3.0
2013-05-03T12:38:36.683Z
Is `-gen` impractical for **litecoin** mining?
RentFree
CC BY-SA 3.0
2013-05-03T15:12:11.290Z
Not yet, as far as I know. AFAIK, CPU mining is still profitable on Litecoin, but of course decreasingly so.
Colin Dean
CC BY-SA 4.0
2018-10-16T20:01:42.350Z
Note that the mining functionality was removed in Bitcoin Core 0.13.0: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.13.0.md#removal-of-internal-miner
Murch
CC BY-SA 3.0
2013-05-02T18:28:20.353Z
2013-05-02T18:28:20.353Z
Colin Dean
<p>I'm having a hard time understanding the relationship between daemons (such as <code>bitcoind</code> or <code>litecoind</code>) and mining.  Some things I read make it seem that you need a separate mining app and some things seem to suggest that the daemon itself does mining.  Which is it?  I'm thinking maybe the daemon <strong>can</strong> do mining but it needs to be enabled and if you don't enable it you can use a separate app instead?  I'm confused.</p>

<mining-software>
Is a mining program necessary for mining, or can bitcoind mine by itself?
RentFree
# Is a mining program necessary for mining, or can bitcoind mine by itself?

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

I'm having a hard time understanding the relationship between daemons (such as `bitcoind` or `litecoind`) and mining. Some things I read make it seem that you need a separate mining app and some things seem to suggest that the daemon itself does mining. Which is it? I'm thinking maybe the daemon **can** do mining but it needs to be enabled and if you don't enable it you can use a separate app instead? I'm confused.

**Tags:** mining-software


---

## 1 answers

### Answer by username_1 on 2013-05-02. Score: 4 | Accepted answer

The daemon can do mining using the `-gen` [command line option](https://en.bitcoin.it/wiki/Running_Bitcoin), but it's CPU mining and is impractical nowadays.

Using a separate mining app is practical. That separate mining app connects to a running `bitcoind` via its JSON-RPC API in order to facilitate [getwork](https://en.bitcoin.it/wiki/Getwork) or [getblocktemplate](https://en.bitcoin.it/wiki/Getblocktemplate) requests necessary for hashing.

The JSON-RPC API is configured in `bitcoin.conf` or at the [command line](https://en.bitcoin.it/wiki/Running_Bitcoin) using these arguments:

```
-rpcuser=<user>        Username for JSON-RPC connections
-rpcpassword=<pw>      Password for JSON-RPC connections
-rpcport=<port>        Listen for JSON-RPC connections on <port> (default: 8332 or testnet: 18332)
-rpcallowip=<ip>       Allow JSON-RPC connections from specified IP address

```

> **Comments:**
> **username_0**: Is `-gen` impractical for **litecoin** mining?  
> **username_1**: Not yet, as far as I know. AFAIK, CPU mining is still profitable on Litecoin, but of course decreasingly so.  
> **username_2**: Note that the mining functionality was removed in Bitcoin Core 0.13.0: https://github.com/bitcoin/bitcoin/blob/master/doc/release-notes/release-notes-0.13.0.md#removal-of-internal-miner  

---

