One Musician’s Creative Solution to Drive ASICs Off Monero

11220817_10205521704534353_3129512367077335510_n-e1538151738705
29 September 2018

Algorithms are creative.

At least, that’s according to Howard Chu, a monero core developer who has dedicated his time to protecting the cryptocurrency from specialized mining hardware, called ASICs. Recently, Chu found a solution to permanently keep ASICs off the network – a proof-of-work algorithm he calls RandomJS, which exploits the fact that the hardware cannot so “multiple things at once.”

What’s perhaps most interesting about his algorithm, though, is that he might have only stumbled on the innovation because of his hobby of traditional Irish fiddle playing. From his hometown in Donegal, one of the most rural and musically rich corners of Ireland, Chu told CoinDesk the algorithm was created with the same imagination he draws on for his musical practice.

According to him, music and code are deeply connected at a neurological level, requiring both the logical and creative sides of the brain to function simultaneously. As a result, Chu said there’s a frequent overlap between programming and musical talent – one that he tapped into for the algorithm.

“Music is very mathematical, the basis of music is mathematical, but at the same time, there’s a creativity to it,” he told CoinDesk.

And with that, Chu created an algorithm that utilizes randomly generated code.

Because ASICs can only be designed to work toward one algorithm, using randomly generated code would make ASICs quickly incompatible, and as such, unprofitable. In this way, many developers think ASIC manufacturers would just steer clear of developing hardware for cryptocurrency projects that switch their algorithm frequently.

Driving this interest in ASIC-blocking code is mining giant Bitmain’s inroads into cryptocurrency communities outside bitcoin over the past year. More specifically for Chu, Bitmain released the Antminer X3 ASIC in March that was programmed to run monero’s underlying proof-of-work algorithm, cryptonight.

Shortly after monero developers sparked what has become known as crypto’s “war on miners,” by enacting an emergency software upgrade in April to change the cryptocurrency’s algorithm so that the Antminer X3 would be useless on the protocol.

Monero developers have since committed to regular software changes to remove any reemergent hardware.

But because of the risk that the small software changes monero has committed to may be insufficient to dissuade hardware manufacturers long term, Chu built RandomJS as a more sustainable solution for the cryptocurrency.

Speaking about the algorithm, Chu said:

“RandomJS is coming at the problem from a direction that nobody else is.”

Random math

A widely respected coder, Chu is senior architect of the OpenLDAP project, which created an open-source database layer that underlies much of the telecommunications industry.

And he’s been working on monero since 2015.

According to Chu, RandomJS is tied to his musical practice by virtue of its novel approach.

While ASIC hardware manufacturers analyze software and build optimized hardware to run for a particular algorithm, RandomJS takes the opposite approach, analyzing the functions of CPU hardware – the kind that underlies most consumer laptops – and building outward from there.

Chu described the challenge as striking a balance between two functions of a proof-of-work protocol – the time it takes to compute an algorithm and the speed of which it is verified.

For example, while SHA 256 (the proof-of-work algorithm that underlies bitcoin) is simple to verify, according to Chu, it’s fundamentally “too easy” to compute, meaning that it’s trivial to build hardware around it.

“The cryptographic hash is really great for proving something is authentic, but it’s horrible as a unit of work because it’s too easy,” Chu told CoinDesk. “It’s really simple to embed SHA 256 into a chip and clone thousands of these compute units.”

As such, RandomJS makes the compute process more complex, seeking to use CPU functionality in a more holistic way, by using blockchain data as the inputs to generate random code.

“We take an input, which is the previous block hash, and we use that as a seed for a pseudo-random number generator,” Chu explained.

This data then generates randomized algorithms written in javascript, which when run by the participating computers, are then hashed and added to the blockchain.

Still, the algorithm itself is being evaluated by the monero core team, and according to Chu, there’s a number of things that might delay its adoption. For one, it cannot currently function on the general purpose, or GPU, hardware that comprises the majority of monero’s mining infrastructure.

So there’s still quite a bit of work to be done.

A musical mind

With that said, Chu’s algorithm is perhaps one of the most unique, if not artistic, techniques for blocking ASICs.

Some might even say, with it’s always changing code, it’s a high-energy approach – one that fits why Chu, originally from Los Angeles, came to northwest Donegal in the first place.

He was led to the rugged coastline because of his passion for Irish traditional music.

But also in Donegal, he found the landscape reflected in the local music.

“Donegal fiddle style is fairly high energy, sharp and punctuated, and the first time I stood on Malin Head and looked at the coast and the waves crashing on the rocks, I was like, ah, this is that energy,” Chu told CoinDesk.

As such, Chu plans to set up a programming school in Donegal, where there’s also music instruction as part of the curriculum.

“That’ll give flexibility and training and a different way of thinking about things,” he said.

According to the developer, computer science education often trains students to think logically, which doesn’t prepare them for the real world that requires developers to creatively tackle new problems.

Speaking to his interest in melding music and programming, Chu concluded:

“You can’t do that without creativity, and if you haven’t been trained to use the creative part of your mind then you are going to struggle with that.”

Howard Chu photograph courtesy of Joseph Lopez