Mine Hard: A Masari Christmas with Thaer Khawaja

Gigamesh
14 min readJun 26, 2021

This article was originally published on The Daily Chain, 7th January 2020.

“Masari is a fork of Monero with a focus on scaling. Masari fans can expect ongoing development of the Blocktree and SPT protocols in 2020.”

Thaer Khawaja, Founder of Masari, December 2019

This is a community funded article. To learn more see here.

This article was sponsored using the Masari Funding System and community donations. It is the first time the Masari community have funded a written article.

Business Class

Thaer Khawaja is well-groomed, often wears a suit, and flies on regular business trips.

“You want to know the secret to surviving air travel? After you get where you’re going, take off your shoes and your socks then walk around on the rug bare foot and make fists with your toes.” — Opening dialogue of Die Hard (1988)

En route to Nakamoto Plaza

Thaer might have replied to a passenger sitting next to him if they’d quoted these legendary lines from the opening of Die Hard. Yet unlike John McClane, our protagonist is accustomed to flying. In fact Thaer is fast asleep and no stranger to the secrets of air travel.

It’s been a wild ride so far for the Canadian and I’m no longer talking about air travel. Since launching his own coin two years ago he has witnessed the bull run and the bear market, and has seen his once little project gain widespread acclaim in recognition of his work. This time last year he was full-time on the project but due to the ruin of altcoin valuations these last twelve months he has had to press his suit once more.

“That’s correct, since the beginning of the year I’ve been working on the Serve robot delivery platform at Postmates, and the product is currently being launched — you can see these little guys in LA currently,” Thaer later explained.

Thaer disembarks the plane with loosened necktie resting under the opened top button of his shirt. Despite appearances Thaer is a cryptocurrency developer albeit a self-effacing one, and his clever eyes scan the notifications on his phone as he waits for his luggage. He is reminded that he agreed to answer some questions for an interview about the coin he started. Thankfully after the flight he is well-rested.

This is the story of how Thaer Khawaja became a cryptocurrency developer.

Artwork by Johnny Gonzo

Introduction

In this short introduction I will present three surprising facts that you may not have known.

It is more expensive in dollars to send a Monero transaction than a Bitcoin transaction. This is the first.

Monero transactions are roughly ten times larger than those in Bitcoin. The second.

“Masari is a fork of Monero with a focus on scaling”, says Thaer in an interview recorded two months ago. He is the founder of Masari, and has been for two years.

Thaer has many ideas and has written several papers largely concerned with scaling. To implement his work he created Masari (named after the Arabic word for money). Without having to wait for the consensus and approval required when coding for another project, Masari is nimbler and more agile than its famous progenitor Monero.

Masari’s development has not gone unnoticed in crypto. The once little project has been forked and given birth to many of its own offspring. And this is the third surprising fact.

Image and data from ForkMaps

A beautifully detailed and thorough review of Masari already exists thanks to a Medium article written by Crypto Penguin. It has helped guide this article about Masari and I strongly recommend anybody wishing to dive deeper to give it a read. Borrowed from it is the following screenshot explaining Thaer’s reasons for starting Masari.

Tech Overview

Before we get to the interview it may help some readers to provide context for the technologies covered in the interview. Remember that many of these technologies emerged in response to what Monero was lacking.

SECOR and Uncle Mining

Masari was the first cryptonote coin to introduce Uncle Mining, first inspired by Ethereum. Traditionally when two miners submit a block at similar times one miner profits while the other receives no reward. With uncle mining both miners are rewarded. This improves profitability for solo miners and small pools, promotes decentralization, and secures the chain by adding the orphan blocks to the weight of the blockchain. Masari introduced Uncle Mining in its SECOR protocol upgrade of January 2019.

Difficulty Adjustment

When Masari launched in September 2017 it used Monero’s mining algorithm and difficulty adjustment. Using the same algorithm as a big coin like Monero is very dangerous for small proof-of-work (PoW) coins because of 51% attacks. Consequently many of them, like Masari, use variants.

Another problem for smaller PoW coins is Flash Mining. When a big miner starts mining a coin with a low hashrate they quickly mine many blocks and in the process increase the difficulty. Once the difficulty rises and the block production starts slowing the big miner leaves. On their departure the difficulty is so high that none of the remaining miners can find any blocks for long periods of time until the difficulty adjusts. To improve difficulty adjustment Masari was the first coin to implement LWMA (originally called WWHM).

From the Masari website:

The original idea for this algorithm comes from Tom Harold and was modified by Scott Roberts. The original C++ implementation was done by Thaer Khawaja of the Masari Core Team. This implementation has since been adopted by several other cryptocurrency projects, and has paved the way for other difficulty adjustment algorithms such as LWMA.

Scott Roberts (zawy12), who is a VIP in Masari’s discord, documents the development of these difficulty adjustments in a document called LWMA’s history.

The Stampede for LWMA
After Masari rapidly forked to be the first to implement LWMA in early December 2017, there was a stampede to get it to stop new catastrophic attacks that were occurring from Nicehash if not ASICs that people were not yet aware of. Zawy v1 was no longer sufficient protection as the oscillations all day were bad. Bigger coins on the default CN algo were beginning to find it as unacceptable as the smaller coins always had. Now (5 months later) there are over 30 coins who have implemented LWMA or are about to. About 1 coin per 3 days is getting it.

Roberts’ document also chronicles what is best described as the harrowing journey to find a good solution to difficulty adjustment. There were many casualties along the way but Masari is not among them. The chronicles serve as a reminder that solutions to the problems of PoW mining are not easy and that miners will pounce on mistakes made. I cherry-picked two excerpts from the many I could have chosen from LWMA’s history to demonstrate the complexities of these problems.

Sometimes coin developer’s fail:

I started telling LWMA coins to lower their FTL and shortly thereafter the first attacks using bad timestamps on coins who had not changed the FTL began. They all had to fork ASAP to correct it. Some have not. Coins copying others’ LWMA without changing their FTL is a continuing threat.

Sometimes the experienced make mistakes:

In September 2018 a > 50% selfish mine attack was performed on an LWMA that was able to lower difficulty and get 4800 blocks in 5 hours. It’s the result of an error I made in handling negative solvetimes that was present most of LWMAs. The attack used a method I seem to have discovered and publicized 60 days earlier, but I did not realize the attack applied to my own algorithm

Blocktree Sharding

Blocktree is a PoW “sharding” solution which increases transaction throughput by mining multiple blocks in parallel. The network will be split into multiple “branches” from the main chain, or “tree” automatically as required based on the current block size.

An Introduction to Masari, Masari, Medium, April 2018

Sharding is nothing new in computer science and database management. It refers to the process of splitting large chunks of data into smaller pieces (shards) and distributing them over the network to reduce overall workload. For blockchains sharding is all about scalability, reducing the workload of each node, and increasing limits on transactions per second.

Sharding is not explicitly a blockchain invention. The concept has been around, and implemented continually, as a method for horizontally partitioning databases.

What Could “Sharding” Mean For Enterprise Blockchain Adoption? , Yoav Vilner, Forbes June 2019

Masari has not yet implemented its Blocktree sharding solution, but neither have the competition implemented their own solutions. Ethereum carries the brightest torch. Masari is the only cryptonote coin to carry any torch at all.

Sharding blockchains is an area still under heavy active research and is an esoteric field at the edge of distributed computing. Ethereum researchers and other blockchain projects are pursuing its potential rewards, nonetheless.

“Despite lofty promises, creating a decentralized, secure and scalable public blockchain has proved to be a strenuous task,” says Beniamin Mincu, CEO of Elrond.

What Could “Sharding” Mean For Enterprise Blockchain Adoption? , Yoav Vilner, Forbes June 2019

Simple Privacy Token (SPT)

As yet unimplemented but on the 2020 roadmap are Simple Privacy Tokens (SPT).

A very simple network-native token service that allows the normal end user to create a token, and they can do with it as they wish and it would be void of any on-chain smart contract stuff (i.e. all of that would be off-chain with multisig) to keep the network as secure, simple, scalable and single-purpose as possible.

As with Blocktree Sharding, SPT would represent another first for Masari and CryptoNote coins. Unlike Blocktree, no technical paper has been published.

The Interview

Thaer Khawaja

Who are you, what is your background in crypto and before crypto, and what is motivating your development of Masari?

I’m a software engineer by trade with background in Distributed Systems working with “big data”, and didn’t have any real background with crypto before Masari other than knowing and following the technology in that space. My initial motivation behind the development of Masari was to understand Monero’s underlying protocols, which evolved into a project that I wanted to improve things both within Monero and generally with scale as a focus, with Blocktree as the driving motivation on that front.

Masari distinguishes itself from other cryptonote coins in many ways, and has been responsible for much innovation in this space. Based on my research I have identified six key features that Masari has, or will, develop. Going through each of the six, could you please provide the readers with a summary of Masari’s achievements in each. The common theme for these features is scaling, do you agree?

Yes, most these are scalability oriented, others were mostly responses to network attacks by malicious adversaries.

1.Mining algorithm
The mining algorithm is mostly a variant of an older algorithm from Monero, a stop-gap to mitigate ASIC concerns at the time. There has been discussion on a new IO-bound algorithm that would greatly reduce compute requirements, but there hasn’t been much development on there past initial brainstorming. The idea behind this would be resistance to new hardware improvements where cache or memory scratchpads would no longer need to be constantly upsized, and without harming hardware availability.

2. Uncle mining

Excerpt from SECOR paper

We designed an uncle mining protocol named SECOR, devised for a coin such as Masari, and is a first in the privacy space. This is in mainnet, and the whitepaper can be found here.

3. Difficulty adjustment
We pioneered difficulty adjustment in the privacy space with implementation of the WWHM algorithm due to network attacks attempting to profit off an inefficient implementation we initially adopted as a fork of Monero. We’re currently using an LWMA implementation, which was a community based implementation that evolved from WWHM’s learnings (research is by zawy).

4. Blocktree Sharding
This is a scalability proposal for CryptoNote based coins such as Masari, where a standard chain can be partitioned into multiple subchains that are synchronized via Metablocks and other means defined in our whitepaper. An implementation of this would allow for simultaneous blocks to be mined in parallel, maintaining smaller blocks and overall consensus of the network at scale.

5. Real-time authorization
This is a thought initiative as an off-chain proposal for merchants, where a transaction can get an effective confidence score based on the probability of its acceptance into the network, taking advantage of pre-existing consensus rules in the network where duplicates of a given transaction are visible and rejected.

6. SPT (Simple Privacy Token)
This is a protocol proposal inspired by Ethereum, where an individual would be able to issue private tokens within the network and transact with them as they deem fit, without the complexity of smart contracts. These tokens would be used with either real contracts (such as tokens representing ownership of some asset) or off-chain contracts, leaving the consensus network to only be a ledger for these security tokens.

Let’s discuss the strength of anonymity. How strong is CryptoNote anonymity when subjected to sophisticated transaction linking techniques like dust attacks? Please discuss Masari’s uniform ring size, and any other plans Masari has for hardening CryptoNote anonymity.

Given enough resources, one would be able to “own” a percentage of the outputs used in a given transaction. However, linkability becomes exponentially more difficult as those transaction outputs are used. In our case, we were the first CryptoNote coin to have a static ring size to remove that factor as a traceability angle, meaning that people with otherwise abnormal ring size choices aren’t distinguishable from others on the network.

Is the term “ASIC-resistance” a fallacy, oxymoron or misnomer? Are ASIC’s inevitable, and so too a successful 51% against all smaller PoW coins? What are Masari’s plans to ensure long-term network security?

You could arguably describe ASIC-resistance with those words since given enough incentive there will be hardware that optimizes a given mining algorithm. Conversely however, with an inherently IO-bound algorithm that one is unable to optimize, could be ASIC-resistant in that sense because we would be binding resistance to innate hardware limitations (i.e. minimum physical distance of a CPU to RAM)

Overall, how successful do you feel Masari has been since its launch? What have been the highlights for you personally, and also disappointments?

I think Masari has been quite successful in what it has delivered, namely the difficulty algorithm improvements, SECOR, and other achievements. Its community I think also is in many ways the source of its success. In terms of disappointments, I would mostly look at myself as I failed to push the momentum that we had to the heights that Masari could have been as a community project, despite the financial and time allocation issues that I had in 2019.

How is Masari development currently funded? If you were able to secure funding once more would you go full-time on Masari again? How confident or hopeful are you this will happen, and what avenues are you exploring to achieve it?

There’s currently no funding past community proposals on https://funding.getmasari.org/. If I were to secure funding for at least one year, I would be able to go full-time on Masari without financial concerns from smaller-term funds. I haven’t been actively looking for this, but there have been recent avenues that we could explore.

Will Masari use Monero’s latest mining algorithm RandomX, or a RandomX variant?

Although we have no immediate need for it, it could be included as part of a larger protocol upgrade adopting features from our parent project.

What can Masari fans expect in 2020?

Masari fans can expect ongoing development of the Blocktree and SPT protocols in 2020.

Masari Roadmap

What are your plans for Christmas?

Mostly just get together and catch up with the family.

“Come out to the coast, we’ll get together, have a few laughs…”

Wrap Up

What do you want for Christmas? Some kind of pump probably, and I’m with you — that would be great.

While Masari fans probably wish the same, Christmas gifts come in many shapes and sizes. Despite the demonstrable value of difficulty adjustment and uncle mining, to some they are unfairly demoted to stocking-fillers. For others “beautiful things come wrapped in small packages.” I didn’t even mention the attractive desktop and mobile wallets.

Masari Android wallet

The biggest gifts for Masari and CryptoNote fans sit under Masari’s Christmas Blocktree, with simple private tokens reading From Thaer.

macOS Desktop Wallet

In this interview, concluded only hours before publication, Thaer Khawaja brings an early Christmas gift to the community by restating his commitment to Masari, one of the dark horses of cryptocurrency.

Masari fans can expect ongoing development of the Blocktree and SPT protocols in 2020.

Thaer Khawaja, 12 December 2019

What Thaer and the Masari team (who have been very good all year) deserve this Christmas is some funding to speed development. If rich Uncle Monero won’t provide as I think he should, it is still the season of giving and those who care for privacy should also care for Masari.

Merry Christmas Masari!

One More Thing

Shortly before publishing I contacted Zawy for comment on Masari. Zawy is well-known for working on difficulty algorithms and has spoken well of Masari and Thaer in the past. Today he had this to say:

Thaer is a good dev in a world of alt coins where there are a lot of crappy devs. My guess from the interactions I’ve had with him and a lot of other coins is that he could be the top dev in the upper 10% of coins. I am not much of a dev. I am a “dev” only when I am forced to be, like trying to perfect difficulty algorithm code. I am a lot better at math and traditional engineering. Thaer is one of the few who could intelligently converse with me and provide good feedback and was confident enough to smartly challenge my assertions. BTW, the code in Kimoto Gravity Well and Dark Gravity Wave are horrendous and these are 2 of the most popular algos. Even ETH’s difficulty algorithm was just hacked together by trial and error without any math support but just guestimating what a good algo would be.

zawy, December 12 2019

Thanks

  • Thanks to Thaer Khawaja, Founder of Masari
  • Thanks to camthegeek for helping coordinate the interview, and Zawy for his comment.
  • Thanks to all the members of the Masari Team for their hard work, and the community for its support.
  • Special thanks to Johnny Gonzo, for the inspirational artwork. In gratitude the least I can do is promote some of his awesome T-shirts.

--

--

Gigamesh

The Immutable Network (DARA), founder. Immutable builds free blockchain products and platforms to fight censorship and stop data loss. Also a journalist/writer.