All the chatter about dogecoin and then my colleagues chatting about mining got me interested in seeing how hard it is to get started in crypto mining. Today we'll check out mining on Windows with GPUs and Raspberry Pis with CPUs. I will be upfront to say this is for fun and education. With the hardware (at least that I have onhand) it is likely not profitable.
Windows
I started with this youtube guide to get going. That means installing Easyminer from https://sourceforge.net/projects/easyminer/
In that Youtubers guide, he used a series of exchanges (yobit) and pools. I found all of it pretty sketchy. In the end, i ended up using Prohashing . I have no idea if it's really better than alternatives but the UI was clear, the payout was clear and i could setup my own payment method later (for me, that is Stellar Lumens).
Setting up mining on Windows was pretty easy, but i question if its working all that well. For instance, my Dell XPS with a decent GPU (albeit an older 1070) did great at the start then stopped showing results later. The Surface Laptop which is by no means a game rig, has steadily used Easyminer with 100-200Kh/s just fine. For a glorified ultrabook, that's pretty good (imho).
I question the "Use ccminer instead of cuda" setting.
The sections that matter are Username, Password and Pool Address.. You can try different algorithms at the bottom.
If you want to NOT do one of them, just clear all the values from that section.
when we turn it on, we can hear the fan kick in
As I mentioned, I looked into different hashing pools and Prohashing stood out as a pretty good one. Its responsive and had decent reviews.
Mining on a Pi
To setup CPU miner on a PI we can do it two ways. I have a newer Pi using Ubuntu Focal Fossa (20.04).
I need to get some libraries installed first:
$ sudo apt install -y mesa-common-dev build-essential
$ sudo apt install git automake autoconf libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev
$ sudo apt-get install libz-dev
Then we can clone and build
$ git clone https://github.com/carolinedunn/cpuminer-multi
$ cd cpuminer-multi/
$ ./autogen.sh
$ ./configure
$ ./build.sh
when done, we should get output in the folder as such
ubuntu@ubuntu:~/Workspaces/cpuminer-multi$ ls
AUTHORS Makefile algo build-linux-arm.sh config.log cpuminer cpuminer-sysinfos.o cpuminer.vcxproj lyra2 nohup.out sysinfos.c
Android.mk Makefile.am api build.sh config.status cpuminer-api.o cpuminer-uint256.o cpuminer.vcxproj.filters m4 nomacro.pl uint256.cpp
COPYING Makefile.in api.c compat config.sub cpuminer-conf.json cpuminer-util.o crypto miner.h res uint256.h
ChangeLog NEWS asm compat.h configure cpuminer-config.h cpuminer.1 depcomp mingw64.sh scryptjane util.c
Dockerfile README.md autogen.sh compile configure.ac cpuminer-config.h.in cpuminer.nsi elist.h mining-coins.png sha3 yescrypt
LICENSE aclocal.m4 autom4te.cache config.guess cpu-miner.c cpuminer-cpu-miner.o cpuminer.sln install-sh missing stamp-h1
The guide i used showed using 'sudo' to build which is silly. Don't do that. You don't need to be root to compile software.
32bit Pis
For the older Pi's i have, they run a Debian that comes on Pi - one being "Retropi".
pi@raspberrypi:~ $ cat /etc/apt/sources.list
deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
Realized that Debian and Ubuntu are related by not identical. So jessie is similar to xenial. However, these hosts are not Arm64, rather ArmHF which makes life a little harder getting binaries installed since that's a 32bit kernel.
$ sudo apt update && sudo apt install libssl-dev
$ sudo apt -f install git automake autoconf libcurl4-openssl-dev libjansson-dev libssl-dev libgmp-dev
$ sudo apt-get install libz-dev zlib1g-dev
Then the rest of the steps are the same
$ git clone https://github.com/carolinedunn/cpuminer-multi
$ cd cpuminer-multi/
$ ./autogen.sh
$ ./configure
$ ./build.sh
Since these older Pis ran a k3s cluster that was not in use, kill that to increase performance sudo /usr/local/bin/k3s-killall.sh
We can run cpuminer interactively:
ubuntu@ubuntu:~/Workspaces/cpuminer-multi$ ./cpuminer -a scrypt -o stratum+tcp://prohashing.com:3335 -u idjohnson -p a=sha-356,n=pi31
** cpuminer-multi 1.3.7 by tpruvot@github **
BTC donation address: 1FhDPLPpw18X4srecguG3MxJYe4a1JsZnd (tpruvot)
[2021-05-12 18:55:07] Starting Stratum on stratum+tcp://prohashing.com:3335
[2021-05-12 18:55:07] 4 miner threads started, using 'scrypt' algorithm.
[2021-05-12 18:55:07] Stratum difficulty set to 65536 (1.00000)
[2021-05-12 18:55:07] scrypt block 687629, diff 489012592559.943
[2021-05-12 18:55:08] CPU #1: 1.99 kH/s
[2021-05-12 18:55:08] CPU #2: 2.01 kH/s
[2021-05-12 18:55:08] CPU #0: 1.97 kH/s
[2021-05-12 18:55:08] CPU #3: 2.02 kH/s
[2021-05-12 18:55:29] scrypt block 12930525, diff 3140923089.510
[2021-05-12 18:55:29] CPU #0: 1.96 kH/s
[2021-05-12 18:55:29] CPU #3: 1.92 kH/s
[2021-05-12 18:55:29] CPU #2: 1.91 kH/s
[2021-05-12 18:55:29] CPU #1: 1.93 kH/s
[2021-05-12 18:55:47] scrypt block 687629, diff 489012592559.943
but if you want to close the shell so it keeps mining (saying you are SSH'ed in), then use nohup
$ nohup ./cpuminer -a qubit -o stratum+tcp://prohashing.com:3348 -u idjohnson -p a=qubit,c=digibyte,n=pi33,m=solo,d=8 &
You can use the Worker Configurator to tweak settings
I should point out that a lot of pools out there use "username"."pool" and different URLs for methods. Prohashing actually uses your password to denote what to send you and how you get paid. So between testing, all i really changed with the stratum port and the password -p
Prohashing payouts really revolve around 3 modes. From their page
Full-Pay-Per_Share (FPPS) (default)
In Full-Pay-Per-Share mode, miners are credited a set amount of money for every share, regardless of whether a block is found or not. Full-Pay-Per-Share mode is the simplest mode and results in exactly constant earnings, which will only vary according to the prices per coin. In this mode, Prohashing profits or loses depending upon the luck of your miner, and your get paid regardless of whether the pool is lucky or not.
While Full-Pay-Per-Share mode has the highest fees, it also allows for automatic coin switching, which usually results in higher earnings for the customer by automatically switching to the most profitable coin.
Pay-Per-Last-N-Shares (PPLNS) (m=pplns)
In Pay-Per-Last-N-Shares mode, miners are credited money when they or another miner at the pool finds a block. The money earned by finding the block is divided among all the miners who contributed to finding that block. Over the long term, Pay-Per-Last-N-Shares mining will result in the same number of blocks being found as are found in Full-Pay-Per-Shares mining. However, because customers aren't paid until a block is found, Prohashing does not need to retain a reserve and therefore offers lower rates. Profits will vary from day to day, depending on whether the pool is lucky or unlucky in finding blocks. Sometimes, you will earn profit long after you mine, if other miners find a block and you contributed in that round of mining.
Pay-Per-Last-N-Shares mining has lower fees than Full-Pay-Per-Share mining, but it also doesn't allow for dynamic mining, which involves coin switching. Pay-Per-Last-N-Shares mining is especially useful for owners of mining rigs that have very high work restart times. These miners do not respond to coin switching as well as other miners do. Such miners can mine in Pay-Per-Last-N-Shares mode and save money in fees, provided they are willing to accept higher variance.
In Pay-Per-Last-N-Shares mining, you mine a single coin and are paid in the same coin. As with solo mining, merge mining is paid per share and you will accumulate small amounts of earnings even when no blocks are being found by any miner. Unlike solo mining, you receive smaller amounts of money every time another miner founds a block.
Solo (m=solo)
In solo mining mode, money is earned when you find a block, and the block finding of other miners doesn't affect you. Solo mining mode provides the highest variance, but is a great way to play the lottery if you want to try to strike it rich by mining a very valuable block, like a block of bitcoins or litecoins.
When blocks are found by a solo worker, the account is credited with 98.01% of the entire value (block reward + transaction fees) for the found block. Merge-mined blocks in solo mode are still paid per share whether you find a solo block or not. In solo mode, customers will notice that they are continually receiving small amounts of earnings in the primary coin even when they haven't yet found find any blocks of the target coin. This is due to others finding merge-mined blocks. Solo mode provides a simple way to set up miners to support a particular coin network and solo mine without having to install and connect a coin daemon, or go through complex pool setup yourself. Solo mode also provides greater profit than does setting up a single-coin pool because miners also receive bonuses from coins that were merge-mined. When using "solo" mode, payout proportions are ignored for this worker and all earnings are paid in the target coin.
Merge mining usually earns about 5-10% of primary coin mining, so using solo or PPLNS mode at Prohashing will average about 110% of earnings expected with a single-coin pool.
Profits for the primary coin in solo and PPLNS mining for found blocks are not credited until the blocks are confirmed. Some networks require as long as 720 blocks for confirmation, so confirmation time can range between 5 minutes and 3 days. Because solo and PPLNS mining pass on some variance to miners, orphaned blocks are not credited to earnings. The "c=" parameter must be present to use "m=solo" or "m=pplns." If c= is not present or if the specified coin does not exist, then this argument will be ignored. If the target coin is not enabled for payouts or is in error, the worker will be disconnected so that it can fail over to a backup pool. Pool fees for "solo" and "pplns" modes are lower because the variance is passed onto the miner, and because fewer transaction fees, exchange fees, and other business expenses are incurred.
I've been using the FPPS model, let's switch on one of the Pis.
For instance, let's use low memory mining and switch to solo. It might never find anything or it might find something and we make real money
Key to note is the port (3348) and the password a=qubit,c=digibyte,n=pi31,m=solo,d=8
Changing the run
We can log into one of the pi's and find the last run
pi@retropie:~ $ ps -ef | grep cpuminer
pi 6578 1 99 May12 ? 2-00:16:54 ./cpuminer -a scrypt -o stratum+tcp://prohashing.com:3335 -u idjohnson -p x
pi 7350 7266 0 11:22 pts/0 00:00:00 grep --color=auto cpuminer
Now kill that process
pi@retropie:~/Workspaces/cpuminer-multi $ ps -ef | grep cpuminer
pi 6578 1 99 May12 ? 2-00:56:54 ./cpuminer -a scrypt -o stratum+tcp://prohashing.com:3335 -u idjohnson -p x
pi 7371 7266 0 11:32 pts/0 00:00:00 grep --color=auto cpuminer
pi@retropie:~/Workspaces/cpuminer-multi $ kill 6578
pi@retropie:~/Workspaces/cpuminer-multi $ kill 6578
-bash: kill: (6578) - No such process
pi@retropie:~/Workspaces/cpuminer-multi $ ps -ef | grep cpuminer
pi 7375 7266 0 11:32 pts/0 00:00:00 grep --color=auto cpuminer
Now launch for solo mining
pi@retropie:~/Workspaces/cpuminer-multi $ nohup ./cpuminer -a qubit -o stratum+tcp://prohashing.com:3348 -u idjohnson -p a=qubit,c=digibyte,n=pi32,m=solo,d=8 &
[1] 7376
nohup: ignoring input and appending output to 'nohup.out'
We can refresh and see it's switched in the window
We could directly mine to Coinbase, but then we need to setup hashing settings which are beyond this tutorial.
Findings
The low rate of return on small equipment means a very low share in the pool. I tracked my XLM balance over a day and it increased by 0.00147247 in a 12h period. Thats 0.00294494 a day. It would take a full year of computing at this scale to return to me a $1.
Seems hardly worth it
It seems from guides like this one https://stllug.sluug.org/presentations/Mining_Crypto_on_the_Pi.pdf that using a distro just meant for mining, like minera might do better.
Saying you even found a decent guide to follow to add GPUs to a Pi4, you're still spending nearly $70 a card (and an older one at that). You can build a cluster without GPUs just for CPU mining. There are guides showing a Pi using USB miners. But today, they are radically overpriced ($250 used). I saw notes it could run 333MH/s which in pool prices might render $0.0001/day so its really no longer viable (after about 2013).
Let's be honest, to get into mining, we can't be thinking about Ks or Ms per second.. we need to be in the TH/s range which brings us to custom hardware.
We could get a 12 GPU Nvidia rig (saying they were in stock) for about $1400.
Getting an ASIC miner (custom built CPU mining instead of GPU) will really set us back. We _might_ get something decent under $1000 but it could be broken/used junk.
So what do we do?
Summary
Unless you have access to cheap power and a lot of free capital to get started, mining for coins is likely out of your hands today. You can CPU mine on unused Pis for just something to give them to work on. However, it doesn't mean you can't "get into the game".
With the radical price fluctuations, buying into a currency can be just as profitable. Say you setup Coinbase for instance, you can guy some currency (they supposedly give you $5 for signing up, but I have yet to see that).
You can also buy some crypto using Paypal now as well
However, as you can see from above. Coins dropped over 10% just overnight. So gambling on Cryptocurrency is just that, gambling.
The same advice for going to a casino should apply. Don't spend what you are not able to entirely lose.