2014-04-28

Smart contracts and the demise of copycoins

Today I would like to talk about a few ways smart contracts in Crypto 2.0 systems can lead to the demise of copycoins. Lets start with some definitions:


  • Smart contract in this conversation denotes a program that exists in a cryptocurrency that can autonomously send and receive currency units according to given predefined rules.
  • A Crypto 2.0 system is a cryptocurrency that can support transactions in any user-defined currency. For example, Ripple, Ethereum and Mastercoin are all Crypto 2.0 systems.
  • A copycoin is a cryptocurrency that is identical to a number of other currencies (especially Bitcoin) from a technical standpoint. For example, Litecoin has a different block maturation speed and hashing algorithm, but is otherwise identical in features to Bitcoin. Just like Dogecoin, Auroracoin, Peercoin and Feathercoin, but unlike Namecoin, Ripple, Ethereum and Mastercoin which all do something innovative.
  • Ledger - an equivalent to a block for a Crypto 2.0 systems. I use this term to distinguish it from "blocks" that will be used to denote something inside of a Crypto 2.0 system.
Please note that technical aspects of a coin is not everything that makes a currency. The community is just as important. Just because a coin is a copycoin, doesn't mean it's not valuable - just look at Dogecoin.

Technical requirements

To create a copycoin, one usually takes an existing code base from Bitcoin/Litecoin/whatever and changes a few settings:
  • Coin name, address net byte (to determine if addresses start with 1, L, D or whatever)
  • Block maturation time
  • Number of coins per block
  • Coin distribution model (whether the amount of coins per block drops in the future and how)
  • Whether any coins are premined
  • Hashing algorithm (SHA, Scrypt, whatever)
  • What "Proof Of" the coin uses for hashing (proof of work, proof of stake, etc.)
Tweaks to those variables alone give us about 99% of available coins out there. The thing is, all of those variables can be very easily encapsulated into a smart contract and ran on a Crypto 2.0 system. This means that most of the copycoins can in the future be ran as a part of a bigger currency system. Now that we know what we need, lets look how a smart contract for a new copycoin would look.

Crypto 2.0 benefits

When discussing something like this, we first need to ask ourselves "why?". Why would a copycoin benefit from running on a Crypto 2.0 system as opposed to running by itself? Here are a few reasons:
  • It may be more economical to run 1 Crypto 2.0 system with 100 coins on it, rather than 100 coins by themselves. If a coin has low transaction traffic, it will have a lot of overhead. One well utilized system can be run better at a scale
  • No 51% attacks - if the coin is run inside a system protected by a vast amount of computing power (Bitcoin), or is generally resistant to 51% attacks (Ripple), any subcoin will be immune to such attacks. This removes the fear of the dreaded multipools for many coins
  • Possibly faster transaction times - some networks are insanely fast in comparison to even the fastest copycoins. Dogecoin runs at 1 block per minute. Geistgeld used to do 1 block per 15 seconds, Ripple creates a ledger every 5 seconds (full confirmation, not just 1 confirmation) without running into a problem of block race. This means that the transaction speed on the network can be increased if a fast Crypto 2.0 system is used
  • Built-in exchange - A few Crypto 2.0 systems have a built-in distributed exchange, like Mastercoin or Ripple. This means a new coin on the system can be instantly traded there on the spot

Designing the smart contract

Now that we figured out why we want to do something, lets look at how this can be achieved.

To implement a copycoin with the conditions given above in a Crypto 2.0 system, we would create a smart contract that does the following:

  • Creates a new currency with a given name and currency symbol
  • Each time a valid "block" for the currency is created, it sends the block creator a specified amount of currency units
  • The amount sent is predefined by the distribution model
  • It charges fees for any transaction using a given currency and distributes it to the "miners"
Sounds fairly straightforward. Combining what I know about Ethereum (what their smart contracts can do) with what I know about Ripple (how the system handles custom currencies), implementing this would be easy. The most challenging bit would be validating "blocks" for a given currency. Lets look at that more closely...

"Blocks"

A "block" for a copycoin implemented in a Crypto 2.0 system would probably be more akin to a block header. Rather than containing all past transactions, it would be just a digest of what happened since a last block. Here is what would be needed in a block:
  • Reference to the current ledger of the Crypto 2.0 system - this would force new blocks to use new Crypto 2.0 ledger hashes to ensure only a new block can be submitted. In order for a block to be valid, the ledger used would need to be newer than the ledger used for the previous block
  • Specify the recipient of the block reward - simply stating who should receive the money
  • Reference the currency one is mining for - we don't want the same block to be used for more than 1 currency, unless we would be doing some merged mining
  • Pay the cost of running the smart contract - those operations are usually not free on the Crypto 2.0 systems
That's basically all that's needed for creating a basic block. The rest varies according to the Proof Of we'd be using.

Proof of Work

Fairly simple - each block created would have a nonce and the hash of the transaction needs to be smaller than a given difficulty. The difficulty would be adjusted by the smart contract based on how often the blocks are submitted.

The person submitting the block can also earn all the fees spent since the last block.

Proof of Stake

There are two ways of doing Proof of Stake. The simplest one is to ignore blocks entirely. This means that each time the currency is used and a fee is paid, the supply of the coin will diminish. Since getting paid based on how much coins you have or having the supply of coins diminish is really interchangeable (you end up having the same percentage of coins in the end), you don't need to create any blocks really.

Alternative Proof of Stake would pay all the people that currently hold the coin their fair stake. Whoever would pay for the block would initialize this distribution.

Proof of Burn

Whoever creates a new block has to pay a fee to create new coins. The fee would be converted to the coins based on a predefined ratio or algorithm. 

Combining proofs

There is no reason why those proofs can't be combined. For example, one could initialize a Proof of Work payout that also has a Proof of Burn to compensate the miner for the fees they paid to initialize the block reward payout or what have you.

Conclusions

It is possible that once smart contracts are well integrated into Crypto 2.0 systems like Ethereum, we will see a demise of the copycoins created in the old way.

I wonder whether this prediction will come true, or will I be proven wrong by too many people distrusting such solutions...

2014-04-18

MintChip, what it could've been...

MintChip was a project started by the Canadian Mint to create a government backed cryptocurrency. It was announced in 2012 with a MintChip Challange to develop various project concepts that would use the MintChip. Unfortunately, the project was stopped recently. I followed and analyzed the project early on, and I would like to share with you my ideas on what the MintChip could've done to the Bitcoin space and the Canadian consumers in general.


MintChip at a glance

First of all, lets get everyone up to speed about what the MintChip is or could've been. A number of hints have been released about the project, although a full technical specification was never released. I did approach a representative of the Canadian Mint during Money 2020 conference in 2013 about the algorithms behind the MintChip and the only answer I got was that it was above their pay grade. Regardless, here are some properties of the MintChip we can speculate would be part of the final implementation:
  • MintChip would operate in CAD and the currency itself would be backed in 100% by the Canadian Mint in form of Canadian Dollar currency. No fractional reserve.
  • Unlike Bitcoin, the currency would need to be able to be generated as needed. There would be no mining or anything like that. This suggests the system might be closer to Ripple or Open Transactions.
  • The system would facilitate payments of less than $1. This would probably mean payments would be cheap and there would be possibility of micropayments, unlike with credit cards.
  • Payments are instant and irrevocable
  • There is no restriction to who can use MintChip, it would probably be an anonymous system
  • MintChip would probably take a form of a proprietary hardware.
  • Transactions in MintChip could hapen between two people without either of them being connected to any network. This would probably mean the transaction data is stored in the hardware and the hardware would be forcing those rules. Without proprietary hardware and software this would probably be impossible.
The most important takeaways from this would be that MintChip would be operated by Canadian Mint, would be fully backed by CAD and that would be the currency used in the system. MintChip would be most likely as anonymous as Bitcoin and would allow anyone to make person-to-person payments at minimal cost. Proprietary hardware and lack of need for Internet connection are a take it or leave it bundle. If done away with, MintChip could be implemented in systems like Ripple, Mastercoin or Ethereum quite easily.

Now lets talk about what implications MintChip could've had if the project was ever fully realized...

Digital currency for everyone

Probably the biggest implication of MintChip would be that suddenly people could use digital currencies to replace a big chunk of their banking needs. This would have a big impact on a lot of Bitcoin businesses that are unbankable just due to the sole fact that they are dealing with Bitcoin. Bitcoin Exchanges would be using MintChip as a way of depositing and withdrawing money, people selling Bitcoins face-to-face could do so without the hassle of handling cash.

Introduction of MintChip would greatly lower the barrier to entry into Bitcoin. You would probably be able to go to any Canada Post location or to a bank and deposit money into MintChip. Canada Post would probably ask you no questions - they would probably handle your deposit just as gladly as they would sell you a silver coin from the Mint. The banks couldn't question why you would want to deposit money to MintChip, since they wouldn't know what you would be using it for later. Right now if you send money frequently to a Bitcoin Exchange, they might start questioning it and trying to stop it. I doubt they would be able to stop you depositing money to MintChip any more than they would stop you from withdrawing cash - both would be legal tender in Canada.

Adoption by businesses

Since the CAD on MintChip could easily be converted to cash, it would probably be slowly adopted by more and more businesses. You might be able to use it to pay your rent, buy groceries, pay bills, shop online, etc. A lot of businesses would love this solution - low fees, no chargebacks, it would be like having a credit card terminal only with less hassle, costs and chargebacks.

Probably a number of Bitcoin adopters would push for anyone they pay money to to adopt MintChip as a means of payment. This would allow them to bypass the banks entirely and be able to handle more and more of their business only in Bitcoin and MintChip. The Bitcoin adopters would probably love this idea since it would mean they don't have to worry about their banks shutting their accounts down if they exchange their BTC for CAD on a regular basis.

Decline of credit cards; be your own bank

There are people that use credit cards to purchase things they can't afford at the time. MintChip would not be for them. However, there are people that use credit cards just as a means of settling payments and they don't care about the credit. If MintChip was more widely adopted, they could move some or all of their purchases from credit cards onto MintChip.

This would work similarly if banks weren't making the use of debit cards something abnormal. Coming from Europe, debit cards are the norm. In Canada, credit cards are the norm and if you want to use a debit card you are charged some crazy fees for no reason...

Similarly, if people would be using their MintChips more often they would be more inclined to hold some of their savings on it. Just like with Bitcoin, with MintChip you could be your own bank. Nobody could freeze your account, take your money away, and you could transact in it as you would see fit.

Conclusion

It is a shame the MintChip project was cancelled. A government-backed cryptocurrency would break the iron hold banks have on the monopoly of digital money and allow Bitcoin users to transact the way they see fit without the fear of having their bank accounts shut down.

2014-04-16

A few criticisms of Ethereum

Ethereum is probably one of the most hyped projects in the cryptocurrency space as of late. It certainly gained more exposure from the Toronto Bitcoin Expo that took place last weekend and we can safely say whether it booms, busts or fizzles, everyone will know about it.

I recently took more time to do some more research on the project after my piece on Crypto 2.0 Systems and would like to give you some of my impressions of what I think is and might be an issue in regards to the project. Please keep in mind that I might be wrong in some areas, by no means do I claim to know everything about the project. Also please note that the project is still in development so those insights might become invalid with time.

Now, without further ado...

Technical aspects


Namecoin, it is not

For awhile now Ethereum was advertising itself as being able to replace Namecoin. Even in the whitepaper there is a section on that, not to mention t-shirts and what have you. Well, looking at the matter a bit deeper it doesn't look like Namecoin will become obsolete just yet...

What is the purpose of Namecoin? To create a decentralized DNS and allow anyone to register their domains on it. The system has a defined and unique state - either a domain is registered, or it is not, there is no ambiguity.

In Ethereum a DNS would be implementing some simple key-value storage. For example, assigning "127.0.0.1" to "foo.com". However, where is the data stored? Well, in Ethereum each account and each contract have their own data storage. There is no centralized data storage, which means custom data can only be stored in this way. This in turn means that there will never be one unique DNS in Ethereum, just a set of DNSs each different for each contract that creates them. Depending on which one you will read from, you may get different results for the same domain. If there will be some canonic DNS contract that everyone will agree to use, the problem is more negligible, but the fact still stands that until that happens there will be little use for such domains.

Create a currency, it might not be that simple...

Many Crypto 2.0 systems are built to deal with any number of currencies. Ethereum lets you do that with their scripting language. You can create a contract to issue and transfer currency easily. However, once you stop and think what is actually required for a currency to function well, the problem is not that simple.

First of all, you need a way to track how much money everyone has. This is simple. Secondly, you need a way to move money from one person to another. This is also simple. Next, the currency needs an issuer, which makes things more complicated.

We could take an approach similar to Ripple when it comes to currency issuers, and that would be the concept of a Gateway. The same currency from two different Gateways is not the same currency, similarly how BTC at MtGox is different from BTC at Bitstamp. This approach would work for any currency, be it fiat or digital. Implementing an option for a Gateway to create any currency in a contract shouldn't be too hard, but we would probably end up with a separate contract for each Gateway. This may complicate some other issues.

Another approach that might work for this could come in a form of Ethereum having awareness of what happens in other currencies. One could create a contract that creates a piece of currency in Ethereum each time a transaction sends money to a given address in say, Bitcoin. This approach would work well if you want to have proof-of-burn currencies, but wouldn't work too well if you would want to redeem the currency back in its original blockchain, unless that system would have some knowledge of the Ethereum blockchain. All in all it could allow for creating a currency without an issuer, but it would be more complicated than the Gateway approach.

So all in all, we would most likely end up having multiple contracts for multiple currencies. Now, to make those currencies more useful, we need to be able to trade them for one another. This probably would be the hardest and most resource-intensive task to be honest. A proper exchange engine needs to store data on users' balances, how much of their funds are frozen in trades, what trades they have issued, details about those trades, be able to sort those trades based on the price, match them in an order of price and date and do so in an effective manner. Now don't get me started on trading multiple currencies in a row to hop between them and get the final currency we want. Also, the engine would more often than not interface with arbitrary two Gateway contracts...

I have personally implemented a trade engine for a Bitcoin exchange, and believe me, it wasn't a code that was short or easy. I doubt creating a feature-complete decentralized exchange in Ethereum will be a straightforward task. It's easy to say that you can create any currency, it's a lot harder to make that currency do everything it needs to do.

Incentives and data bloating...

From what I heard from the Ethereum developers, the software will be running in a strict sandbox. It will not have access to anything outside of the Ethereum blockchain essentially. In order to use data from the outside world, someone will need to put that data into Ethereum explicitly. This is most often discussed in terms of say, price tickers for financial derivatives, but was also mentioned for fetching data from other blockchains and so forth. Since the data could swing an outcome of a contract, it would have to be provided by third parties that have no stake in the outcome.

Now the question is, what incentive would anyone have to be putting that data into the blockchain? If each transaction would cost a fee, they would be losing money with each new data point pushed into the blockchain. Similarly, not everyone might be interested in that data while they would have to store and process it all the time. For small pieces of data like a price ticker, I can see exchanges providing that service at their own cost, or someone running a donation-fuelled ticker. For bigger pieces of data, like info on external transactions, it might be a fee-for-service. At any rate, something like this would have to be kept in mind when discussing such need for data - it won't just magically appear in the blockchain.

I also wonder how data from external blockchains will be included into Ethereum. If we wanted to include data in a trust-less way for say, a transaction happening in Bitcoin, we would need to provide the transaction data, then add the merkle branch and a block header to prove that the transaction is a part of a block, and then perhaps an entire block header chain to show that the blocks are not fake? Alternatively, we could use trusted third parties to only provide informations on confirmed transactions.

All in all, it will certainly be interesting to see what solutions are used for this problem.

Non-technical aspects


Contracts and incentives

What is the incentive of creating a useful service for currencies like Bitcoin? People will want to use your services and you can charge them fees for doing so. What is the incentive of creating useful contracts in Ethereum? If you are from the core Ethereum team, you want to create them to make Ethereum more useful and boost adoption. If you are not, there probably isn't much money to be earned in the long run. If you create a contract that charges a fee, from what I understand it anyone can create a copy of that contract, remove the fee code and use that instead. Any contract you use anyone else can use, so you don't have exclusivity. You probably can expect some bounty for developing some useful code in the system, but I am yet to see any specific details about that. All in all, I think monetizing on creating new, useful contracts in Ethereum might be a problem for the system.

It's all about the interface

If you create the most useful service there is but the only way to communicate with it is through a command line or creating some code, few people will use it. Similarly in Ethereum creating a contract might only be half of the job. The other half would be creating a good user interface for people to be able to use your contract in a meaningful way. I think this aspect is not emphasized enough at this point and may put a lot of people off when they get their first impressions of Ethereum.

DAO hype

Decentralized Autonomous Organizations are an interesting concept promoted by Ethereum. In essence, it will allow groups to organize themselves in any way they see fit and allow for decentralized voting, money management and so forth. I have heard a number of people talk about how useful it will be to organize themselves as a DAO and what have you. Thinking about this, I don't believe DAOs will be the silver bullet to a lot of problems that some people make it out to be.

First of all, lets discuss the good things. Decentralized money management idea is great. It certainly would be useful to decentralized organizations. A decentralized voting system, well, it serves its purpose and as long as there is some good way to interface with it it might be better than running some centralized voting server. I don't see it as that much of an improvement, but there are some die-heart decentralized proponents out there, so they might find it useful.

The main problem with DAOs is their interface to the real world. Since the code is not an enforceable law just yet, DAO has as much impact on a group of people as they let it. Anything that is voted on that has an impact on the external world outside of Ethereum still has to go through the human filter before it takes an effect. If a DAO lets anyone put forward any proposal and let other people vote on it, who cares if 51% of people would vote on what colour to use in a room if the person owning the room wouldn't want to paint it anyway? Similarly, using democratic voting as a means to solve every problem would be as effective as doing a popularity context or going by mob rule. Unless a DAO contract has a code to represent every rule an organization would like to apply in a given context, it might not be as useful as organizing oneself in a more traditional fashion.

Personally, I am yet to see some good examples of what a DAO might be useful for (asides the mentioned money management and decentralized voting). I am guessing like many new ideas it is something worth exploring and iterating over, but it might not be what people thing it is.

Technical lead and presenting Ethereum to the public

I had an occasion to see Vitalik present the concept of Ethereum a few times. It appears that the project wants to put him forward quite often to do this sort of talks. My personal impression of him however, is that while he is technically proficient and may be the most knowledgeable person on Ethereum, he might not be the best person to be doing such presentations.

Vitalik shines when he is talking about and presenting some technical aspects that he knows about - be it talking about Simplified Payment Verification or creating various contracts in Ethereum. However, when it comes to more non-technical concepts, he isn't the best speaker. Similarly, putting him forward to explain Ethereum to mainly non-technical people might be a poor use of him as a resource.

I personally think the Ethereum team might benefit from having a more extrovert person that focuses on explaining Ethereum to non-technical people, and bringing in Vitalik to focus on the technical aspects of what they are developing. Using Vitalik for everything isn't all that optimal.

Nitpicks


Lets name all the denominations

Someone thought it would be a great idea to name all various denominations used in Ethereum. I wonder how many people will be using more than wei and ether, or remember the order those units come in. Coming from a metric background kilos and milis make sense to me and I can easily convert any orders of magnitude between piko and peta. If Ethereum will be pushing for those units to be used, we might end up with nonsense like the imperial system of units:




Summary

To sum all up, the Ethereum project isn't as easy as some people would believe. At the same time, I am looking forward to reading any counterpoints the Ethereum team might have to the above points so that I can better understand their project.

Useful links:


EDIT:

After sharing this post with the Ethereum community on Reddit, I got a few responses to my points. Be sure to read them as well.

2014-04-15

Toronto Bitcoin Expo, a quick look

Over the last weekend I was in Toronto for the Bitcoin Expo conference. Here is my overall impression of the event. I will probably elaborate on a few things in a later post.

Overall remarks

Looking back at the event, I personally feel it was promoting a few of its key sponsors - mainly Ethereum and CAVirtex. Both of them had large expo booths and were represented in multiple panels. Perhaps it is fitting since they are the two largest sponsors of the event, but I personally become saturated with them quickly.

To some extent, what was being presented wasn't much of news to anyone that keeps up to date with Bitcoin. Most of us already know that taxation with Bitcoin is a pain, that the laws surrounding Bitcoin are complicated and vary from place to place, and know about the various levels of security of Bitcoin wallets.

That being said, it was interesting to hear some peoples' opinions on a few matters. So lets get to it.

Quick summary

For those that want just a bite-size summary of what someone like myself took away from the conference, here it is:

  • Future of crypto currencies is not one global coin, it's plurality of coins. If a new currency is useful or beneficial in some way to some people, it will be used. We will have currencies specific to apps (like Air Miles or StackExchange reputation), tokens for various resources (say, payment for decentralized storage in decentralized Dropboxes or what have you), branded currencies (by companies, celebrities and whoever), as well as a plethora of others.
  • In the near future, if something can be decentralized, it will be. During the hackathon we had a decentralized Silk Road-style application created. Decentralized storage will soon be upon us. We have decentralized exchanges in form of Ripple and MasterCoin. Ethereum is decentralizing a lot of other things. All in all, soon we will have a number of things that will be decentralized just because it can be done.
  • Joseph David believes that Canadian senate hearing on cryptocurrencies went well and that the Canadian senate is looking favourably at Bitcoin. He regrets not putting enough emphasis on merchant protection and anti-chargeback features of Bitcoin.
  • There are so many opportunities in the Bitcoin space right now that most companies have to turn them down by the numbers and just focus on one or two things. This is a great time to be a developer, just like in the early days of the Internet.
  • Taxation and laws surrounding Bitcoin are complex and can vary from individual to individual. Best consult your lawyer and/or accountant while dealing in them. Alternatively, if you want to develop some all-in-one solution for handling Bitcoin taxation, you will have a lot of clients eager to throw money at you.
  • As usual, you should use good security when handling money. No one person should be able to make a significant withdrawal. Also, be aware of crafty people that use social engineering to try getting access to your site. Fake IDs are cheap, fake social profiles are cheap, and minimum KYC requirements are not enough for minimum security requirements when dealing with account resets and so forth.
  • Global Bitcoin Alliance is a really good organization to represent Bitcoin users. If you want to create your local branch, they already have all the resources you need.

Other

And some other random small remarks from the conference:

  • If you are a non-technical person making statements on the technical aspects of Bitcoin, you better do your research and do it good. One of the speakers was making a few claims along the lines of "Bitcoin Foundation owns the Bitcoin development team", "The dev team can make any change to the software sometimes against the community's will" (in regards to the lowering of the fees in Bitcoin Core), or that "Satoshi was probably Japanese, so for him high speed Internet was the norm, that's why future scalability of Bitcoin wasn't an issue for him". Ron Gross debunked all of such baseless claims in a great way. But the fact still remains - do your research and don't try spreading misconceptions.
  • There are some people that are good speakers and there are some people that don't work well on a panel. I won't be pointing fingers, but I would say that half of the people speaking at one panel weren't that good and it was rather painful to sit through.
  • To one of the people representing Blackcoin at the conference - if you are talking with a panellist after their talk with about 10 minutes to the next panel, be brief and let other people talk with them as well. It was rather annoying just standing there listening to a dragged-out conversation while there were about 5 other people that wanted to quickly engage with one of the panellists.

I think this about wraps up some basic remarks from the conference. I might expand on a few topics in a future post if there will be anything worth remarking about. I'm still mulling over the conference.