28,14 €
A complete guide to understanding, developing, and testing popular security-token smart contracts
Key Features
Book Description
The failure of initial coin offerings (ICOs) is no accident, as most ICOs do not link to a real asset and are not regulated. Realizing the shortcomings of ICOs, the blockchain community and potential investors embraced security token offerings (STOs) and stablecoins enthusiastically.
In this book, we start with an overview of the blockchain technology along with its basic concepts. We introduce the concept behind STO, and cover the basic requirements for launching a STO and the relevant regulations governing its issuance. We discuss U.S. securities laws development in launching security digital tokens using blockchain technology and show some real use cases. We also explore the process of STO launches and legal considerations. We introduce popular security tokens in the current blockchain space and talk about how to develop a security token DApp, including smart contract development for ERC1404 tokens. Later, you'll learn to build frontend side functionalities to interact with smart contracts. Finally, we discuss stablecoin technical design functionalities for issuing and operating STO tokens by interacting with Ethereum smart contracts.
By the end of this book, you will have learned more about STOs and gained a detailed knowledge of building relevant applications—all with the help of practical examples.
What you will learn
Who this book is for
This book is ideal for blockchain beginners and business user developers who want to quickly master popular Security Token Offerings and stablecoins. Readers will learn how to develop blockchain/digital cryptos, guided by U.S. securities laws and utilizing some real use cases. Prior exposure to an Object-Oriented Programming language such as JavaScript would be an advantage, but is not mandatory.
Das E-Book können Sie in Legimi-Apps oder einer beliebigen App lesen, die das folgende Format unterstützen:
Seitenzahl: 298
Veröffentlichungsjahr: 2019
Copyright © 2019 Packt Publishing
All rights reserved. No part of this book may be reproduced, stored in a retrieval system, or transmitted in any form or by any means, without the prior written permission of the publisher, except in the case of brief quotations embedded in critical articles or reviews.
Every effort has been made in the preparation of this book to ensure the accuracy of the information presented. However, the information contained in this book is sold without warranty, either express or implied. Neither the authors, nor Packt Publishing or its dealers and distributors, will be held liable for any damages caused or alleged to have been caused directly or indirectly by this book.
Packt Publishing has endeavored to provide trademark information about all of the companies and products mentioned in this book by the appropriate use of capitals. However, Packt Publishing cannot guarantee the accuracy of this information.
Commissioning Editor: Sunith ShettyAcquisition Editor:Joshua NadarContent Development Editor: Pratik Andrade, Anugraha ArunagiriTechnical Editor: Jovita AlvaCopy Editor: Safis EditingProject Coordinator:Namrata SwettaProofreader: Safis EditingIndexer:Rekha NairGraphics:Jisha ChirayilProduction Coordinator:Shraddha Falebhai
First published: April 2019
Production reference: 1300419
Published by Packt Publishing Ltd. Livery Place 35 Livery Street Birmingham B3 2PB, UK.
ISBN 978-1-83855-106-3
www.packtpub.com
Mapt is an online digital library that gives you full access to over 5,000 books and videos, as well as industry leading tools to help you plan your personal development and advance your career. For more information, please visit our website.
Spend less time learning and more time coding with practical eBooks and Videos from over 4,000 industry professionals
Improve your learning with Skill Plans built especially for you
Get a free eBook or video every month
Mapt is fully searchable
Copy and paste, print, and bookmark content
Did you know that Packt offers eBook versions of every book published, with PDF and ePub files available? You can upgrade to the eBook version at www.packt.com and as a print book customer, you are entitled to a discount on the eBook copy. Get in touch with us at [email protected] for more details.
At www.packt.com, you can also read a collection of free technical articles, sign up for a range of free newsletters, and receive exclusive discounts and offers on Packt books and eBooks.
Weimin Sun has 20 years' of experience working in the financial industry. He has worked for top-tier investment and commercial banks such as J.P. Morgan, Bank of America, Citibank, and Morgan Stanley, where he also managed large teams for developing IT applications. Weimin has also held corporate titles such as executive director and senior VP in some of these firms. Weimin has in-depth knowledge of the blockchain technology, data science, data architecture, data modeling, and big data platforms. He holds Ph.D, M.B.A and M.Sc degrees. He has co-authored Blockchain Quick Start Guide and published several statistical journal papers.
Xun (Brian) Wu has more than 17 years of extensive, hands-on design and development experience with blockchain, big data, cloud, UI, and systems infrastructure. He has coauthored a number of books, including Seven NoSQL Databases in a Week, Blockchain by Example, Hyperledger Cookbook, Learning Ethereum, and Blockchain Quick Start Guide. He has been a technical reviewer on more than 50 technical books for Packt Publishing. He serves as a board adviser for several blockchain start-ups and owns several patents on blockchain. Brian also holds an NJIT computer science M.Sc degree. He lives in New Jersey with his two beautiful daughters, Bridget and Charlotte.
Angela Kwok, is a lawyer, specializing in high-tech and blockchain start-ups and venture capital financing. She also focuses on general corporate and commercial matters, fund formation, cross-border and domestic investments, mergers and acquisitions, and related tax matters in the TMT industry. She has represented clients in blockchain-related cases.
Maximiliano Santos works as an architect for IBM Cloud Garage, São Paulo. He has developed complex software architectures for the banking, real estate, insurance, chemical, and consumer goods industries. Max has designed solutions using IBM Watson's cognitive services, an Internet of Things (IoT) platform, as well as machine learning and mobile applications.
Ankur Daharwal started his journey into blockchain with IBM Blockchain Garage in 2016. As a technology enthusiast and expert in both public and enterprise blockchains, he has been part of the decentralized world for around 3 years now. He has successfully developed and delivered numerous blockchain projects. He has devoted his career to devising real-life solutions for asset management and value exchange in a plethora of industry use cases worldwide. As an advisor to many blockchain startups, he focuses on providing expert guidance and solutions. Ankur strongly believes in fulfilling social responsibilities and supporting humanitarian causes with the use of his skills in technology.
If you're interested in becoming an author for Packt, please visit authors.packtpub.com and apply today. We have worked with thousands of developers and tech professionals, just like you, to help them share their insight with the global tech community. You can make a general application, apply for a specific hot topic that we are recruiting an author for, or submit your own idea.
Title Page
Copyright and Credits
Security Tokens and Stablecoins Quick Start Guide
About Packt
Why subscribe?
Packt.com
Contributors
About the authors
About the reviewers
Packt is searching for authors like you
Preface
Who this book is for
What this book covers
To get the most out of this book
Download the example code files
Download the color images
Conventions used
Get in touch
Reviews
Introduction to Blockchain
A brief overview of the blockchain technology
Bitcoin
Ethereum
Evolution of blockchain
Bitcoin basics
The distributed ledger
The consensus mechanism
Keys and digital wallets
Ethereum basics
Ethereum cryptocurrency and tokens
Smart contract
Ethereum virtual machine
Ethereum gas
Account
Oracle
Off-the-chain data
PoS
Performance considerations
Miscellaneous comments
Summary
STO - Security Token Offering
A traditional fund raising roadmap for startups
Seed money
Angel investors and angel funds
VC fund
Private equity firms
Mezzanine capital/fund
IPO
Pros
Cons
The initial coin offering
Coins and tokens
Crowdfunding
ICO and its difference to IPO
The ICO bubble
The STO
Security
STO verses ICO
STO versus IPO
Challenges of STOs
Summary
Monetizing Digital Tokens Under US Security Laws
What is an STO?
Overview of US securities laws
Federal regulations
Section 5 of the Securities Act of 1933
Section 3(b)(1) and (2) / Regulation A/A+ offerings (Mini IPOs)
Exemptions to Section 5 of Securities Act of 1933
Section 4(a)(2) / Reg D – Rule 506(b) and (c) – private placement exemption
Section 3(b)(1)/ Rule 504 – small issuance
Limitation of Rule 504 and 506 – bad actor disqualifications
Section 4(a)(5) – accredited investor exemption
Section 4(a)(6) / Regulation Crowdfunding – crowdfunding exemption
Section 3(a)(11) / Rule 147 (added by JOBS Act 2012) – intrastate offering
Regulatory issues with respect to exemptions under the Securities Act
Other related regulatory regimes
Federal regulators
State regulations
Resale of securities Rule 144/144A/Section 4(a)(1½ ) / Section 4(a)(7)
Rule 144 exemption
Rule 144A exemption
Section 4(a)(1½) exemption
Section 4(a)(7) exemption
Securities laws development in blockchain and digital cryptocurrencies
SEC alerts
Report of Investigation Pursuant to Section 21(a) of the Exchange Act – The DAO (July 25, 2017) (the DAO report) – the application of the Howey test
Legal analysis by the SEC
SEC's conclusion
Security trading
Real cases
Munchee Inc. (Munchee order, December 11, 2017)
Legal analysis by the SEC
AirFox case (November, 2018)
Legal analysis by the SEC
The Paragon case (November, 2018)
Legal analysis by the SEC
SEC versus PlexCorps et al.
Crypto Asset Management case (September, 2018)
Legal analysis by the SEC
The TokenLot LLC case (September, 2018)
Legal analysis by the SEC
STO launch and legal considerations
Summary
Stablecoin
Basics of money
What is money?
Characteristics of money
Durability
Portability
Divisibility
Uniformity
Limited supply
Acceptability
Commodity money versus fiat currency
An example of a fiat currency– the USD
Basics of stablecoin
Cryptocurrency
What are stablecoins?
Are stablecoins really stable?
Types of stablecoins
Commodity-collateralized stablecoins
Fiat-collateralized stablecoins
Crypto-collateralized stablecoins
Non-collateralized stablecoins
Challenges of stablecoins
Summary
Security Token Smart Contracts
ERC-20 and ERC-721 token
ERC-20
ERC-721 – NFTs
Security token technical design overview
ERC-1400/ERC-1410
ST-20 (security token standard)
R-Token
SRC-20
DS-Token (Securitize)
Securitize's digital ownership architecture
ERC-1404
ERC-884
Introduction to smart contracts
Pragma
Comments
Import
Paths
State variables
Functions
Function modifiers
Events
struct
enum
Inheritance, abstract, and interface
Summary
Building a Security Token Dapp
STO smart contract development tools
Truffle
Ganache
Setting up an Ethereum development environment
Creating a security token Truffle project
Deploying security tokens to Ganache
Developing and testing a security token smart contract
Creating a smart contract
Implementing a smart contract
Defining your token information
Implementing detectTransferRestriction
Implementing messageForTransferRestriction
Implementing transfer and transferFrom
Testing a smart contract
Setting up and initializing the test case
Writing Dapp web components
Setting up a Dapp project
Cleaning boilerplates code
Defining the HTML template
Implementing the ERC1404 UI components
Loading accounts
transfer UI component
DetectTransferRestriction UI component
MessageForTransferRestriction UI component
AddAddressToWhitelist UI component
verifyWhitelist UI component
Summary
Stablecoin Smart Contracts
Quick primary stablecoin overview
Timeline of stablecoin development
Types of stablecoin
Fiat collateralized stablecoins
Crypto collateralized stablecoins
Non-collateralized stablecoins
Stablecoin technical design overview
Tether (USDT)
TrueUSD (TUSD) smart contract
modularERC20
Proxy
Admin
Other TUSD token-related contracts
MakerDAO (Dai)
USD coin (USDC)
Paxos Standard 
GUSD
ERC20Proxy
ERC20Impl
ERC20Store
JPM Coin
Summary
Other Books You May Enjoy
Leave a review - let other readers know what you think
During 2017 and 2018, the market values of the majority cryptocurrencies went through some eye-popping roller-coasters. In the span of three months, the price of Bitcoin went up from $6,336.94 (USD) on November 12, 2017, to its highest price of $19,758.2 on December 17, 2017, before dropping to $7,389.79 on February 5, 2018. As cryptocurrency prices moved up, funding for blockchain projects poured in. Most of them were in the form of initial coin offering (ICOs). One example is in May 2017, when a web browser called Brave completed an ICO. It raised $36 million in USD within the first 25 seconds of the ICO. The dramatic declining in cryptocurrency prices eventually led to the cooling down of the ICO madness. Per statistics from ICODATA.IO, during the first quarter of 2018, a total of $3,874 million USD were raised via ICOs. In contrast, during the first quarter of 2019, only $100 mm USD were raised through ICOs.
A fundamental reason for the high volatility in cryptocurrency prices and the ICO bubble bursting is the lack of control and regulations on ICOs. This led to a high failure rate of ICO-funded blockchain projects. Fewer than half of ICOs have survived over four months after their offerings, and nearly half (around 46%) of ICOs taking place in 2017 had failed by February 2018.
Facing the ICO issues, the blockchain community has started soul-searching for an alternative solution. The mainstream view of the blockchain community changed from focusing exclusively on the initial ICO model of raising funds, to funding models involving other parties (for example, governments, investment bankers, and lawyers). A leading solution is the security token offering (STO).
To help our audience gain an overview on the context of STOs quickly, in this book, we explain the basic concepts behind the blockchain technology, traditional funding approaches for startups, and the basics of STOs. We made comparisons between ICOs and STOs to explore the differences between them and the reasons that STOs can potentially provide a viable solution to resolve some of the ICO drawbacks. To help the reader understand the implications of STOs better, we dedicate one chapter (Chapter 3, Monetize Digital Tokens Under U.S. Securities Laws) to covering some of applicable laws on STOs. For IT practitioners, we show a way to implement an end-to-end Dapp for the issuance of a security token. In fairness, STOs are not necessarily perfect neither. At the end of Chapter 2, STO – Security Token Offering, we point out some challenges faced by STOs.
Stablecoin is a solution that the blockchain community came up with to address the high volatility issue in cryptocurrency prices. In this book, we first cover the basics on money. We then proceed to illustrations on different types of money. This lays the foundation for explaining the concepts on stablecoin. In Chapter 7, Stablecoin Smart Contracts, we give a working example on how to implement stablecoin issuance.
This book is ideal for blockchain beginners and business user developers who want to quickly master popular Security Token Offerings and stablecoins. Readers will learn how to develop blockchain/digital cryptos, guided by U.S. securities laws and utilizing some real use cases. Prior exposure to an Object-Oriented Programming language such as JavaScript would be an advantage, but is not mandatory.
Chapter 1, Introduction to Blockchain, gives an overview of blockchain technology, along with the key concepts involved, including the distributed ledger, transactions, blocks, proof of work, mining, and consensus. It covers bitcoin, the mother of blockchain technology, and Ethereum, which developed out of bitcoin, in detail.
Chapter 2, STO – Security Token Offering, talks about traditional fundraising methods such as angel funds, venture capital (VC) funds, private equity funds, and initial public offerings (IPOs). It then covers the blockchain project's specific funding method, ICO. Drawbacks of ICOs have been discussed as well. STO has been introduced as a promising alternative to ICO. The chapter compares STOs and ICOs. It ends by pointing out some of the challenges related to STOs.
Chapter 3, Monetizing Digital Tokens Under U.S. Security Laws, answers the question, "What is an STO under U.S. securities law?" It gives an overview of applicable U.S. securities laws, talking about the developments in U.S. securities laws related to blockchain and cryptocurrency. It then explains the process of STO launches, along with some legal considerations. The chapter mainly focus on U.S. securities laws.
Chapter 4, Stablecoin, talks about the definition of money, along with its basics. It then proceeds to a discussion on the concepts of cryptocurrency and stablecoins. It explains the rationale behind the implementation of stablecoins and discusses the types of stablecoins on offer. At the end, the chapter covers the challenges faced by stablecoins.
Chapter 5, Security Token Smart Contracts, covers popular security token standards such as ERC-1400/ERC-1410, R-Token, DS-Token, SRC-20, ST-20, S3, ERC-884, ERC-1450, and ERC-1404. The chapter helps to enrich the reader's knowledge of security token protocols. In addition, it talks about solidity programming fundamentals and explains how to write a smart contract.
Chapter 6, Building a Security Token Dapp, demonstrates how to develop an end-to-end product, from smart contracts to Dapp, to issuing an ERC-1404 security token. The chapter covers some basic concepts only. In a real application, the security token will be far more complex. Many security tokens run on an elaborate ecosystem and need to comply with the SEC's regulation on securities trading. For example, the security token smart contract needs to incorporate real-world legal contracts.
Chapter 7, Stablecoin Smart Contracts, reviews the basic features of popular stablecoins and covers three types of stablecoins, including fiat-collateralized stablecoins, crypto-collateralized stablecoins, and non-collateralized stablecoins. Then, it looks into USDT, DAI, TUSD, USDC, GUSD, and PAX stablecoin smart contract design, exploring the functions defined in these contracts. The chapter explains how each stablecoin type maintains the 1:1 price pegging through mint, burn, and other controllable functions.
We've focused on organizing the book to fit business and IT beginners in blockchain technology. The chapters are arranged to ensure that they can be followed easily and flow naturally.
Business users can skip the chapters with detailed descriptions on how to develop STO and stablecoin applications and, instead, focus on the chapters with general descriptions of the STO and stablecoin concepts.
IT professionals should read all chapters to gain insights on the business and regulation context for STO and stablecoins, from which a reader will gain basic knowledge on how to build STO and stablecoin applications. It is recommended that IT users download the code and make modifications to adopt the code to their own use cases or exercises.
Chapter 3, Monetize Digital Tokens Under U.S. Security Laws, and other chapters of the book are for general knowledge of the U.S. securities laws and other laws, and shall not be considered as providing legal advice, opinions, or recommendations. For any legal issues concerning the STOs, please consult an attorney specialized in this area.
You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packt.com/support and register to have the files emailed directly to you.
You can download the code files by following these steps:
Log in or register at
www.packt.com
.
Select the
SUPPORT
tab.
Click on
Code Downloads & Errata
.
Enter the name of the book in the
Search
box and follow the onscreen instructions.
Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:
WinRAR/7-Zip for Windows
Zipeg/iZip/UnRarX for Mac
7-Zip/PeaZip for Linux
The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Security-Tokens-and-Stablecoins-Quick-Start-Guide. In case there's an update to the code, it will be updated on the existing GitHub repository.
We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. You can download it here: https://www.packtpub.com/sites/default/files/downloads/9781838551063_ColorImages.pdf.
Feedback from our readers is always welcome.
General feedback: If you have questions about any aspect of this book, mention the book title in the subject of your message and email us at [email protected].
Errata: Although we have taken every care to ensure the accuracy of our content, mistakes do happen. If you have found a mistake in this book, we would be grateful if you would report this to us. Please visit www.packt.com/submit-errata, selecting your book, clicking on the Errata Submission Form link, and entering the details.
Piracy: If you come across any illegal copies of our works in any form on the Internet, we would be grateful if you would provide us with the location address or website name. Please contact us at [email protected] with a link to the material.
If you are interested in becoming an author: If there is a topic that you have expertise in and you are interested in either writing or contributing to a book, please visit authors.packtpub.com.
Please leave a review. Once you have read and used this book, why not leave a review on the site that you purchased it from? Potential readers can then see and use your unbiased opinion to make purchase decisions, we at Packt can understand what you think about our products, and our authors can see your feedback on their book. Thank you!
For more information about Packt, please visit packt.com.
In this chapter, we give an overview of blockchain technology, along with its key concepts, such as the distributed ledger, transactions, blocks, proof of work, mining, consensus, and so on. We will cover bitcoin, the mother of blockchain technology, and Ethereum, which was developed out of bitcoin, in detail. We will then proceed to the discussion of initial coin offerings (ICOs) and security token offerings (STOs) in Chapter 2, STO – Security Token Offering. Chapter 3, Monetizing Digital Tokens Under US Security Laws, is dedicated to STO-related laws and regulations. We will cover the basics on stablecoins in Chapter 4, Stablecoin. Chapter 5, Security Token Smart Contracts, and Chapter 6, Building a Security Token Dapp, demonstrate how to build frontend and backend applications to issue security tokens, along with examples. The last two chapters talk about how to build a stablecoins frontend and backend applications.
In this chapter, we cover the following specific topics:
A brief overview of the blockchain technology
Bitcoin basics
Ethereum basics
Miscellaneous comments
In October 2008, Satoshi Nakamoto published a landmark white paper titled Bitcoin: A Peer-to-Peer Electronic Cash System. Although the true identity of Satoshi has not been ;revealed, this paper triggered a gold rush to cryptocurrency and led to the birth of a new technology—blockchain. While the initial rush to cryptocurrency has suffered a severe setback due to dramatically descending prices of main cryptocurrencies such as BTC (bitcoin), XRP (Ripple), and ether (Ethereum), blockchain as a technology is alive. Numerous blockchain projects are being worked on worldwide. The technology will fundamentally change the way most businesses will be conducted and how people will live. ICOs, a primary fundraising method used in the cryptocurrency and blockchain world, have played the main role in this gold rush, driving up the BTC's price to an unprecedented level, by over USD 19,000 in December, 2017. The cryptocurrency bubble burst in late 2018 as BTC's price crashed. It is below $4,000 as of January, 2019. The dramatic drop in price of the main cryptocurrencies led to the death of ICOs.
It is not coincidental that the ICO bubble burst. A similar event occurred in the financial world over ten years ago—the 2008 financial crisis. The primary reason for the 2008 crisis was the lack of control in lending standards, resulting in the issuances of many loans to unqualified borrowers. The loans were then packaged via a financial-engineering process called securitization, and sold to unsuspecting investors worldwide. When enough borrowers started to default on their mortgages, a worldwide financial crisis broke out. The ICO fundraising model is fundamentally flawed in its lack of control on many of the proposed projects, for which funds were raised. Via an ICO, an entrepreneur can raise tens of millions of US dollars within minutes without a real product or even a company! All it has is a white paper, sometimes only a few pages long. To address the issues of ICOs and support the blockchain industry's future growth, the blockchain community has proposed and promoted the STO idea. STO has attracted a lot of attention and it is expected to play a promising role in the replacement of ICOs.
In his paper, Satoshi Nakamoto pioneered a way to integrate several key ingredients and develop an electronic payment application. This application offers a more efficient and low-cost solution to fulfill a payment through the removal of intermediaries. These key ingredients include digital money, encryption, decentralization, consensus mechanism, chained blocks, and a peer-to-peer network. Many people responded to Satoshi's idea. They formed the core team to implement the idea.
In January 2009, Satoshi Nakamoto released the first software and blockchain platform. This blockchain platform is referred to as bitcoin, which minted the first coins of the bitcoin cryptocurrency—BTC coins. Many of the key ingredients have evolved. Satoshi's main contribution is to put them together to address the pain points of the existing business model, such as high cost and long execution time for facilitating cross-border payments.
When relying on an existing business solution, it usually takes three days to complete a cross-border payment transaction. With Satoshi's proposed solution or its variations, it takes a few minutes or seconds to finish the same transaction at a tiny fraction of the costs of non-blockchain-based solutions.
For the rest of our discussions, we will use the term blockchain industry to refer to both cryptocurrency and blockchain technology. The word blockchain refers to a sequence of encrypted blocks chained linearly. Bitcoin's platform shares many of the same characteristics as a genealogy tree. They are summarized as follows:
Like a clan consisting of many related families, a blockchain network (a clan) consists of nodes. Each node is like a family.
While every family keeps a copy of the clan's genealogy, each bitcoin node maintains a copy of all transactions that occurred on the chain, starting from the very beginning. The collection of all these transactions is a
distributed ledger
. Since every node keeps a copy of the ledger, blockchain is essentially a decentralized data repository.
A genealogy starts with a common ancestor of the clan. The ancestor has offspring. The equivalent of a common ancestor is called the
genesis block
. The genesis block is followed by one child block, which, in turn, is followed by its own child block, and so on. The collection of all blocks is the blockchain (or in business terms, the ledger). Each block contains one or multiple transactions.
Adding a new name to a genealogy requires a consensus of families within a clan. Similarly, bitcoin relies on a consensus mechanism to decide whether a newly built block is valid, and can be added to the chain.
Like a genealogy, after a block is added to a chain, it is difficult to change. This is the
immutability
feature of bitcoin.
Genealogy provides transparency regarding a clan's history. Similarly, a blockchain allows a user to query the ledger on BTC transactions. This is bitcoin's
transparency
feature.
The bitcoin blockchain design is restricted to resolve one specific business problem—the cash payment. Its value is therefore limited. A generic blockchain platform, called Ethereum, is then implemented by adding new ingredients such as smart contracts, as well as generic programming languages.
As is being pointed out, bitcoin has shortcomings, such as the following:
Bitcoin serves a specific purpose—cash payment.
Bitcoin's scripting language is not Turing complete; for example, it has no looping statement, and so on. Here, the Turing completeness refers to the ability of a programming language to resolve any computational problems.
Bitcoin does not have a state. Consequently, to answer a question such as
What is the total number of minted BTCs?
, you have to search the entire ledger.
To address these issues, Vitalik Buterin, a Canadian cryptocurrency researcher and programmer, proposed the idea of Ethereum in late 2013. Funded by an online crowdfunding sale—an ICO—the system went live on July 30, 2015, with 11.9 million coins premined for the crowdsale.
The core idea for Ethereum is to implement a general purpose blockchain. With that, users can address a wide range of business problems. Ethereum introduced a few key concepts:
A
Turing complete
programming language, such as
Solidity
.
Smart contracts, which define business logic and are deployed on the blockchain—every node maintains and runs the same code at almost the same time. Thus, smart contracts are immutable and are guaranteed to be executed and yield the same outcomes.
The idea of Solidity was initially proposed in August 2014 by Gavin Wood. The Ethereum project's Solidity team led by Christian Reitwiessner later developed the language. It is one of the four languages (Solidity, Serpent, Lisp Like Language (LLL), Viper, and Mutan) that was designed for Ethereum virtual machine (EVM).
The introduction of the smart contract concept, along with others, has significant implications:
A smart contract is a scripted legal document, since it is immutable and enforceable.
The code built into the contract is stored on the Ethereum blockchain and cannot be tampered with or removed. This makes the scripted legal document credible.
After being triggered, smart contracts cannot be stopped, meaning no one can easily influence the running code. As long as triggering conditions are met, the code will be guaranteed to run and the legally defined actions will be fulfilled.
Ethereum to blockchain is like an OS to a computer. In other words, the Ethereum is a general purpose platform.
It now has a Turing complete language—Solidity.
Bitcoin and Ethereum, along with many of their variations, are collectively called public blockchain, since they are open to everyone who is interested in participating in the network. No approval is required. Public blockchains cannot satisfy the needs of many companies. As per these firms' business models, a participant has to receive approval before being authorized to join a network. To satisfy their needs, private blockchain platforms are implemented by modifying public blockchain platforms such as Ethereum and adding an authorization and entitlement component.
Since the membership of a private blockchain network is tightly controlled, several things can be simplified. For example, the consensus algorithm is simplified. Consequently, a primary blockchain platform has much better performance. Also, a private blockchain does not require that you issue a coin so that it gets its work done. Hyperledger is a well-known private blockchain. It is also referred to as an enterprise blockchain.
Ethereum greatly expanded the blockchain technology's capabilities. However, there are many scenarios where Ethereum is not enough, as we just pointed out. The issues of Ethereum are restated here:
Enterprise applications, for example, credit card transactions, require high-performance, as there are potentially billions of transactions a day. The current form of Ethereum has a maximum capacity of handling around 1.4 million transactions a day. Bitcoin is even worse: 300,000 transactions a day.
Many financial markets, for instance,
over-the-counter
(
OTC
) derivatives or
foreign exchange contracts
, are permission-based. A public blockchain supported by Ethereum or bitcoin does not satisfy such a need.
Big companies across industries are addressing these issues. They form consortia to work on enterprise blockchain projects. With a permission-based enterprise blockchain network, a node has to receive approval before it can join the network. Hyperledger is one of them.
The Linux Foundation (LF) created the Hyperledger project in December 2015. Its objective is to advance cross-industry collaboration by developing blockchains and distributed ledgers. On July 12, 2017, the project announced its production-ready Hyperledger Fabric (HF) 1.0.
Currently, Hyperledger includes five blockchain frameworks:
HF
: A private blockchain, initially contributed by IBM and Digital Asset, is designed to be a foundation for developing applications or solutions with a modular architecture. It takes plugin components to provide functionalities such as consensus and membership services. Like Ethereum, HF can host and execute smart contracts. However, HF uses the term
chaincode
instead of smart contract. An HF network consists of peer nodes, which execute smart contracts (chaincode), query ledger data, validate transactions, and interact with applications. Transactions entered by users are channeled to an ordering-service component, which essentially serves to be HF's consensus mechanism. Special nodes called
orderer nodes
validate the transactions and ensure the consistency of the blockchain and send the validated transactions to peer nodes, as well as to
Membership Service Provider
(
MSP
) services. MSP is the certificate authority.
Hyperledger Iroha
: Based on HF, it is designed for mobile applications. Iroha was contributed by Soramitsu, Hitachi, NTT Data, and Colu. It implemented a consensus algorithm called
Sumeragi
.
Hyperledger Burrow
: Contributed initially by Monax and Intel, Burrow is a modular blockchain that was client-built to follow EVM specifications.
Hyperledger Sawtooth
: Contributed to by Intel, it implemented a consensus algorithm called
Proof of Elapsed Time
(
PoET
). PoET was invented by Intel and is designed to achieve distributed consensus as efficiently as possible.
Sawtooth
supports both permissioned and permissionless networks. Sawtooth is designed for versatility.
Hyperledger Indy
: Initially contributed by the Sovrin Foundation, it is to support independent identity on distributed ledgers. Indy provides tools, libraries, and reusable components to support digital identities.
The blockchain technology is still in its early stages. It may take many years before it becomes mature and its potential has been fully explored. At the moment, there is no universally agreed way to classify generations for the technology.
In her book on blockchain, Melanie Swan defined blockchain 1.0 – 3.0. According to her view, these phases can be described as follows:
Blockchain 1.0 refers to the cryptocurrency phase. During this phase, the blockchain applications focus mainly on cash payment, such as currency transfer, remittance, and digital payment systems.
Blockchain 2.0 refers to the smart contract phase. During this phase, the blockchain applications focus in certain areas of the financial industry, for example, currency, financing, and security markets.
Blockchain 3.0 refers to the blockchain technology being applied to areas beyond currency, financing, and security markets. For example, blockchain technology is utilized in areas such as non-profit organization causes, the health industry, the supply chain, manufacturing activities, and so on.
Some others divided the blockchain evolution into four generations:
Blockchain 1.0
: Bitcoin is the most prominent example. Financial transactions are executed based on
distributed ledger technology
(
DLT
