Monday, 4 May 2015

Cryptocurrencies: Bitcoin and the Altcoin revolution

Bitcoin

There are now hundreds of cryptographically secure currencies, but why do they exist and which ones should you trust?

Currencies backed by cryptographic guarantees rather than by governments or precious metal stores first became famous with the dramatic rise of Bitcoin in 2013 when one Bitcoin rose from a value of $14 to over $1,000. The last year has been a bit less impressive and the price of Bitcoin slumped to about 20% of its peak.

Despite the low price, there's good reason to be positive about Bitcoin. The last year has seen the currency become better known and more useful than ever. You can spend it in more places, and Linux Voice subscribers can renew their subs with it (we hope to roll out sales for new subscribers soon). Bitcoin is by far and away the most popular cryptocurrency, but there are hundreds of others, known as altcoins. Some of these altcoins are gaining popularity, while others are languishing without value and without miners to keep the blockchain moving. Some of these new cryptocurrencies hope to add new features, or improve on the Bitcoin model in some ways; others are just scams perpetrated by people hoping to get rich quick.


Almost all cryptocurrencies work in the same way - the method pioneered by Bitcoin. Miners calculate new blocks that are added to a cryptographically signed list that goes back to the very beginning (this list is known as the blockchain). Transactions are added to the blockchain, and once there, they're an irremovable part of the currency's history. This permanent ledger of every transaction prevents both double spending and making fake coins. Anyone can inspect the blockchain and make sure that the coins are valid (that is, they can be traced back to the point they were mined) before making a transaction.

However, despite working in the basic same way, there are some important differences between the currencies. Perhaps the biggest distinction from a technical point of view is the hashing algorithm used to mine and secure the blockchain. Some of the most popular are:

SHA256 Used by Bitcoin. This algorithm is now implemented in highly efficient ASICs, so it's no longer possible to mine it efficiently without purchasing specific mining hardware. There is a slight risk that this could leat to a small number of people getting control of a large amount of the hashing power (by limiting access to hardware). However, currently this isn't happening.

Scrypt Originally this was thought to be resistant to ASIC (chips built for the sole purpose of creating coins) miners, because it requires more memory that SHA256. However, there are now Scrypt ASICs that can mine more effectively than GPUs. The difference isn't as great as with SHA256 though. This is the hashing algorithm used by Litecoin.

X11 This isn't a single hashing algorithm, but a collection of 11 different hashes chained one after the other. The theory is that this complexity will make it harder to design specific hardware to perform the hash effectively, and that this will slow down the development of ASICs and keep the mining more democratic for longer. At present, there are no ASICs that can mine XI1 (though some vendors erroneously claim that they do). However, it is likely that if an X11 coin becomes valuable, ASICs will follow. The most popular XI1 coin is Darkcoin.

Coin miners are constantly mining new blocks. The number of blocks mined since a transaction was included in the block chain is the depth of the transaction (sometimes called the number of confirmations). The deeper the transaction, the harder it is for anyone to reverse it. It's common to say a transaction is verified once it reaches a depth of six blocks in Bitcoin. Each coin has an algorithm that adjusts the mining difficulty depending on the current hashrate in an attempt to keep the blocks being mined at a consistent rate, and the target rate is different for each coin. Bitcoin, for example, adjusts the difficulty to try and keep a new block appearing on average every 10 minutes. Since a transaction isn't valid at all until it's in a block, and not considered secure until it's in six blocks, it can take up to an hour for a transaction to be considered valid. This level of time is fine for some transactions, but it's not very good for, say, paying in a shop.

Hash rates and block times


Many other cryptocurrencies have faster block times. For example, Litecoin tries to get a new block every 2.5 minutes. This has two implications. First, it means that transactions are included in the blockchain faster, but consequently, it means that it’s cheaper for a malicious user to manipulate a single block in the blockchain. The reason that blocks are considered secure in Bitcoin once they reach a depth of six is because at a depth of anything less than that an attacker with access to very powerful computers could try to out-mine the mining network.

The rules of Bitcoin say that the longest block chain is always the right one. Therefore if a transaction is included in one block, an attacker could start mining on an earlier block, and if they can mine two blocks before the rest of the network can mine one, they can remove the transaction from the block chain even though it appeared in one block. The deeper in the block chain a transaction is, the more processing power they would need- and therefore the more expensive it would be. The faster block time on Litecoin means that an attacker would need fast hashing power for less time to reverse one block, so to get the equivalent level of security you need a transaction to be deeper.

However, many transactions are quite small. It's never going to be worth doing this to reverse a transaction for a can of coke or a pint of beer. For these smaller transactions a single block is enough, and that's going to be much quicker on average in the currencies with the shorter block times.

All cryptocurrencies give coins as a reward to miners. However, they manage this in different ways. Some have a large number of pre-mined coins that are for the currency's developers. Some have a fixed limit on the number of coins that will ever be created, while others will keep mining them infinitely. A large number of pre-mined coins (ie coins that were created before the currency went public) can be an indicator that the currency's creators want to enrich themselves rather than create a sustainable currency.

What's not yet clear is the best approach to rewarding miners over a long period of time. Bitcoin halves the number of coins miners receive when they mine a block every four years. This means that fewer and fewer new coins will enter circulation as time goes on, and there is a limit on the number of Bitcoins that will ever be created - 21 million. The idea is that this limitation of supply will cause the value of Bitcoins to remain high.

On the other hand, Dogecoins will be mined forever. There is a risk here that these new coins will cause the currency to constantly fall in value. However, if growth in the Dogecoin market out-paces the new coins, it will mean that the coins will still raise in value and the miners will still be incentivised to mine. In currencies where there's a limit on the number of coins mined, there are often transaction fees (usually voluntary) that can be used to compensate miners when there are no more rewards for mining blocks.

In reality, for a cryptocurrency to be healthy, miners have to be paid. The falling block rewards and transaction fees model (like Bitcoin, Litecoin, Darkcoin and many others) mean that people who make transactions will pay the miners. In a currency that continually creates new coins (like Dogecoin), it's the people who hold coins that pay (because of the devaluation caused by the increase of supply).

Darkcoin


This covers most differences between most cryptocurrencies. However, there is one that's a little different: Darkcoin. This currency set out to fix what some people see a fundamental fault in the Bitcoin network: the lack of privacy. Since the block chain is public, everyone can see every transaction that’s ever happened, and which wallets hold how much money.

Darkcoin includes a masternode network. These are a sub-set of the nodes on the network that are used to obfuscate the source and destination of a transaction in a similar way to the method the Tor network uses to protect anonymity online. In order to provide some protection against an adversary taking control of a large number of the masternodes, each mastemode has to be linked to a wallet with 1,000 Darkcoins.

A useful side effect of the mastemode network is that they can be used to guarantee almost instant transactions known as InstantX. Sending using InstantX, a transaction is locked by a group of masternodes until it reaches a sufficient depth. This means that you can have a high degree of security of a transaction with the space of a few seconds.

Trading


It's possible that investing now in the right currency will make you huge sums of money in the future. It's also possible that you will lose your entire investment. Cryptocurrencies aren't a safe way of holding money, but then neither is anything that has such high potential returns. If you want to start trading cryptocurrencies, you'll need two things: a thorough understanding of the coins you’ll be trading, and an account with an exchange. Trading is all about predicting what will happen, then arranging your currencies to maximise your profit when that happens. You can hold on to currencies for a long time in the hope that they’ll continue to rise in value, or you can shuffle money around and try to take advantage of spikes in value.

There are quite a lot of exchanges listed at https://www.cryptocoincharts.info/markets/info It's usually wise to hold some of your coins in a private wallet rather than on an exchange, or spread the risk by having accounts on more than one exchange.

There are two key graphs that you'll see on an exchange that will help you see what's going on: the price history, and the market depth, shown in figure two. This is an amalgamation of the various orders out. If you own Bitcoins and want to sell them, you put out a sell order showing the price you're willing to sell them at. If you want to buy them, you do the same but with the price you're willing to pay. The blue line is a cumulative line for the buy orders and the green line is a cumulative line for the sell orders. Where they meet is the current market price for Bitcoins on this exchange. The skill of trading is being able to read these two graphs and deciding what prices to place your orders.

Mining: can it become profitable again?


The original aim of mining was to distribute the task of generating the block chain to anyone with a computer who believed in Bitcoin, and so many of the early coins were mined on regular computers. However, as soon as Bitcoin started to become successful, people looked for ways to mine them more quickly.

Graphics cards can be programmed to mine the SHA256 hash quite effectively, and once software came out to allow this, it was no longer profitable to mine on CPUs (the cost of the electricity was more than the Bitcoin reward).

It didn't stop there though. People started to make hardware specifically to mine coins quickly. First, this was using Field Programmable Gate Arrays (FPGAs) - these are blank chips onto which you can load circuits - and later using Application Specific Integrated Circuits (ASICs), which are custom-built chips. These days, it's not profitable to mine unless you have some of the latest generation ASICs and access to cheap electricity.

Currently, the best XI1 currencies such as Darkcoin are right on the edge of being profitable to mine using a GPU. If there's an increase in price, this could mean that you can actually make money using your graphics card again, though FPGAs and ASICs will probably follow if mining XI1 remains profitable for long.

Pump and dump


Bitcoin's sudden rise in price in 2013 has lead many people to believe that similar things will happen for other currencies, and that all they have to do is wait for one to start to rise in price, then buy, and wait to reap the profits.

This has led to the use of pump and dump scams. This is where a group of people artificially inflate the price of a particular cryptocurrency (or other tradable commodity) for a short period of time, then sell their stake while the price is high and leave it to crash.

Inflating the price can be done by pushing out positive news stories that give a false impression of support for the currency, buying up quantities of the currency on exchanges, or almost anything else you can think of.

Before investing in a currency, you should always be aware of the risk of this form of scam. All currencies will have peaks and troughs, and cryptocurrencies are particularly volatile; before investing in a currency, take a look at its history and coverage and decide for yourself whether it seems legitimate.

The next Bitcoins?


Litecoin One of the oldest altcoins, Litecoin was released in 2011. It uses the Scrypt hash and has quite a short block time.

Darkcoin A cryptocurrency with a unique system of masternodes. Launched in 2014, it's still quite new, but already it’s the sixth largest cryptocurrency by market capitalisation.

Dogecoin The logo is of a Shiba Inu dog, which became popular on the Reddit social network. This currency’s popularity is almost entirely down to marketing. Users of this currency have raised money to sponsor a Nascar driver, and pay for the Jamaican bobsled team to compete in the Winter Olympics.

Ripple This isn't a cryptocurrency like the ones we've dealt with here because it relies on trust rather than cryptographic proofs. In reality, Ripple is more of a payment system than a currency and isn't easily compared to more common cryptocurrencies.

Potcoin A cryptocurrency set up to support the legal marijuana industry around the world. Some of the proceeds have been used to support the use of the drug for medical uses.