Categories
Feature Story

The Quest for Decentralized Proof-of-Work

In this article, we will look at the some of the goals of the TurtleCoin project, the concept of centralization, where the project stands, and what the project is doing to remain true to itself by maintaining its commitment to the community.

TurtleCoin Core Goals

Fun, Fast, and Easy

For those of you that have been to the TurtleCoin website, the goals below may seem repetitive. For those of you that do not know, TurtleCoin was born with a few goals in mind:

  1. Fast Transactions
  2. Privacy
  3. Easy to Use
  4. Easy to Mine
  5. Community
  6. Support

The community is reminded of these goals every time they interact with the network, participate in discussions, and help spread TurtleCoin around the globe. These core values drive everything that is done within the community from core development, documentation generation, learning opportunities, support, and community project management. We take these goals very seriously and will do whatever we can to make sure that TurtleCoin remains true to the initial vision.

Decentralization of Mining Resources

What is Decentralization?

Decentralization is, to put it plainly, the process by which planning, and decision making are shifted away from a central authority or group. The process can take many forms but in our case in the context of a Proof of Work (PoW), it means that no central authority or group controls most of the resources needed to complete the PoW.

Why Care About Decentralization?

When most of the necessary resources to satisfy the PoW requirements end up centralized, those that control those resources can, when motivated to do so, take control of the network away from the community. Such control can manifest itself in ways such as:

  • 51% attack where history can be rewritten which then typically results in the double-spending of currency that is made possible by off chain account balance tracking performed in traditional databases
  • Selfish Mining where miners remain ahead of the public chain and release just enough blocks to stay ahead of everyone else thereby reaping the majority of block rewards

Each of the above attack vectors result in a network that is no longer “Fun, Fast, and Easy”. These attacks are, in the eyes of many, fraud and in the very least theft. No one wants to use a network where their funds are constantly at risk.

In addition to the above sampling of on-chain attacks, centralization of mining resources also poses additional problems when those resources are controlled within, produced by, or otherwise restricted by one or two entities.

Where Does PoW Centralization Come From?

The most common forms of PoW centralization come from technologies designed to make PoW calculations more efficient, including:

ASICs and FPGAs are, to be fair, technologies that help secure PoW networks by increasing the overall hashrate of the network while drastically reducing the resources (electricity, physical space, management, monitoring, etc.) to do so. By increasing the efficiency of mining, others are encouraged to participate in the mining process. The more distributed hashrate a PoW network has, the harder it is to attack via the methods described above.

Supply Chain Centralization

Unfortunately, both ASICs and FPGAs are largely the product of a handful of special interest groups and organizations that create high barriers to entry and generally avoid transparency and accountability. This presents a problem in that a project that embraces these technologies today relies on just a few manufacturers to create the specialized ASICs and FPGAs needed to secure their blockchain.

While this may not sound like that big of a deal, all we have to do is think back to the countless instances in history where one group controlled the supply of a product or service.

Such centralization of manufacturing also presents a problem in that the production of ASICs and FPGAs for mining now falls under a limited number of jurisdictions. Governments could, and have, changed the legality of producing, owning, or operating such hardware on a moment’s notice. The fact that a single entity could control the hardware necessary for operating the network is in direct opposition of the goals of decentralization.

To prevent centralization of the manufacturing of the hardware there must be a multitude of manufacturers spread all over the globe. Only then is it possible to reduce the risk of a single group impacting the supply chain of ASICs and FPGAs.

Note: CPUs suffer from some of the same issues mentioned above; however, CPUs are general purpose integrated circuits that are commercially available in large quantities at affordable prices and their manufacturers are not solely focused on cryptocurrency mining activities.

TurtleCoin’s Commitment to Decentralization

The TurtleCoin community and core development team remains committed to the stance that TurtleCoin must be easy for all to mine, fair, open, and most importantly decentralized. We’ve posted numerous articles, videos, and GitHub threads reaffirming this commitment since the inception of the project. Notable examples of such include:

While others may deviate and split from their goals of decentralization, the TurtleCoin community remains fully committed to the vision that a decentralized PoW remains our best chance at long-term sustainability.

Upcoming Proof-of-Work Algorithm Change

The upgrade to CN Turtle at block 1,200,000 was a success; however, as mentioned in the Proof-of-Work Algorithm Change, we’ve had another algorithm change on the burner well before that upgrade. We always knew that CN Turtle would be a temporary step meant only to give us a bit of breathing room to test, what we hope to be, a PoW algorithm that will prevail in our quest for decentralization for longer than prior algorithms have allowed.

We have mentioned codename Chukwa in a few different places over the last few months. If you have not been following discussions in Discord or taken at look at the GitHub Chukwa Hashing Results thread, Chukwa is actually Argon2.

What is Argon2?

Argon2 is the memory hard winner of the 2015 Password Hashing Competition (PHC). Argon2 comes in three different versions; each with their own design goals.

  • Argon2d is designed to maximize resistance against GPU cracking attacks and accesses memory in a data dependent order. This means that the input data itself defines how the memory is accessed; however, it is susceptible to side-channel attacks
  • Argon2i is designed to minimize side-channel attacks and accesses memory in a data independent order
  • Argon2id is a hybrid between the two where Argon2i is used for the first pass over the memory and Argon2d is used for each pass after that

The Argon2 IETF RFC draft recommends the use of Argon2id.

Why Argon2?

Argon2 was selected for the following reasons (in no particular order):

  • Winner of the PHC that follows the same kind of processes as the NIST’s AES & SHA-3 competitions
  • Memory hard algorithm
  • Source code is GPL-3.0 compatible
  • Easily integrated into the core code, pools, etc
  • Only one known cryptocurrency project (Aquachain) uses Argon2id

Argon2 is also relatively unique in that it allows for a high-level of customisation in how the hashes are calculated including parameters such as:

  • The number of threads to use (parallelism)
  • Arbitrary resultant hash length
  • Memory requirements (memory hardness)
  • Number of iterations (time cost)
  • The use of salts

Argon2id Parameters

The various input parameters allow us to tune the implementation of Argon2 such that it makes sense for TurtleCoin.

Memory Requirement
  • Be large enough to fit an entire block so that all of the data can be shuffled
  • Not exceed common L2 CPU cache sizes to allow for the largest range of CPUs to participate in mining
Iterations
  • Provide a higher base hashrate than previous algorithms to increase the mining efficiency
  • Take advantage of the multiple memory passes used in Argon2id (>2 iterations)
Parallelism (Threads)
  • Make the use of as many physical and logical cores as possible by using 1 thread per hashing operation
Benchmark Testing Results

We solicited single-core performance benchmarks from the community in the Chukwa Hashing Results issue thread on the main repository. The summary of those results are below.

Note: For brevity, we have truncated the summary table below to the algorithms we have used before and Argon2 parameters that meet the requirements above.

Chukwa Parameters

Given the above requirements and the testing results provided by the community we were left with 5 clear options. One option stands out and sits nicely in the middle among the group of options. It provides a healthy 2.5x increase in hashrate and meets the requirements above.

We’ve selected the following Argon2id parameters for the next PoW:

  • Threads: 1
  • Iterations: 3
  • Memory: 512kb

Note: You can play with different parameters with a simple Argon2 hash generator at argon2.online

TurtleCoin’s Argon2 Implementation

Like other PoW algorithm changes, there is quite a bit of work to be done to ensure that this network upgrade is a success at block 1,800,000. We have adapted the Argon2 reference implementation for our use.

Caveats

Miner Package Availability

At this time, we have found very few miner packages that support Argon2id. While the native CPU miner provided in the core project will happily support the algorithm for solo mining, we understand that the network and community requires the availability of mining pools. To help facilitate pooled mining, we are currently working on building pool support into the native CPU miner provided by the project.

GPU Mining Support

We have not currently been able to find any miner packages that support Argon2id GPU mining. While we are confident that the community at large will work towards having an Argon2id GPU miner available at some point, it is unlikely that a GPU miner will be available at the time of the upgrade. As a result, we fully expect a substanial drop in the network hashrate as a result of this upgrade. We are planning a difficulty reset to account for this drop at the time of the upgrade. This has a byproduct of making TurtleCoin a CPU only coin for the foreseeable future.

Completed

Core

We have completed the necessary changes in the core project to implement Argon2id at block 1,800,000 that will activate with block major version 6. The changes can be found on the codename_chuckwa branch of the TurtleCoin repository. This code has not been pulled into the development tree or master as of the time of this writing.

Support Packages

The necessary changes have also been applied to the development branch of the turtlecoin-multi-hashing Node.js module that pools use to validate miner shares.

Pool Changes

The necessary changes to the turtle-pool software have been completed on the chukwa branch.

In Progress

Testnet

We will also be launching multiple testnets to test the algorithm change including a difficulty reset to adjust for the anticipanted loss of GPU mining hashrate.

How You Can Help

We need help from the community to test this algorithm change to try to ensure that everything goes as smoothly as possible. The more people that are involved, the easier it is to spot issues and correct for them before the upgrade.

Community Reminder

As always, be mindful of TurtleCoin core releases. Watch or star the main TurtleCoin repo to help stay abreast of changes and updates. Join Discord and read the #announcements on a regular basis. Or, sign up for the @news role by typing *news in the chat and be alerted whenever a new announcement is posted in Discord.

Make sure you’re ready for the network upgrade as early as possible. As with any network upgrade, prior versions of the software will no longer be compatible with the rest of the network after upgrade completion.

Remember that you too can participate in discussions regarding the direction of the project via Discord and the TurtleCoin Meta Issues. Join the discussing regarding the PoW change via the Chukwa: The Argon2 PoW Algorithm discussion on GitHub.

Correction: The article above was corrected to reflect the intent of the writer as the original copy referred to the security of PoW networks based solely on the network hashrate and not the distribution of such. Thank you to @Taegus for pointing this out.
Categories
Feature Story

Proof-of-Work Algorithm Change

The core development team has observed the fact that the network hash rate has climbed substantially over the last few weeks. Luckily, the hashrate has remained rather decentralized and balanced over the large number of pools that the community operates. However, the significant increase in hashrate has made it more difficult for the project to meet one of its core goals. To remain mineable for everyone. After careful consideration, we believe it’s once again time to perform a soft fork to a new Proof-of-Work (PoW) algorithm.

Such a change is not taken lightly, and we’ve given considerable thought to where the project should go in this regard. We’ve seen a few networks using CryptoNight Soft Shell variants with success. Although considerable work has been done to support Soft Shell pools and the like we’re not quite ready to move over to Soft Shell just yet.

You’re probably asking yourself, “So what’s the plan?”

Supported PoW Algorithms

If you’ve read through the TurtleCoin fork guide, forked TurtleCoin yourself, or have read through the code, the next few statements are going to come to no surprise to you.

We like to collect PoW algorithms like they are pogs. The more you have, the more fun you’re having with your friends.

Keeping this in mind, TurtleCoin currently has built-in support for no less than twelve (12) different PoW algorithms. Yes, you read that right, twelve.

They are, in no particular order:

  • CryptoNight v0
  • CryptoNight v1
  • CryptoNight v2
  • CryptoNight Lite v0
  • CryptoNight Lite v1
  • CryptoNight Lite v2
  • CryptoNight Turtle v0
  • CryptoNight Turtle v1
  • CryptoNight Turtle v2
  • CryptoNight Soft Shell v0
  • CryptoNight Soft Shell v1
  • CryptoNight Soft Shell v2

Woah, Wait, What’s CryptoNight Turtle?

To put it mildly, CryptoNight Turtle is a tweak to the standard CryptoNight family that significantly increases the speed at which hashes can be computed. This is accomplished in two ways.

Iteration Change

We’re dropping the iteration count in fourth as well. From 524,288 iterations to 131,072 iterations. This will result in the base hashrate increasing for every miner.

Scratch Pad Change

We’re dropping the scratch pad size in fouth. From 1MB (CN Lite) to 256KB. Why? because we want to make everything go faster and when we’re dropping the iteration count, we need to make sure that the scratchpad is used effectively to prevent some interesting attack vectors.

Faster? Doesn’t That Mean an Even Higher Network Hash Rate?

It sure does! There’s a reason for what appears to be chaos and we’re just getting to the good part.

TurtleCoin Major Block v5

As you’re likely thinking, “This doesn’t sound better, no, no, these guys are crazy…”

Block Major version 5 is planned to activate CryptoNight Turtle v2. That’s right, variant 2. Those of you following other projects using v2 likely know that there is a performance penalty incurred by variant 2 hashing. We’ve personally seen a performance hit of anywhere from 12% to 45% on some hardware. We think that’s unacceptable; however, we do like the premise behind variant 2.

To balance the performance impact of variant 2 out, we’re going to hash faster with CryptoNight Turtle. The two effectively cancel each other out and we gain the benefit of soft forking away from potential ASIC/FPGA/etc. miners. As a matter of fact, you’ll see a hashrate increase on your miner(s) because of the move to CryptoNight Turtle.

The move to variant 2 will help strengthen TurtleCoin’s ASIC/FPGA resistance. Future PoW changes will also be designed to further strengthen the project’s ASIC/FPGA resistance to try to keep TurtleCoin mineable for everyone.

Doing Your Part

We’re confident that we have the core code ready for the soft fork to CN Turtle tentatively scheduled for block 1,200,000. The main pool software has been updated to support it as well as the underlying Node.js Hashing Library and the Node.js Cryptonote Library have been updated.

There’s still work to be done and any community assistance is, as always, appreciated.

Test Network

We’ll need help from the community to test this algorithm change to try to ensure that everything goes as smoothly as possible. The more people that are involved, the easier it is to spot issues.

Miner Support

We’re working on adding support to common miner projects to support this change including:

Miner software needs support added before we can fully test the update pool deployments. If you want to give us a hand in getting that support completed, join us on discord at http://chat.turtlecoin.lol in #dev_general.

Alternative Pools

The pool software changes need ported to the other pools that the community service operators use on a daily basis. If you are familiar with one of the following pools, your assistance is appreciated in this regard.

Upgrades

As always, be mindful of TurtleCoin core releases. Watch or star the main TurtleCoin repo to help stay abreast of changes and updates. Join Discord and read the #announcements on a regular basis. Or, sign up for the @news role by typing *news in the chat and be alerted whenever a new announcement is posted in Discord.

Make sure you’re ready for the soft fork as early as possible.

As with any soft fork, if and when the fork occurs, prior versions of the software will no longer be compatible with the rest of the network after soft fork completion.

What’s Next?

We’re already putting thought into the next PoW algorithm change after v5. Those discussions will be a different article, so as always, stay tuned.

Categories
Feature Story

Interview w/ Turtley McTurtleton McDrizzle from ForkMaps.com

forkmaps logo

RockSteady (TRTL)

@Turtley McTurtleton McDrizzle Thanks for doing the interview. I wanted to talk today about ForkMaps, and what forking means to the community, and why it’s worth tracking.

Turtley McTurtleton McDrizzle

The forkmaps.com story goes something like this… A couple of months ago, RockSteady said he wished someone would make an updated version of the fork timeline on the CryptoNote Wikipedia page. Turtley McTurtleton looked around a bit, didn’t find anything that was being maintained, and had only one response… “Hold my beer.” “I’m on it.” The timing was just right. I was evaluating frontend JS frameworks for an upcoming work project, and rather than writing some contrived “hello world” sample, I used forkmaps as an opportunity to test a handful of frameworks in a real-life scenario.

RockSteady (TRTL)

That’s really cool. While making forkmaps is there anything that surprised you about all these forks?

Turtley McTurtleton McDrizzle

I found the general friendliness by the CryptoNote community a little surprising. I’ve ventured into many discord servers either looking for project details, or advising someone to restore license headers, and I almost always receive a warm greeting.

RockSteady (TRTL)

Tell us a bit about the tech behind the project and how it all works. I noticed the front end got noticeably faster to load recently. Can you talk about that a bit for some of our nerdier readers?

Turtley McTurtleton McDrizzle

I used Vue.js for the frontend. I wrote it using Vue first, then rewrote it using React, and then messed around with a handful of other frameworks/libraries. I’ve used AngularJS and React quite a bit in the past, and to me, Vue is the perfect marriage of the two.

The site has very few dependencies. I used three Vue packages (base, vue-router, vuex), axios for HTTP requests, and echarts. I didn’t use a CSS framework, so design took me forever, but taught me a lot.

Turtley McTurtleton McDrizzle

To tackle performance, I cleaned up a lot of my JS, replacing a lot of nested functions with array reducers. I added a few CSS transitions to smooth out navigation, added loading indicators (which you should almost never see), and threw in some other UX tricks. Other than the fork map page, my improvements were mostly about perceived performance. You can make something that’s actually very fast, feel slow through clunky UX, and that’s what I’d done with my first attempt.

On the map page, I switched from vis.js to echarts, which is much more UX-friendly.

That was a lot, and I promise I’m almost done.

On the data side, all of the CryptoNote coins live in a separate git repo, as individual coin files to make them easy to manage. Whenever there’s an update, I run a gulp task to combine them into a single json file, which forkmaps.com pulls directly from GitHub. This way, it’s trivial to add additional coin families in the future.

RockSteady (TRTL)

That’s really cool, what do you plan to add to it next and what kind of helpers are you currently looking for?

Turtley McTurtleton McDrizzle

Next I’m working on a timeline representation similar to the example you initially showed me. Someone’s working on the 200k TRTL bounty for adding start/end dates to all of the coins as we speak. After that, I want to do max supply, emission curves, primary emission length, and possibly current supply. That one’s been requested a lot, and I think it’ll make an interesting chart. Most coins seem to have a primary emission measured in decades, while Nerva is only three years. I’m always happy to send TRTLs to anyone who contributes data or ideas.

Jerme404’s ForkMaps.com

RockSteady (TRTL)

That’s great that you’re including the community in this project, and even chipping in bounties for people who are helping out. With so much exposure to all of these different forks, surely you’ve come by some really interesting ones. If you don’t mind, let’s run through a few of the more memorable ones to you: Which fork has the best logo in your opinion – What is the most interesting fork – Which forks do you mine – What’s the worst fork name you’ve encountered – If you made a fantasy fork tomorrow, what would it be called and what would it do?

Turtley McTurtleton McDrizzle

I like logos that don’t look like a coin. Some of my favorites are Boolberry, Alloy, Athena, Lethean, Nerva, TurtleCoin, and Karai (not on my site yet, but the logo is solid). Right now, I think the most interesting fork is Nerva. I’m looking forward to seeing what happens when the supply is exhausted in like 2.5 years, and CPU-only mining is the shit. I only mine Nerva and TurtleCoin. I rent some of my miners on miningrigrentals, and I used that income to buy more TRTL. Worst fork name? How about all of those dumbass XMR forks that happened when Monero switched their PoW algorithm? Actually, Sadomi might be the worst. I really don’t think they thought that one through. A fantasy coin for me would be a TRTL fork so I’d always have a reliable codebase and community, and I’d implement a prime sieve PoW component similar to riecoin. I’d call it Turtimus Prime.

RockSteady (TRTL)

Haha that sounds fun. Whats up with Prime Sieve? tell me about that

Turtley McTurtleton McDrizzle

So basically, you have an algorithm for finding prime numbers, or prime number patterns. Many projects have chosen to do something “useful” as PoW, at the expense of cryptographic security. But why not both? Add a secondary PoW step that’s relatively easy to perform, does something interesting, and throws another wrench at potential ASICs.

RockSteady (TRTL)

That’s cool, I think we’ve about got it all covered, is there anything you want to add?

Turtley McTurtleton McDrizzle

I’m glad you asked! Years and years ago, before cryptocurrency was a thing, I had a closet full of crunchers (mining rigs nowadays) working hard on distributed computing projects like folding@home (Team 32!) and BOINC/SETI. Back then, there was no financial incentive to spend lots of money on hardware and electricity, but we did it anyway. Some did it for a cause, some for leaderboard points, but I think most did it for the knowledge and the community. I treat crypto projects the same way. At this point in my life, my time is far more valuable than any amount of hardware or hashrate, and there’s a big reason I spend so much of that time with my fellow turtles. And TurtleCoin is the only project I’ve found that really embodies that sense of teamwork and community that the distributed computing scene seems to have lost to crypto over the years. So to all my turtle-fam, keep up the good work, and stay turtley!

RockSteady (TRTL)

Jerme, I’m glad you did this interview, and I’m happy you’re a part of this community! Thanks for everything you do with ForkMaps and otherwise, and I look forward to what you come up with next!