Bitcoin

How to Mine Cryptocurrency with Raspberry Pi | Tom’s Hardware

With bitcoins trading at nearly $50,000 per bitcoin, maybe it’s finally time for me to get into the crypto game? instead of buying bitcoins could i use my raspberry pi to mine bitcoins?

what is cryptocurrency mining?

crypto mining is the digital version of gold mining, combining complicated calculations and pure luck (being the first to complete the calculation) with your computer. Mining is essential for cryptocurrencies in order to maintain their distributed ledger, also known as the blockchain.

Reading: Bitcoin mining with raspberry pi 3

While bitcoin is the most well-known form of cryptocurrency, it is not the only game available. All forms of cryptocurrencies use blockchains to keep each transaction valid and prevent someone from fraudulently spending your coins more than once.

is raspberry pi bitcoin mining profitable in 2020?

my initial research showed that mining bitcoins with any consumer computer is not profitable considering the cost of electricity and hardware. Most bitcoin mining is now done on asic bitcoin miners; Hobbyists and individuals may find limited success joining a mining pool, harnessing the power of a distributed pool of computers. what if we join a mining pool, use solar panels to power our pi, and “write off” the cost of our hardware? bitcoin mining is an extremely competitive venture with many other miners, increasing difficulty levels, and lower rewards for miners.

Despite this gloomy and downbeat news, I decided to go ahead with this project and set my sights on alternative cryptocurrencies. As of this writing, there are over six thousand altcoins traded today.

mining pools

mining individual cryptocurrencies was out of the question as we are using a raspberry pi and not an asic bitcoin miner. I looked at various mining pool software groups that I could join; most had options for windows and macos; there were no mining pools with raspberry pi support. raspberry pi is not compatible with linux miner software due to its arm architecture. compatible linux mining software is based on the x86 processors found in typical pc’s.

Disclaimer: This article is presented as an educational opportunity to spark interest in learning more about blockchain and cryptocurrencies, and not necessarily to generate cryptocurrencies. the methods described in this article are hacks and are not officially supported. The easiest and fastest method is to download and install the free software associated with the mining pool of your choice on your PC.

what you will need for this project

  • raspberry pi 4 (opens in a new tab) or raspberry pi 3
  • 8gb (or larger) microsd card (see best raspberry pi microsd cards) with a fresh install of raspberry pi lite os or raspberry pi os with desktop.
  • power supply/keyboard/mouse/monitor/hdmi cable (for your raspberry pi)
  • optional (recommended): heatsinks Heat & Fan (Opens in a new tab) for Your Raspberry Pi (Opens in a new tab)
  • Optional: Solar Panel Power Bank with USB-C (Opens in a new tab)
  • Optional: Raspberry Pi Cluster Case with Heatsinks and Fans (Opens in a new tab)

This tutorial is based on terminal commands. If you are not familiar with terminal commands on your raspberry pi, we recommend that you first review 25+ linux commands raspberry pi users need to know

how to mine cryptocurrency on raspberry pi

We will start by creating our account with minergate, a cryptocurrency mining pool with 3.5 million users worldwide for bitcoin gold, zcash, ethereum, ethereum classic and monero. this tutorial is specific to mining monero as it was the only cryptocurrency I had any level of success with.

See also: How to Earn Interest on Crypto – Forbes Advisor

2. boot your raspberry pi. if you don’t already have a microsd card, check out our article on how to set up a raspberry pi for the first time or how to do a headless raspberry pi installation.

3. if you are using raspberry pi os with desktop, open a terminal or press ctrl-t. if you’re using raspberry pi lite, log in as you normally would.

4. once in your terminal, run the following updates and install the necessary dependencies:

5. Now, let’s compile the mining code with the following three commands. This step will take a couple of minutes on a raspberry pi 4.

6. After building and configuring our mining software on our Raspberry Pi, let’s start mining Monero! Enter the following terminal command to start the miner, replacing your_email with the email address you used to sign up for your minergate account.

You should see the mining software start and hopefully see some ‘accepted’ shares with ‘yes!’

7. we will verify your minergate dashboard by logging in at https://minergate.com/internal. you can do this in a chromium browser if you use the raspberry pi desktop or on your pc. scroll down your dashboard until you see monero. if everything works, your monero status will be indicated online. Congratulations! you are now mining for monero!

how to start raspberry pi crypto mining on boot

To automatically start our cryptocurrency miner at startup on our raspberry pi, we’ll use the crontab method.

if you didn’t configure crontab before, you will see the response “no crontab for pi, please select an editor”.

See also: Chart: How bitcoin prices move with Elon Musks tweets – Vox

1. type ‘1’ and press enter.

2. this will open a new crontab file, arrow down to the bottom of your crontab file and enter the command below, replacing your_email, with the email address you used when creating your minergate account

4. press ctrl-x and y to save your crontab.

5. now reboot your pi by typing ‘sudo reboot‘ in your terminal.

how much monero did i mine with raspberry pi?

My raspberry pi 4 computed 357 good actions in about 8 hours of run time. miners are rewarded for good deeds. bad shares are calculations where I hit the correct answer, but my pi produced the results more slowly than another computer. miners only get paid when they submit the correct answer first. invalid actions are the worst, as the miner is penalized for each invalid action due to possible fraudulent activity. I was a bit worried when my first 4 actions were marked as invalid actions.

357 good deeds = 0.000001410642 monero = 0.00015569 usd

I made the equivalent of 1/100 of a penny in 8 hours.

In order to withdraw my monero, I needed a minimum of 0.05 monero, approximately equal to $5,811 usd. (exchange rate at the time of writing this article). at a rate of accumulating 0.000001410642 monero per 8 hours, it would take me 3.762 years to reach the minimum withdrawal threshold of 0.05 monero.

lessons learned about raspberry pi crypto mining

As stated at the beginning of this article, the purpose of this exercise was to learn about cryptocurrencies and not to make a profit.

See also: What is Bitcoin? A Beginner&039s Guide | NextAdvisor with TIME

  • Cryptocurrency mining rewards are calculated by shares and hash rates. my hash rate ranged from 1.6h/s to 33.3h/s. the average hash rate for the pool was 10.27 mh/s, about 3 million times the hash rate of my pi. For reference, 1 mh/s is 1,000,000 hashes per second.
  • The mining company (in this case, minergate), also charges a small fee for your transactions. you have the option of a luck-based fee (higher risk, higher reward) or pay-per-share (higher fee for minergate, but less risk).
  • At various points during the writing of this article, my pi had numerous ‘timeout’ and ‘send_line failed’ errors. sometimes a reboot of the pi helped, and sometimes the miner would eventually start working again without human intervention.
  • while the raspberry pi was not a ‘money maker‘ in the crypto mining game, the thrill factor of seeing my pi successfully calculate and accumulate good deeds was enough to me.
  • is there anything more productive i can do with my spare raspberry pi? if you are interested in donating your spare computing power to find potential treatments for covid-19, visit the grid world community. With the World Community Grid, you can download and install a software package on your raspberry pi that will run a simulation to help predict the effectiveness of a chemical as a possible treatment for covid-19. Check out our recent article on the World Community Network here.

Related Articles

Leave a Reply

Your email address will not be published.

Back to top button