cover.eps

Title page image

Blockchain For Dummies®

To view this book's Cheat Sheet, simply go to www.dummies.com and search for “Blockchain For Dummies Cheat Sheet” in the Search box.

Introduction

Welcome to Blockchain For Dummies! If you want to find out what blockchains are and the basics of how to use them, this is the book for you. Many people think blockchains are difficult to understand. They might also think that blockchains are just about cryptocurrencies like Bitcoin, but they’re are so much more. Anyone can master the basics of blockchains.

In this book, you find helpful advice for navigating the blockchain world and cryptocurrencies that run them. You also find practical step-by-step tutorials that will build your understanding of how blockchains work and where they add value. You don’t need a background in programming, economics, or world affairs to understand this book, but I do touch on all these subjects because blockchain technology intersects all of them.

About This Book

This book explains the basics of blockchains, smart contracts, and cryptocurrencies. You probably picked up this book because you’ve heard about blockchains, know they’re important, but have no idea what they are, how they work, or why you should care. This book answers all these questions in easy-to-understand terms.

This book is a bit different than just about any other blockchain book on the market. It provides a survey of all the key blockchains in the public market, how they work, what they do, and something useful you can try with them today.

This book also covers the landscape of blockchain technology and points out some of the key things to be aware of for your own blockchain projects. Here, you find out how to install an Ethereum wallet, create and execute a smart contract, make entries into Bitcoin and Factom, and earn cryptocurrencies.

You don’t have to read the book cover to cover. Just flip to the subject that you’re interested in.

Finally, within this book, you may note that some web addresses break across two lines of text. If you’re reading this book in print and want to visit one of these web pages, simply key in the web address exactly as it’s noted in the text, pretending as though the line break doesn’t exist. If you’re reading this as an e-book, you’ve got it easy — just click the web address to be taken directly to the web page.

Foolish Assumptions

I don’t make many assumptions about you and your experience with cryptocurrency, programing, and legal matters but I do assume the following:

Icons Used in This Book

Throughout this book, I use icons in the margin to draw your attention to certain kinds of information. Here’s what the icons mean:

tip The Tip icon marks tips and shortcuts that you can use to make blockchains easier to use.

remember The Remember icon marks the information that’s especially important to know — the stuff you’ll want to commit to memory. To siphon off the most important information in each chapter, just skim through these icons.

technicalstuff The Technical Stuff icon marks information of a highly technical nature that you can skip over without missing the main point of the subject at hand.

warning The Warning icon tells you to watch out! It marks important information that may save you headaches — or tokens.

Beyond the Book

In addition to the material in the print or e-book you’re reading right now, this product also comes with some access-anywhere goodies on the web. Check out the free Cheat Sheet for more on blockchains. To get this Cheat Sheet, simply go to www.dummies.com and type Blockchain For Dummies Cheat Sheet in the Search box.

Where to Go from Here

You can apply blockchain technology to virtually every business domain. Right now there is explosive growth in financial, healthcare, government, insurance industries, and this is just the beginning. The whole world is changing and the possibilities are endless.

Part 1

Getting Started with Blockchain

IN THIS PART …

Discover what blockchains are all about and how they can benefit your organization.

Identify the right type of technology and the four steps to developing and executing an effective blockchain project.

Make your own smart contracts on Bitcoin, and determine where this technology can fit within your organization.

Discover the tools you need to step up and run your own private blockchain on Ethereum.

Chapter 1

Introducing Blockchain

IN THIS CHAPTER

check Discovering the new world of blockchains

check Understanding why they matter

check Identifying the three types of blockchains

check Deepening your knowledge of how blockchains work

Originally, blockchain was just the computer science term for how to structure and share data. Today blockchains are hailed the “fifth evolution” of computing.

Blockchains are a novel approach to the distributed database. The innovation comes from incorporating old technology in new ways. You can think of blockchains as distributed databases that a group of individuals controls and that store and share information.

There are many different types of blockchains and blockchain applications. Blockchain is an all-encompassing technology that is integrating across platforms and hardware all over the world.

Beginning at the Beginning: What Blockchains Are

A blockchain is a data structure that makes it possible to create a digital ledger of data and share it among a network of independent parties. There are many different types of blockchains.

All three types of blockchains use cryptography to allow each participant on any given network to manage the ledger in a secure way without the need for a central authority to enforce the rules. The removal of central authority from database structure is one of the most important and powerful aspects of blockchains.

remember Blockchains create permanent records and histories of transactions, but nothing is really permanent. The permanence of the record is based on the permanence of the network. In the context of blockchains, this means that a large portion of a blockchain community would all have to agree to change the information and are incentivized not to change the data.

When data is recorded in a blockchain, it’s extremely difficult to change or remove it. When someone wants to add a record to a blockchain, also called a transaction or an entry, users in the network who have validation control verify the proposed transaction. This is where things get tricky because every blockchain has a slightly different spin on how this should work and who can validate a transaction.

What blockchains do

A blockchain is a peer-to-peer system with no central authority managing data flow. One of the key ways to removing central control while maintaining data integrity is to have a large distributed network of independent users. This means that the computers that make up the network are in more than one location. These computers are often referred to as full nodes.

Figure 1-1 shows a visualization of the structure of the Bitcoin blockchain network. You can see it in action at http://dailyblockchain.github.io.

image

FIGURE 1-1: The structure of the Bitcoin blockchain network.

To prevent the network from being corrupted, not only are blockchains decentralized but they often also utilize a cryptocurrency. A cryptocurrency is a digital token that has a market value. Cryptocurrencies are traded on exchanges like stocks.

Cryptocurrencies work a little differently for each blockchain. Basically, the software pays the hardware to operate. The software is the blockchain protocol. Well-known blockchain protocols include Bitcoin, Ethereum, Ripple, Hyperledger, and Factom. The hardware consists of the full nodes that are securing the data in the network.

Why blockchains matter

Blockchains are now recognized as the “fifth evolution” of computing, the missing trust layer for the Internet. This is one of the reasons that so many people have become excited about this topic.

Blockchains can create trust in digital data. When information has been written into a blockchain database, it’s nearly impossible to remove or change it. This capability has never existed before.

When data is permanent and reliable in a digital format, you can transact business online in ways that, in the past, were only possible offline. Everything that has stayed analog, including property rights and identity, can now be created and maintained online. Slow business and banking processes, such as money wires and fund settlements, can now be done nearly instantaneously. The implications for secure digital records are enormous for the global economy.

The first applications created were designed to piggyback on the secure digital value transfer that blockchains enable through the trading of their native tokens. These included things like the movement of money and assets. But the possibilities of the blockchain networks go far beyond the movement of value.

The Structure of Blockchains

Blockchains are composed of three core parts:

tip The terms Bitcoin and blockchain are often used interchangeably, but they’re not the same. Bitcoin has a blockchain. The Bitcoin blockchain is the underlying protocol that enables the secure transfer of Bitcoin. The term Bitcoin is the name of the cryptocurrency that powers the Bitcoin network. The blockchain is a class of software, and Bitcoin is a specific cryptocurrency.

Blockchain Applications

Blockchain applications are built around the idea that network is the arbitrator. This type of system is an unforgiving and blind environment. Computer code becomes law, and rules are executed as they were written and interpreted by the network. Computers don’t have the same social biases and behaviors as humans do.

The network can’t interpret intent (at least not yet). Insurance contracts arbitrated on a blockchain have been heavily investigated as a use case built around this idea.

Another interesting thing that blockchains enable is impeccable record keeping. They can be used to create a clear timeline of who did what and when. Many industries and regulatory bodies spend countless hours trying to asses this problem. Blockchain-enabled record keeping will relieve some of the burdens that are created when we try to interpret the past.

The Blockchain Life Cycle

Blockchains originated with the creation of Bitcoin. It demonstrated that a group of individuals who had never met could operate online within a system that was desensitized to cheat others that were cooperating on the network.

The original Bitcoin network was built to secure the Bitcoin cryptocurrency. It has around 5,000 full nodes and is globally distributed. It’s primarily used to trade Bitcoin and exchange value, but the community saw the potential of doing a lot more with the network. Because of its size and time-tested security, it’s also being used to secure other smaller blockchains and blockchain applications.

The Ethereum network is a second evolution of the blockchain concept. It takes the traditional blockchain structure and adds a programming language that is built inside of it. Like Bitcoin, it has over 5,000 full nodes and is globally distributed. Ethereum is primarily used to trade Ether, make smart contracts, and create decentralized autonomous organizations (DAOs). It’s also being used to secure blockchain applications and smaller blockchains.

The Factom network is the third evolution in blockchain technology. It utilizes a lighter consensus system, incorporates voting, and stores a lot more information. It was built primarily to secure data and system. Factom operates with federated nodes and an unlimited number of auditing nodes. Its network is small, so it anchors itself into other distributed networks building bridges across the carries blockchains.

Consensus: The Driving Force of Blockchains

Blockchains are powerful tools because they create honest systems that self-correct without the need of a third party to enforce the rules. They accomplish the enforcement of rules through their consensus algorithm.

In the blockchain world, consensus is the process of developing an agreement among a group of commonly mistrusting shareholders. These are the full nodes on the network. The full nodes are validating transactions that are entered into the network to be recorded as part of the ledger.

Figure 1-2 shows the concept of how blockchains come to agreement.

image

FIGURE 1-2: How blockchains work.

Each blockchain has its own algorithms for creating agreement within its network on the entries being added. There are many different models for creating consensus because each blockchain is creating different kinds of entries. Some blockchains are trading value, others are storing data, and others are securing systems and contracts.

Bitcoin, for example, is trading the value of its token between members on its network. The tokens have a market value, so the requirements related to performance, scalability, consistency, threat model, and failure model will be higher. Bitcoin operates under the assumption that a malicious attacker may want to corrupt the history of trades in order to steal tokens. Bitcoin prevents this from happening by using a consensus model called “proof of work” that solves the Byzantine general’s problem: “How do you know that the information you are looking at has not been changed internally or externally?” Because changing or manipulating data is almost always possible, the reliability of data is a big problem for computer science.

Most blockchains operate under the premise that they will be attacked by outside forces or by users of the system. The expected threat and the degree of trust that the network has in the nodes that operate the blockchain will determine the type of consensus algorithm that they use to settle their ledger. For example, Bitcoin and Ethereum expect a very high degree of threat and use a strong consensus algorithm called proof of work. There is no trust in the network.

On the other end of the spectrum, blockchains that are used to record financial transactions between known parties can use a lighter and faster consensus. Their need for high-speed transactions is more important. Proof of work is too slow and costly for them to operate because of the comparatively few participants within the network and immediate finality need for each transaction.

Blockchains in Use

Hundreds of blockchains and blockchain applications are in existence today. The whole world has become obsessed with the ideas of moving money faster, incorporating and governing in a distributed network, and building secure applications and hardware.

You can see many of these public blockchains by going to a cryptocurrency exchange.

Figure 1-3 shows the altcoin exchange for Poloniex (https://poloniex.com), a cryptocurrency trading platform.

image

FIGURE 1-3: The altcoin exchange platform.

Blockchains are moving beyond the trading value market and are being incorporated into all sorts of industries. Blockchains add a new trust layer that now makes working online secure in a way that was not possible beforehand.

Current blockchain uses

Most up-and-running blockchain applications revolve around moving money or other forms of value quickly and cheaply. This includes trading public company stock, paying employees in other countries, and exchanging one currency for another.

Blockchains are also now being used as part of a software security stack. The U.S. Department of Homeland Security has been investigating blockchain software that secures Internet of Things (IoT) devices. The IoT world has some of the most to gain from this innovation, because it’s especially vulnerable to spoofing and other forms of hacking. IoT devices have also become more pervasive, and security has become more reliant on them. Hospital systems, self-driving cars, and safety systems are prime examples.

DAOs are another interesting blockchain innovation. This type of blockchain application represents a new way to organize and incorporate companies online. DAOs have been used to organize and invest funds via the Ethereum network.

Future blockchain applications

Larger and longer-run blockchain projects that are being explored now include government-backed land record systems, identity, and international travel security applications.

The possibilities of a blockchain-infused future have excited the imaginations of business people, governments, political groups, and humanitarians across the world. Countries such as the UK, Singapore, and the United Arab Emirates see it as a way to cut cost, create new financial instruments, and keep clean records. They have active investments and initiatives exploring blockchain.

Blockchains have laid a foundation where the need for trust has been taken out of the equation. Where before asking for “trust” was a big deal, with blockchains it’s small. Also, the infrastructure that enforces the rule if that trust is broken can be lighter. Much of society is built on trust and enforcement of rules. The social and economic implications of blockchain applications can be emotionally and politically polarizing because blockchain will change how we structure value-based and socially based transactions.

Chapter 2

Picking a Blockchain

IN THIS CHAPTER

check Discovering the right blockchain for your needs

check Making a plan for your project

check Uncovering obstacles to your project

check Building a project road map

The blockchain industry is complex and growing in size and capabilities every day. When you understand the three core types of blockchains and their limitations, you’ll know what’s possible with this new technology.

This chapter is all about assessing blockchain technology and developing a project plan. It puts the following chapters about individual blockchain platforms and applications into context.

Here, you see how to assess the three different types of blockchain platforms, what’s being built on each type, and why. I give you a few tools that help you outline your project, predict obstacles, and overcome challenges.

Where Blockchains Add Substance

There’s a lot of buzz surrounding blockchains and the cryptocurrencies that run them. Some of this buzz just stems from the fluctuation in the value of cryptocurrencies and the fear that blockchain technology will disrupt many industry and government functions. A lot of money has poured into research and development because stakeholders don’t want to be made obsolete and entrepreneurs want to explore new business models.

When it comes to finding an opportunity for blockchain technology to add value to an organization, often the question arises, “Where do blockchains add value and how are they different from existing technologies?”

Blockchains are a special type of database. They can be utilized anywhere you would use a normal database — but it may not make sense to go through the trouble and expense of using a blockchain when a normal database can do the job.

You really see value in using some form of a blockchain when you want to share information with parties you don’t fully truest, your data needs to be audited, or your data is at risk of being compromised internally or externally. None of these questions are simple, and the correct solutions can be difficult to ascertain.

This section helps narrow down your options.

Determining your needs

Blockchains come in a lot of flavors. You’ll find one that matches your needs — the trick is finding it! Mapping your needs to the best blockchain can be overwhelming. Whenever I have lots of options and often conflicting needs, I like to utilize a weighted decision matrix.

A weighted decision matrix is an excellent tool for evaluating the needs of a project and then mapping those needs to possible solutions. The key advantage of the matrix is to help you quantify and prioritize individual needs for your project and simplify decision making. Weighted decision matrixes also prevent you from becoming overwhelmed by individual criteria. If done properly, this tool allows you to converge on single idea that is compatible with all your goals.

To create a weighted decision matrix, follow these steps:

  1. Brainstorm the key criteria or goals that your team needs to meet.

    tip If you aren’t sure of the criteria you need to consider when evaluating your blockchain project, here are a few things to keep in mind:

    • Scale and volume
    • Speed and latency
    • Security and immutability
    • Storage capacity and structural needs

    Your team will have its own list of objects and priorities. These are just a few to consider while evaluating the correct platform to use to meet your needs.

  2. Reduce the list of criteria to no more than ten items.

    tip If you’re having a hard time refining your list of needs, consider using a comparison matrix tool.

  3. Create a table in Microsoft Excel or a similar program.
  4. Enter the design criteria in the first column.
  5. Assign a relative weight to each criterion based on how important that objective is to the success of the project.

    Limit the number of points to 10 and distribute them between all your criteria — for example, 1 = low, 2 = medium, and 3 = high priority.

    tip If you’re working in a team, have each member weight the criteria separately.

  6. Add up the numbers for each objective and divide by the number of team members for a composite team weight.
  7. Make any needed adjustment to weights to make sure each criteria are weighted correctly.

Congratulations! You now have a ranked list of criteria you need to meet to be successful with your blockchain project.

Defining your goal

You can easily get lost building a blockchain project that doesn’t have a clear goal or purpose. Take the time to understand where you and your team would like to go and what the final objective is. For example, a goal might be to trade an asset with a partner company with no intermediary. This is a big goal with many stakeholders.

Build back to a small project that is a minimal viable use case for the technology that clearly articulates added value or savings for your company. Along the same lines as the earlier example, a smaller goal would be to build a private network that can exchange value between trusted parties.

Then build on that value. The next win might be building an instrument that is tradable on your new platform. Each step should demonstrate a small win and value created.