Difference between revisions of "Cpu Miner"

From Bitcoin Wiki
Jump to: navigation, search
m (moved Cpu-miner to Cpu Miner)
(External Links: Reference)
 
(13 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{stub}}'''cpu-miner''' is a Bitcoin cpu miner created by jgarzik. It receives work through the standard JSON-RPC 'getwork' command, and supports several algorithms for doing encryption required to build a block.
+
'''cpuminer''' is a simple client program that performs [[Pooled Mining]] or [[solo mining]]. The program receives proposed [[block]] data from the server, for which it tries to guess a [[nonce]] value that will result in a valid block. If a block [[hash]] with at least 32 consecutive zero bits is found, the block data containing the guessed nonce value is sent back to the server. If used in [[Pooled Mining]] mode, this block is called a "share" because the server is supposed to credit the registered user's account, according to the number of shares that user has contributed, and eventually transfer an amount of bitcoins to the registered user's address.
 +
 
 +
Communication with the server is done using HTTP POST requests on port 8332 by default, containing JSON-encoded data. For pooled mining, users are required to register on such servers (so as to give their Bitcoin address) and HTTP username:password authentication is required.  For solo mining, the username/password is set in bitcoin.conf.
 +
 
 +
The calculations are performed by multiple concurrent threads, so as to take advantage of the capabilities of computers with multiple CPU cores.
  
 
==Algorithms==
 
==Algorithms==
*'''c:''' Linux kernel (but not restricted to Linux) implementation of SHA256.
+
SHA256 hashes can be calculated in many ways by cpu-miner. Depending on the hardware that is used, one of the following supported algorithms will perform best:
 +
 
 +
*'''c:''' Linux kernel implementation of SHA256 (supported on all platforms, including Windows) .
 
*'''4way:''' 128-bit SSE2 optimizations which are already available as a compile-time option on the classic Bitcoin client.
 
*'''4way:''' 128-bit SSE2 optimizations which are already available as a compile-time option on the classic Bitcoin client.
 
*'''via:''' Implementation of the Padlock encryption optimizations on VIA CPUs.
 
*'''via:''' Implementation of the Padlock encryption optimizations on VIA CPUs.
 
*'''cryptopp:''' C/C++ Implementation from the Crypto++ library.
 
*'''cryptopp:''' C/C++ Implementation from the Crypto++ library.
 
*'''cryptopp_asm32:''' 32-bit assembly implementation from the Crypto++ library.
 
*'''cryptopp_asm32:''' 32-bit assembly implementation from the Crypto++ library.
 +
*'''sse2_64:''' Port of ufasoft's SSE2 implementation (only supported on 64-bit Linux)
 +
 +
==Succession==
 +
 +
CPU Miner has largely been superceded by Con Kolivas's cgminer fork (with GPU support) and Luke-Jr's [[BFGMiner]] fork (with FPGA support).
  
==See also==
+
==See Also==
  
* [[Pooled Mining]]
+
* [[Pooled mining]]
  
 
==External Links==
 
==External Links==
  
 
* [https://github.com/jgarzik/cpuminer Github repository with cpuminer code]
 
* [https://github.com/jgarzik/cpuminer Github repository with cpuminer code]
* [http://www.bitcoin.org/smf/index.php?topic=1925.0 Forum thread with announcement and discussion]
+
* [https://bitcointalk.org/index.php?topic=1925.0 Forum thread with announcement and discussion]
 +
* [https://bitcointalk.org/index.php?topic=28402.0 Con Kolivas's cgminer forum announcement and discussion]
 +
* [http://www.bitcoinmining.com/bitcoin-mining-software/ Bitcoin Mining Software]
  
[[Category:Bitcoin miners]]
+
[[Category:Miners]]
[[Category:Mining]]
 

Latest revision as of 01:31, 1 June 2015

cpuminer is a simple client program that performs Pooled Mining or solo mining. The program receives proposed block data from the server, for which it tries to guess a nonce value that will result in a valid block. If a block hash with at least 32 consecutive zero bits is found, the block data containing the guessed nonce value is sent back to the server. If used in Pooled Mining mode, this block is called a "share" because the server is supposed to credit the registered user's account, according to the number of shares that user has contributed, and eventually transfer an amount of bitcoins to the registered user's address.

Communication with the server is done using HTTP POST requests on port 8332 by default, containing JSON-encoded data. For pooled mining, users are required to register on such servers (so as to give their Bitcoin address) and HTTP username:password authentication is required. For solo mining, the username/password is set in bitcoin.conf.

The calculations are performed by multiple concurrent threads, so as to take advantage of the capabilities of computers with multiple CPU cores.

Algorithms

SHA256 hashes can be calculated in many ways by cpu-miner. Depending on the hardware that is used, one of the following supported algorithms will perform best:

  • c: Linux kernel implementation of SHA256 (supported on all platforms, including Windows) .
  • 4way: 128-bit SSE2 optimizations which are already available as a compile-time option on the classic Bitcoin client.
  • via: Implementation of the Padlock encryption optimizations on VIA CPUs.
  • cryptopp: C/C++ Implementation from the Crypto++ library.
  • cryptopp_asm32: 32-bit assembly implementation from the Crypto++ library.
  • sse2_64: Port of ufasoft's SSE2 implementation (only supported on 64-bit Linux)

Succession

CPU Miner has largely been superceded by Con Kolivas's cgminer fork (with GPU support) and Luke-Jr's BFGMiner fork (with FPGA support).

See Also

External Links