Biz & IT —

Behold Arscoin, our own custom cryptocurrency!

And you can mine them to buy fancy hats!

Behold Arscoin, our own custom cryptocurrency!
Aurich Lawson
The Arscoin experiment has ended. The story below chronicles how we built and deployed our own cryptocurrency—but the funny hats are no longer available.

Recently, I became the first person in the history of Ars Technica to have a gold—rather than black—user name.

How did I get this blinged-out honor? I bought it for the low, low price of 500 Arscoins—the latest digital cryptocurrency to hit the Internet. Arscoin is one of around 100 or so "altcoins," or alternative bitcoins, derived from the same source code as the original cryptocurrency.

The existing Bitcoin community has an inherent distrust of many altcoins. Bitcoin forums are replete with discussions of “pump and dump” scams, where the originators of a new altcoin might “pre-mine” coins, release their currency to the general public, and market their hot new cryptocurrency hard in order to drive the price up. Then the creators simply sell off their coins at a profit and walk away. It’s one of the oldest financial tricks in the book.

But other altcoin creators are true believers in anarcho-capitalism, or they simply find Bitcoin and its derivatives new and interesting. And not all altcoins are quite as ridiculous as they may seem; even Dogecoin, which was jokingly based on an image meme, has an on-paper market capitalization of more than $60 million.

As the new year began, I found myself writing about several new (and often ridiculous) altcoins: CoinyeNorris Coin, and yes, Koindashian. It got me thinking: if anyone can just up and create a new altcoin, how hard can it be? Arscoin is our attempt to find out. Here's how we created our own digital currency, how you can do it too, and what it all means.

Jesuscoin and Snoochyboochy

While the creator of Bitcoin remains a mystery, the currency's digital underpinnings are open to anyone to learn about; it’s famously open source. One of its first major competitors, Litecoin, used the Bitcoin source code in late 2011, changing a few key parameters before releasing its own source code. That, in turn, has spawned more recent clones like BBQCoin and Dogecoin. According to Coinmarketcap.com, 75 mineable altcoins currently exist, with market capitalizations ranging from $38,000 (FedoraCoin) to $10.3 billion (Bitcoin). Even other journalists have started their own altcoins (see Joe Weisenthal's Stalwartbucks).

To create an altcoin, enterprising developers generally take the Bitcoin (or Litecoin) source code found on Github, tweak it as they see fit, and then compile it into the files necessary to generate the blockchain and start mining. Not surprisingly, there’s an entire subreddit devoted to the practice, and helpful altcoin users have written up extensive guides with titles like “The altcoin explosion… and how to profit from it,” “Complete Guide on How to Create a New Alt Coin,” and “How To Clone Scrypt Based Altcoins for Fun and Profit.”

However, for non-coders, this approach often includes daunting instructions like:

Once all of the dependencies are built and installed, the next step is to clone the source from git. In this example, I will be cloning foocoin, rename it, re-git initialize it, and push the initial copy out to Github to ensure git is working:

 %git clone https://github.com/foocoin/foocoin.git
 cloning in to foocoin
 %mv foocoin barcoin
 %cd barcoin
 %rm -rf .git
 %git init
 initializing git repository in ~/barcoin
 %git add -A *
 %git commit -m "first commit"
 %git remote add origin https://github.com/barcoin/barcoin.git
 %git push -u origin master
 username for git@github.com: barcoin
 password for barcoin@github.com: **********

But for programming newbies (like me), altcoin creation is still possible. University of North Carolina student Matt Corallo’s Coingen.io debuted in early January 2014, and many sources told me that it is the easiest way to craft a new altcoin. It has already been used to create coins with names like “jesuscoin,” “snoochyboochy,” “supercalifragilisticexpialidociouscoin,” and my personal favorite, “wake_up_sheeples_banker_owned_federal_reserve_notes_equals_more_debt.”

Corallo told Ars that he created the site essentially to show how silly altcoins had become. “All they’ve done is tweak some constants that don’t do anything,” he said. “The whole value proposition is the digital scarcity, and if you have a million of these things then you’ve devalued all of them. My goal was to show that all these millions of people who run their own are not doing anything interesting and there’s no reason that anyone should be investing in these things.”

But within two weeks, more than 100 people paid him to create their own altcoins. At 0.2 bitcoins per order, that’s a total of 20 bitcoins—$17,000 at the exchange rates of the time.

Corallo has already sold the Coingen.io site to Shawn Wilkinson, a Bitcoin developer and student at Morehouse College in Atlanta, Georgia. Wilkinson told Ars that he bought it for an amount between “tens and hundreds of bitcoins,” (likely in the tens of thousands of dollars). He plans on “lowering the barrier to entry” for those who want to create more altcoins. 

“I think that people are missing the core point: you want to lower the barrier to entry," Wilkinson told Ars. "If you look at Bitcoin and you see the contributor list, it’s a dozen people writing a majority of the code. If you lower the barrier to entry and allow people to experiment, you bring more people to develop it in the space.

“I say the more the merrier, the more people trying stuff. You can create these economies out of nothing! One thing I like to do is to play around and diversify. I will buy any coins I can get my hands on. You have any kind of coin that can do that. I think you’re going to see a lot more smaller markets. as long as two people will trade it and it has a nonzero value, I say it’s working as expected.”

For the price of 0.2 bitcoins (about $170 at the time), Corallo’s Coingen.io Web app created Arscoin by tweaking the Litecoin source code. We supplied the following parameters...

Scrypt
Block rate: 300 seconds (5 minutes)
Initial value of block: 50
Block halving rate: 420,000
Total coins: 42 million

...paid up, and waited. The process took just a few minutes. At the end of it, we had Windows and Linux apps, complete with a GUI and the source code. Arscoin was born—now we just had to mine some actual coins and find a way to spend them.

Cash from hash

In the United States, new money is made (or managed) by the Federal Reserve System, which creates an elastic currency: the US dollar. The dollar is said to be "elastic," as the Fed can increase or decrease the money supply at any given time essentially by telling the Bureau of Engraving and Printing to simply print more money using fancy moneymaking machines and crazy-complicated inks and textiles.

Cyrus Farivar
The Federal Reserve says (PDF) that the total value of currency and coin in circulation has risen from $31.2 billion in 1955 to $724.2 billion in 2003. Of course, when done unchecked, printing money can lead to hyperinflation. (Zimbabwe famously reached an inflation rate of 6.5 sextillion percent in mid-November 2008; it has since abandoned its local currency entirely.)

So how are new Arscoins created? Math. Specifically, cryptographic math.

Bitcoins and their derivatives rely on a “hash function,” a complicated set of equations that converts an arbitrary block of data (numbers or letters) into a one-way, fixed-size string known as the “hash value.” The initial value is often also called the “message,” while the result is sometimes dubbed the “digest.”

A good hash should have four main properties:

1) It should be easy to compute the hash value.

2) It should be infeasible (that is, computationally impractical) to create a message resulting in a given hash.

3) It should be infeasible to modify a message without changing the hash.

4) It should be infeasible to find two messages that yield the same hash (a situation known as a “collision”).

In any cryptocoin, the creation of new coins and the records of how those coins are traded are logged in what's known as the “block chain.” Each block contains various pieces of data, including a record of recent transactions and a reference to the previous block. (The whole process originates with the initial “genesis block.”) New blocks cannot be added without first solving the puzzle of finding a message that results in a hash that has certain properties, such as beginning with the numeral 0. That puzzle can be made arbitrarily harder by requiring that the message begin with two 0s, for instance. Calculating the puzzle-solving hashes results in the creation of "coins."

As CoinText points out, anyone can get a sense of this by using online hash calculators. Bitcoin’s hash function (the mathematical formula by which it arrives at hashes) is an algorithm called SHA-256, for instance. An online hash calculator shows that by using SHA-256, the message “a” yields the hash ca978112ca1bbdcafac231b39a23dc4da786eff8147c4e72b9807785afee48bb

ab --> a63d8014dba891345b30174df2b2a57efbb65b4f9f09b98f245d1b3192277ece

abc --> edeaaff3f1774ad2888673770c6d64097e391bc362d7d6fb34982ddf0efd18cb

abcdefghijklmn --> 0653c7e992d7aad40cb2635738b870e4c154afb346340d02c797d490dd52d5f9

So if we were looking for hashes that start with 0, we would have just determined that “abcdefghijklmn” fulfills that criteria. The system “awards” 50 bitcoins to the computer that finds this solution. The actual math that Bitcoin (and Arscoin) uses is far more complicated than this, but the basic idea is easier to grasp.

When we defined Arscoin's parameters, we set the initial value per block at 50 Arscoins and the “halving rate” at 420,000 blocks (roughly every eight years), which will result in a total of 42 million Arscoins. However, Arscoin, like Litecoin and other similar altcoins, doesn’t use SHA-256 as its hashing function. Rather, we use scrypt (that’s “s crypt” and not “script”).

In our initial testing between eight or fewer “solo miners” using primarily ordinary PCs and Linux boxes, it took around five minutes to solve a block. As more people join the network and more Arscoins are generated, this will take significantly longer. Eventually, it will take far too long to generate new Arscoins on one's own; that’s where “pools” come in. With pools, people combine their computing resources and share the rewards of mining—and that's how you can jump in and make some Arscoins yourself!

Eventually, as a cryptocurrency gains steam, specialized hardware (beefy GPUs, ASICs, and FPGAs) becomes increasingly important. These chips can calculate the hashes at orders of magnitude faster than can individual consumer-grade computers. (Last year, Ars editor Lee Hutchinson took a Butterfly Labs ASIC miner for a spin, generating around $700 in bitcoins in two weeks, all of which was donated to the Electronic Frontier Foundation.) Specialized hardware makes a huge difference when cracking the SHA-256 hash function. If all this reminds you of password cracking, it should. Cryptocoin mining is essentially the same concept, just with different math applied to different ends.

“Once you get past the fact that you’re using hash function in this weird way, it makes a lot of sense,” Matthew Green, a professor of cryptography at Johns Hopkins University, told Ars. “It’s Monopoly money—it’s good Monopoly money, it’s hard to counterfeit, but it’s Monopoly money.”

It's also limited. Bitcoin will never have more than 21 million bitcoins in existence, while litecoin will reach 82 million. For Arscoin, we chose 42 million as a happy medium. Besides, 42 is the answer to the Ultimate Question of Life, the Universe, and Everything.

Today, it's essentially impossible to mine Bitcoin using an ordinary consumer-grade computer—and the same will eventually become true of other successful altcoins. This is where the “pump and dump” strategy of newer altcoins comes into play. Had we wanted to profit from Arscoin, we would simply pre-mine a huge batch of coins (or give certain people, like ourselves, early access to the system). Over time, the earliest people with the fastest hardware benefit the most. But because we chose scrypt as our hashing algorithm rather than SHA-256, you don't need special ASIC-based hardware just to keep your head above water.

“Scrypt is designed to be something you can do on CPUs, [though] you can it do GPUs, too,” Colin Percival, the Canadian computer scientist who developed scrypt, told Ars.

When computing SHA-256 hashes like the ones used in Bitcoin, a consumer-grade CPU presently can generate a few million hashes per second (MH/s), or about 50MH/s on a GPU—a difference of approximately 20-30x. When computing scrypt-based Arscoin, on the other hand, that difference is only about 4-5x. By contrast, ASICs can compute Bitcoin hashes at a rate of tens or hundreds of thousands worth of MH/s. ASICs designed for Litecoin and other scrypt-based cryptocurrencies are only just starting to come out, and these top out for now at about 25MH/s. (It's hard to do precise comparisons given the vast range of available CPUs, GPUs, and ASICs.)

Scrypt originally was designed as a way to secure the data Percival was storing in his online backup company, Tarsnap.

“I expected it would be used for keeping secrets, not for making money,” Percival said. “I still think that the best use of scrypt for cryptocoins would be people to encrypt their wallets so that if their wallet gets stolen, others couldn’t get the money out. I think the whole idea of proof-of-work is rather horrible in that we have millions of dollars being spent on computing things for no real benefit, just competing against each other. In an economic sense, this is incredibly wasteful. It’s like the Olympics without the entertainment value.”

Channel Ars Technica