Cryptomining with Litecoin

Traveling Lite

© Photo by Lucija Ros on Unsplash

© Photo by Lucija Ros on Unsplash

Article from Issue 285/2024
Author(s):

Although not as popular as headliners like Bitcoin and Ethereum, Litecoin is one of the oldest cryptocurrencies, and it offers some useful features, such as dual-mining with Dogecoin.

After the big bang of the cryptocurrency revolution, the universe of alternative coins began with the launch of the Litecoin project. Litecoin (LTC) was created in 2011 by Charlie Lee [1], a software engineer working at Coinbase, who was able to fork the code behind Bitcoin (BTC). LTC is a decentralized, peer-to-peer virtual currency that borrows from the same proof-of-stake blockchain verification underlying Bitcoin. But instead of using Bitcoin's SHA-256d algorithm, LTC adopted the scrypt [2] algorithm, which offers additional support for the use of GPUs in the mining process. The scrypt algorithm also makes it costly to perform hardware attacks on the encryption by requiring large amounts of memory.

The day of its launch saw LTC priced at about $0.30. Over the course of the past decade, its pricing has gone from around $40 to $410. During 2023, LTC fell anywhere between $60 and $100, and the price was at about $90 at the time of this article. The United States Commodity Futures Trading Commission (USCFTC) recently declared LTC a commodity [3], which is a giant step along the path of legitimacy and acceptance [4].

Choose Your Pool

Although it is possible to mine LTC solo or through a cloud service, the best option to get started is through pool mining. A mining pool is a super-computing cloud generated by multiple (up to thousands) of single registered users joining forces by combining all of their resources into one so that they can mine blocks together while receiving payment based on the amount of work they accomplish. In this scenario, any single working computer host is referred to as a miner and also needs to be registered on a mining pool. When miners cash out their balance, they will be charged a fee, which ranges generally from 2 to 5 percent, depending on the pool and cryptocurrency. My preferred pool for mining LTC is litecoinpool.org, which charges a 2 percent nominal fee [5]. Litecoinpool.org suggests that users withdraw unpaid balances starting at 0.01 LTC, although the minimum withdrawal is 0.002.

Type of Nodes and Wallets

At the most basic, a node is a connection in a network looking either to act as a redistribution point or as an end point. After your system has finished downloading the whole blockchain, it becomes a "full node" that is capable of relaying all of the blockchain blocks and transactions. The bottleneck will be the amount of inbound connections. If you want to graduate to the "super node" level, you'll need to open up port TCP/9333 on your router, and by that point, your system is considered as a listening node.

A listening node (or super node) acts as a relay station on the LTC network, and a couple of dozen other nodes will connect to it to complete its block history alongside transactional data. This traffic will mean about 100MB of extra data daily. Because super nodes are the backbone of the LTC network, they should be up 24/7.

Regardless of what type of node you are running, you need to understand you are helping the cryptocurrency by validating blockchain transactions. Running a full node requires three things: a local copy of the blockchain, a wallet, and mining softwares. The blockchain is the central requirement for any system to act as an active node on the LTC network. When the LTC daemon is launched, the first thing it will attempt to do is read a fully synchronized blockchain under ~/.litecoin/ and, if none is found, it will immediately start downloading all 100GB of the blockchain without further ado.

Wallets come in two forms: cold and hot. A cold wallet works offline and can be defined as a hardware or paper wallet acting, sort of, like a safe. You cannot do immediate transactions with the content but you know that, when the time comes, you can start the motion of bringing money home. Hot wallets, on the other hand, are in direct contact with a blockchain via an Internet connection. You can open up a hot wallet and take your money to spend it immediately. This article uses the software hot wallet bundled in with the LTC daemon inside the litecoin-qt binary from the Litecoin core tarball [6].

It's Show Time!

The last step in the full node recipe is the mining software. But before unpacking and configuring the software, remember that LTC has been around for a long time and has a somewhat geriatric approach. It might be wise not to install the latest LTS but perhaps one or two behind. I ran onto several issues with make, as well as challenges linking to particular libraries. I would also suggest that you strongly consider that, once working, you freeze the configurations you put in place and just apply security patches.

If you are thinking about mining, I trust that you have considered the demands of the mining environments. Considerations include physical space, electricity consumption, noise cancellation, dust filtering, and system availability. If you are determined to move ahead, download and decompress the latest Litecoin core archive, as shown in Listing 1.

Listing 1

Getting the Litecoin Core

$ wget https://download.litecoin.org/litecoin-0.21.2.2/linux/litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz
--2024-03-20 20:09:29--  https://download.litecoin.org/litecoin-0.21.2.2/linux/litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz
Resolving download.litecoin.org (download.litecoin.org)... 104.26.14.119, 172.67.68.21, 104.26.15.119
Connecting to download.litecoin.org (download.litecoin.org)|104.26.14.119|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 36676615 (35M) [application/octet-stream]
Saving to: 'litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz'
litecoin-0.21.2.2-x86_64-l 100%[====================>]  34.98M  96.1MB/s   in 0.4s
2024-03-20 20:09:29 (96.1 MB/s) - 'litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz' saved [36676615/36676615]
$ tar zxvf litecoin-0.21.2.2-x86_64-linux-gnu.tar.gz
litecoin-0.21.2.2/
litecoin-0.21.2.2/bin/
litecoin-0.21.2.2/bin/litecoin-cli
litecoin-0.21.2.2/bin/litecoind
litecoin-0.21.2.2/bin/litecoin-qt
litecoin-0.21.2.2/bin/litecoin-tx
litecoin-0.21.2.2/bin/litecoin-wallet
litecoin-0.21.2.2/bin/test_litecoin
litecoin-0.21.2.2/README.md
litecoin-0.21.2.2/share/
litecoin-0.21.2.2/share/man/
litecoin-0.21.2.2/share/man/man1/
litecoin-0.21.2.2/share/man/man1/litecoin-cli.1
litecoin-0.21.2.2/share/man/man1/litecoind.1
litecoin-0.21.2.2/share/man/man1/litecoin-qt.1
litecoin-0.21.2.2/share/man/man1/litecoin-tx.1
litecoin-0.21.2.2/share/man/man1/litecoin-wallet.1
$ cd litecoin-0.21.2.2
$ ls
bin  README.md  share
$ ls bin
litecoin-cli  litecoind  litecoin-qt  litecoin-tx  litecoin-wallet  test_litecoin
$ du . -chs
99M     .
99M     total
$

For the node to fully sync with the LTC blockchain, you need to download all 150GBs of it. To make this happen, launch litecoin-qt from the bin/ directory. This in turn will prompt you to select where to store all of this data. After many hours, and once the download completes successfully, the local instance will be located under blocks/ of .litecoin/ and will weight in at well over 2,000 files (Figure 1).

Figure 1: LTC blockchain in storage.

Buy this article as PDF

Express-Checkout as PDF
Price $2.95
(incl. VAT)

Buy Linux Magazine

SINGLE ISSUES
 
SUBSCRIPTIONS
 
TABLET & SMARTPHONE APPS
Get it on Google Play

US / Canada

Get it on Google Play

UK / Australia

Related content

  • Mining Monero

    The Monero cryptocurrency lets you get in the game without spending thousands on hardware. We'll show you how.

  • Trojan Turns Raspberry Pi into a Cryptocurrency Mining Device

    Two trojans in the wild are targeting Linux machines.

  • The Impact of Crypto Mining

    With climate change wreaking havoc across the planet, we were just beginning to think about how we could use our technology to conserve fuel and reduce our carbon footprint. Then along came crypto mining.

  • Ethereum and Smart Contracts

    The Ethereum cryptocurrency system lets you build programs into the blockchain to orchestrate complex transactions and document results. We'll show you how to get started with Ethereum's smart contracts.

  • Welcome

    Is blockchain finally getting interesting? I guess it always has attracted some attention – if not as an investment at least as a generator of headlines.

comments powered by Disqus
Subscribe to our Linux Newsletters
Find Linux and Open Source Jobs
Subscribe to our ADMIN Newsletters

Support Our Work

Linux Magazine content is made possible with support from readers like you. Please consider contributing when you’ve found an article to be beneficial.

Learn More

News