Cryptocurrency Design Patterns – Hacker Noon
Learn how to analyse and design cryptocurrencies with these building blocks.
Travelers, there is no path, paths are made by walking. — Antonio Machado
At TechHQ I’ve had the privilege to do the early stage design of many solutions proposing to use blockchain for different purposes. I’ve often been surprised by the ease with which the building blocks for each design are reused once and again.
In this article I’m going to describe a number of those building blocks that I use frequently along with some references to real implementations. The content in this article is at the high level that is usually required to quickly describe the solution to investors and create a conceptual design.
I’ve been writing other more detailed articles describing some of these building blocks along with working examples and would be keen on creating more, please reply on the comments if you wish to see a specific one.
One striking fact has been the ease with these patterns can be reused once and again.
All the building blocks in this introductory article describe cryptocurrencies, which are the most popular solutions using blockchain.
At the core of most blockchain applications there is some sort of document registry which is used like a database, exploiting two properties of the technology:
- Immutability, providing absolute trust that the stored data hasn’t been tampered with.
- Decentralization, and more specifically as dilution of responsibility so that no participant is capable of bringing down the solution by malice, negligence or disinterest.
A Document Registry implemented with blockchain technology is a radical departure from existing database solutions in that it offers a very low barrier of entry for new corporate participants. The document registry can be designed so that it can’t be negatively affected by any participant. Potential participants can be allowed to join with few requisites and the Document Registry has a good chance of becoming an industry standard.
The trade off in a Blockchain Document Registry is the very high cost of storage which makes it suitable only for critical data. Often only the cryptographic hashes of data are stored, which allow for authenticating files kept elsewhere.
At the heart of most blockchain applications there is some sort of Document Registry.
When implemented as an economy it tends to be a simple service where users pay for storing information in the registry.
For our proposal for a law firm a simple Document Registry pattern was used so that they could store legal documents with certainty that they hadn’t been tampered with after uploading it. Many other uses of this pattern are easy to find.
When implementing a Currency a number of elements must be added to a plain Document Registry:
- Accounts which imply methods for knowing their balance and effect transactions.
- A method to control currency supply.
- A framework to control exchanging or not the currency for others.
Governance and token supply are complex matters, reason for which I’m always very careful before proposing a cryptocurrency for corporate environments. In our implementation of the Wedoo platform we used Stellar to implement their currency which took care of the standard features for currency accounts and transfers, as well as making the currency available in a public exchange. Therefore the only additional complexity would come from managing the token supply.
A Currency is the most popular solution implemented with blockchain technology.
The monetization patterns of a currency are either as a fee collected on transactions, or the holding of a pool that will increase in value as the adoption of the currency and its valuation grow. Banking on the rising price of a cryptocurrency soon attracted the attention of regulators and nowadays it is very important to have legal advice if trying to do so.
In Bitcoin the Document Registry pattern is used to record the transactions, and it is useful to differentiate this from the other Bitcoin features that belong in the blockchain infrastructure layer, such as the consensus algorithm.
A stablecoin is a currency with a reserve account and a mechanism to support the currency value with either real assets or other cryptocurrencies, buying and selling backing assets from the currency account as the currency itself is bought or sold.
The strongest selling point of a stablecoin is that it combines the low volatility of fiat with the technological improvements of cryptocurrencies such as micropayments and smart contracts.
However keeping the reserve account within the projected parameters, and convincing users that this is the case, is not trivial. It requires at least thinking carefully about how the stablecoin will be exchanged for other currencies and how to manage the confidence of currency holders in the future viability of the stablecoin. Third party audits are a mechanism to help with this and the legal aspect is huge.
The monetization pattern for a stablecoin is always fees on transactions and possibly financial management of the reserve account, since the currency price remains stable and cannot be used as a source of revenue.
A stablecoin combines the stability of fiat with the agility of cryptocurrencies.
For CementDAO we implemented a meta-stablecoin and kept a reserve account in a basket of stablecoins, a solution that avoided a number of legal issues on asset holding, as well as technical challenges about asset price finding and non-blockchain market integration.
Cryptofiat is a variation on the Stablecoin in which the token is said to be a fiat currency, with the only goal of aiding in the automatization of payments. This is no different from the way that bank balances are traditionally maintained, just using a blockchain implementation instead of a centralized database. A cryptofiat implementation possibly requires a banking license that allows the solution owners to perform transactions in the fiat denomination for account holders.
The monetization patterns for cryptofiat would be identical as those for stablecoins.
This was the chosen implementation for the Strea project that TechHQ prototyped at the Pioneers Energy Hackathon in Switzerland. A cryptofiat implementation allows for many of the benefits of using a cryptocurrency, while being more easily understood by users that don’t even need to know that there is a cryptocurrency implementation at all.
This is a traditional bank balance with a blockchain implementation instead of a centralized database.
A non-blockchain example of this pattern is none other than Paypal, which in reality acts as a bank that doesn’t provide any financial products apart from plain accounts. A few of the challenges with this pattern such as the currency having an effective value which is below the physical fiat due to the fees charged to withdraw money from the account. These fees are enforced to maintain the Paypal cash reserves as high as possible, enabling it to perform safely.
A security token is implemented like a cryptocurrency but with the purpose of representing ownership of an asset instead of as an enabler of transactions. The ERC721 standard is often used for this purpose, as each of its tokens is uniquely identifiable and not divisible. The ERC1404 standard is another implementation that is useful for this purpose, in that it implements restrictions on operations that can be used to comply with KYC and AML regulations.
For the issuer a Security Token can be considered as a financial instrument akin to stocks, that allows to raise funds in exchange for a stake in a business venture. The Security Token buyers expect the token to raise in price and sometimes for other rewards to be received, similarly to dividends in stocks.
A security token is implemented to represent ownership of an asset.
Security Tokens came to the limelight as regulators started paying more attention to ICOs, with the result of cryptocurrencies splitting mostly into utility tokens which are used to enable a blockchain economy to function, and security tokens that represent assets and are traded as investment vehicles. At this point the Initial Coin Offerings (ICOs) got mostly overshadowed by Security Token Offerings (STOs).
In this article we have shown a number of cryptocurrency related patterns that have appeared since the introduction of blockchain technology, and that get reused again and again in many different forms. Of all these the most basic is just a Document Registry which provides data storage with the immutability and decentralization properties of blockchain technology.
On top of a Document Registry that maintains currency transactions it is possible to build a classic cryptocurrency like Bitcoin, and after some development further patterns such as stablecoins and security tokens appeared as well. These more advanced patterns have considerably widened the scenarios in which blockchain technology can be employed to challenge the status quo.
In the next article of this series we will dive into less popular patterns, which might hold the key for the disruption of a number of major industries, stay tuned!
Article initially published in the TechHQ blog.