Hack #3: Mining Cryptocurrency (namely Monero Coin) Using Tails OS
Even with the bottleneck created by using the Tor network, I have found that Tails OS can mine various cryptocurrencies faster than other Linux distributions. This is probably because cryptocurrency mining does not require high Internet bandwidth; even slow Internet connections will do. The main constraint of mining cryptocurrency on Tails OS is the processing power of the computer. The smaller the operating system, the fewer resources the operating system uses, allowing more power to be devoted to actually hashing a mining algorithm.
Most cryptocurrencies can no longer be mined efficiently on computers. This is because the hashing rates required to competitively solve the hash algorithm are too high to compete with dedicated mining machines (called application-specific integrated circuits, or ASICs). To understand this requires a detailed discussion of how proof-of-work cryptocurrency algorithms operate, but the simplest explanation is that cryptocurrency networks (like Bitcoin) keep track of all transactions on a ledger. Unlike a bank ledger, which is kept in one place (the bank server), the Bitcoin ledger is copied to all nodes on the Bitcoin network. The ledger details what amount of Bitcoin is owned by which Bitcoin addresses. When Bitcoin is transferred from address to address in a transaction, the ledger is updated. Consensus is achieved because the ledger is stored on a blockchain based on a hash algorithm. A hash algorithm is a mathematical formula developed by cryptologists that takes an arbitrarily long input and transforms that input into a unique output of a fixed length (called a hash). Mining for Bitcoin requires verifying transactions as genuine by brute-force guessing inputs that will generate a "valid" output needed to add a transaction to the blockchain. Here, "valid" means that the output value satisfies the requirements set and adjusted automatically by the Bitcoin network. The Bitcoin network can make finding a valid output more or less difficult based on how many people are competing to find a valid value. As the computing resources available to the Bitcoin network steadily increase, the difficulty also increases, and thus the computing power required to find a valid value goes up in turn. The reward for finding a valid value is, of course, a Bitcoin payout from the network. The reward decreases over time.
<SIDE NOTE> Intuitively, one might worry that because an infinitely long input into the algorithm always results in the same length (finite) output, there must be multiple inputs that generate the same output. This is true and referred to as a "collision." However, in practice, the likelihood of finding a collision is vanishingly small. The number of possible outputs from the Bitcoin algorithm (SHA-256) is 2^256. How big is that number? The number of atoms in the observable universe is estimated to be between 10^78 and 10^82, which is several orders of magnitude smaller than 2^256. So while there are an infinite number of inputs and a finite number of outputs, the finiteness of the outputs is still far too large to deliberately create collisions. If you were able to deliberately produce collisions in the SHA-256 hashing algorithm, you would likely win the Turing Award as it would represent a monumental cryptographic breakthrough. </END SIDE NOTE>
There is an important exception to the oft-stated "rule" that you can no longer mine cryptocurrency on a computer. That exception is Monero Coin. Monero Coin can be mined on a computer because the hash algorithm, RandomX, is (1) optimized for computations that work better on computer CPUs, (2) relies heavily on RAM, which dedicated mining machines do not have in large supply, and (3) changes its internal computations constantly to evade ASIC manufacturers' attempts to create optimized hardware. Because Monero Coin can be mined fairly efficiently (provided your computer is relatively powerful), I decided to compare Tails OS to a standard Debian distribution for mining Monero Coin.
In my experience, Tails OS is slightly (2-3%) more efficient than a standard Debian distribution for mining Monero Coin. Coupled with the ease and speed with which Tails OS can be installed on a USB thumb drive, Tails OS can perhaps be justifiably used for Monero Coin mining operations. However, I suspect (but have not tested) that other lightweight Linux distributions might do just as well as Tails OS without consuming the precious resources of the Tor network.
Here is how I have mined Monero relatively efficiently in Tails OS using fairly powerful computers:
(1) Boot the computer into Tails OS and enable persistent storage and an administrative password. Connect to the Internet and configure a Tor connection like normal.
(2) Open the "Root Terminal" app (located in the "System Tools" tab of the Applications menu) and type and enter the following command:
(If you cannot view the text of the command below, you can download a PDF version of this guide here. The password to open the PDF file is "aboutwes.com").
(3) Wait for the proxychains to finish installing.
(4) Type and enter the following command:
(5) Type and enter the following command:
(6) A long string of text appears. Highlight all the text that appears below the previous command and above the prompter. Right click with your mouse and select "copy" to copy all that text.
(7) Open the Text Editor app and create a new text document. Paste all the text you copied from step 6. Save the file to your Persistent folder. This is a backup.
(8) Create a new text document in the Text Editor app. Paste the text again into the new text document. In most programming languages, the # mark indicates that the line of code is to be ignored by the compiler or interpreter. Notice the options that have a # mark before them. The hash mark means that the option following the # mark is disabled.
(9) Remove the # mark before "dynamic_chain"
(10) Add a # mark before "strict_chain"
(11) Add a # mark before "proxy_dns"
(12) Change "socks4" to "socks5" but leave everything else the same
(13) Highlight the entire document you've been working in. Right click and copy the text.
(14) Go back to the Root Terminal app and type and enter the following command:
(15) Right click and paste.
(16) Press control + D to exit the cat editor. Note that when you use the "cat >" command, you delete the contents of the file and are replacing those contents with new contents.
(17) I use a separate computer to download Xmrig, my preferred Monero Mining program. I then transfer the source code files to a USB thumb drive and copy the files to the Persistent folder on the Tails OS machine. You could download the files directly from GitHub, but it will be slow and might fail.
(18) If you download the Xmrig files on a separate computer and transfer them to Tails OS' Persistent folder via a USB thumb drive, you may have to fix the permissions for the Xmrig install files. In the Root Terminal, you can set permissions using these commands:
(19) You will need to install dependencies that the Xmrig program needs to run properly. Run these commands in the Root Terminal app:
(20) Run the following commands one after the other:
(21) Open the Text Editor app and paste the code below into the Text Editor app:
(22) Replace "xmr-us-west1.nanopool.org:1443" with the desired mining pool address. You could leave this just as it is too, but the pool I've provided might NOT be the most efficient where you're located in the world. The pool I've selected in the example is near Portland, Oregon.
(23) Replace "YOUR_MONERO_PUBLIC_WALLET_ADDRESS_GOES_HERE" with your public Monero wallet address. The EASIEST way to get a Monero wallet is by downloading the Exodus Wallet app, which is available for iOS and Android.
(24) Replace "ENTER_ARBITRARY_WORKER_NAME_HERE" with an arbitrary worker name, like "Miner1" or "Grumpy".
(25) After the slash, replace "ENTER_EMAIL@EMAIL.COM" with an email address. You could also just enter a random string of letters of numbers that is NOT an email address, but you should write down that string. The email address or random string is a password that will allow you to track the mining progress.
(26) Copy the edited text to the clipboard.
(27) Navigate to the Xmrig build folder with this command in the Terminal:
(28) Run this command:
(29) Paste the copied text from Step 26 (right-click and select "paste"). Press control + D to exit the cat editor.
(30) Run these commands one after the other:
(31) If you get an error after running the last command, that means you likely have secure boot enabled in the BIOS. That is fine, but Monero will not run as fast in that case. If you want to run Monero at its fastest, you need to disable secure boot in the BIOS.
(32) Close out of the Root Terminal app. Open the NORMAL, non-root Terminal.
(33) Run this command:
(34) Open the Text Editor app. Copy this command and paste the following command into the Text Editor app:
(35) Replace the URL and Port number with the desired mining pool that you chose when creating the JSON file. Replace "YOUR_MONERO_PUBLIC_WALLET_ADDRESS_GOES_HERE" with your public wallet address. Replace the worker name with the SAME worker name you selected in the JSON text above. Replace the email with the SAME email or private key you selected in the JSON text above.
(36) Copy the edited command from the Text Editor app and paste it into the Terminal and run the command.
(37) You may get a warning about the hash rate being low. This is false if you ran the randomx_boost.sh successfully. If you did not run that command successfully, then you have to decide for yourself if the risk of disabling secure boot in the BIOS is worth the reward of a higher hash rate.
(38) You can track mining progress on the pool website you selected. Certain pools allow you to adjust the payout threshold (how much you have to have earned before they payout), but you will need the email or random string to adjust those parameters.
KEEP READING -> : The End of Our Dark Net Safari; Tech Philosophy
DID YOU FIND THIS HELPFUL? Please consider donating:
この記事が役に立ちましたか? ぜひ寄付をご検討ください:
Bitcoin (BTC):
Bitcoin Cash (BCH):
Monero Coin (XMR):
Bitcoin SV (BSV):
Litecoin (LTC):
Dogecoin (DOGE):