A Deep Dive into Mochimo — Part IX: Headless Mining — Bite a Miner’s Head Off

Ortis
Mochimo Official
Published in
3 min readDec 17, 2019

This is the ninth part of a series of articles about the Mochimo blockchain, a 100% original, no-ICO, no-presale crypto currency project.
Follow us on Twitter, Discord, Reddit

If you haven’t already, read our previous article A Deep Dive into Mochimo — Part VIII: Anti Bloat Protection — A Sanctuary for the Ledger

Node vs Miner

There is a tendency to use the term “node” and “miner” as if they were the same. Spoiler: they are not. A node can run without mining blocks and a miner can (or at least should be able to) run without a node.

The most common implementation of mining without running a dedicated node is pool mining: a centralized entity provides the networking module and splits the rewards among participants for a fee. This is quite convenient for miners who do not want to deal with the process of installing a full node, which can be tedious. Pools allow users to bypass: complex configuration, local network limitations, bandwidth consumption, security risks, etc.

Pool mining is sometimes the only viable solution for miners with multiple rigs, since most of the mining nodes need a dedicated public IP address in order to properly receive updates from the network.

The Mochimo protocol offers a convenient solution for every miners who wants to avoid running a node: the OP_GET_CBLOCK request.

The Candidate Block & The Legend of the Headless Miner

In order to mine without a node, we use a “headless miner”: a mining program with a minimal networking module that does not require any synchronization of the blockchain and can work through most firewalls and routers without any configuration.

Upon starting, the headless miner sends an OP_GET_CBLOCK request to a full node in order to get the current candidate block. A candidate block is the block on which the cryptographic puzzle (in Mochimo’s case, a haiku) hasn’t been solved yet and simply contains pending transactions. That is all that is needed to mine the block.

The miner starts solving the puzzle and checks on a regular basis whether new candidate block is available. If and when the miner solves the block, it pushes the solved block back to the full node, which will in turn send an OP_FOUND notification to its peers, thus propagating the solve into the network as if it had been solved by a regular node.

The headless miner is available on the Github repository.

Ortis.

Edited by Kashmyr

About the author: I am a contributor to the Mochimo project and a founder of the mining pool illamanudi.
Twitter, GitHub

--

--