BlockChain
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 differ- ent types of blockchains.
- Public blockchains: Public blockchains, such as Bitcoin, are large distributed networks that are run through a native token. They’re open for anyone to participate at any level and have open-source code that their community maintains.
- Permissioned blockchains: Permissioned blockchains, such as Ripple, control roles that individuals can play within the network. They’re still large and distributed systems that use a native token. Their core code may or may not be open source.
- Private blockchains: Private blockchains tend to be smaller and do not utilize a token. Their membership is closely controlled. These types of blockchains are favored by consortiums that have trusted members and trade confidential information.
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.
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 net- work. You can see it in action at http://dailyblockchain.github.io.
FIGURE 1-1:
The structure of the Bitcoin blockchain network.
To prevent the network from being corrupted, not only are blockchains decentral- ized 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 miss- ing 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 possibili- ties of the blockchain networks go far beyond the movement of value.
The Structure of Blockchains
Blockchains are composed of three core parts:
- Block: A list of transactions recorded into a ledger over a given period. The size, period, and triggering event for blocks is different for every blockchain. Not all blockchains are recording and securing a record of the movement of their cryptocurrency as their primary objective. But all blockchain do record the movement of their cryptocurrency or token. Think of the transaction as simply being the recording of data. Assigning a value to it (such as happens in a financial transaction) is used to interpret what that data means.
- Chain: A hash that links one block to another, mathematically “chaining” them together. This is one of the most difficult concepts in blockchain to compre- hend. It’s also the magic that glues blockchains together and allows them to create mathematical trust. The hash in blockchain is created from the data that was in the previous block. The hash is a fingerprint of this data and locks blocks in order and time.
Although blockchains are a relatively new innovation, hashing is not.
Hashing was invented over 30 years ago. This old innovation is being used because it creates a one-way function that cannot be decrypted. A hashing function creates a mathematical algorithm that maps data of any size to a bit string of a fixed size. A bit string is usually 32 characters long, which then represents the data that was hashed.
The Secure Hash Algorithm (SHA) is one of some cryptographic hash functions used in blockchains. SHA-256 is a common algorithm that generates an almost-unique, fixed-size 256-bit (32-byte) hash. For practical purposes, think of a hash as a digital fingerprint of data that is used to lock it in place within the blockchain. - Network: The network is composed of “full nodes.” Think of them as the computer running an algorithm that is securing the network. Each node contains a complete record of all the transactions that were ever recorded in that blockchain. The nodes are located all over the world and can be operated by anyone. It’s difficult, expensive, and time-consuming to operate a full node, so people don’t do it for free. They’re incentivized to operate a node because they want to earn cryptocurrency. The underlying blockchain algorithm rewards them for their service. The reward is usually a token or cryptocurrency, like Bitcoin.
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 arbi- trated 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 prob- lem. 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 distrib- uted. 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.
Each blockchain has its own algorithms for creating agreement within its network on the entries being added. There are many different models for creating consen- sus because each blockchain is creating different kinds of entries. Some block- chains are trading value, others are storing data, and others are securing systems and contracts.
FIGURE 1-2:
How blockchains work.
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 perfor- mance, scalability, consistency, threat model, and failure model will be higher. Bitcoin operates under the assumption that a malicious attacker may want to cor- rupt the history of trades in order to steal tokens. Bitcoin prevents this from hap- pening 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 prob- lem 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, incor- porating 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.
FIGURE 1-3:
The altcoin exchange platform.
Blockchains are moving beyond the trading value market and are being incorpo- rated 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 secu- rity 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 politi- cally polarizing because blockchain will change how we structure value-based and socially based transactions.
Picking a Blockchain
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 out- line 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 cryptocur- rencies 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 over- whelming. 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 proj- ect 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:
- Brainstorm the key criteria or goals that your team needs to meet.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 need
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.
- Reduce the list of criteria to no more than ten items.
If you’re having a hard time refining your list of needs, consider using a comparison matrix tool. - Create a table in Microsoft Excel or a similar program.
- Enter the design criteria in the first column.
- 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 yourcriteria — for example, 1 = low, 2 = medium, and 3 = high priority.
If you’re working in a team, have each member weight the criteria separately. - Add up the numbers for each objective and divide by the number of team members for a composite team weight
- 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 suc- cessful 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.
Choosing a Solution
There are three core types of blockchains: public networks like Bitcoin, permis- sioned networks such as Ripple, and private ones like Hijro.
Blockchains do a few straightforward things:
- They move value and trade value quickly and at a very low cost.
- They create nearly permanent data histories.
Blockchain technology also allows for a few less-straightforward solutions such as the ability to prove that you have a “thing” without revealing it to the other party. It is also possible to “prove the negative,” or prove what is missing within a dataset or system. This feature is particularly useful for auditing and proving compliance.
Table 2-1 lists common uses cases that are suited for each type of blockchain.
|
Primary Purpose |
Type of Blockchain |
|
Move value between untrusted parties |
Public |
|
Move value between trusted parties |
Private |
|
Trade value between unlike things |
Permissioned |
|
Trade value of the same thing |
Public |
|
Create decentralized organization |
Public or permissioned |
|
Create decentralized contract |
Public or permissioned |
|
Trade securitized assets |
Public or permissioned |
|
Build identity for people or things |
Public |
|
Publish for public recordkeeping |
Public |
|
Publish for private recordkeeping |
Public or permissioned |
|
Preform auditing of records or systems |
Public or permissioned |
|
Publish land title data |
Public |
|
Trade digital money or assets |
Public or permissioned |
|
Create systems for Internet of Things (IoT) security |
Public |
|
Build systems security |
Public |
There may be exceptions depending on your project, and it is possible to use a different type of blockchain to reach your goal. But in general, here is how to break down different types of networks and understand their strengths and weaknesses:
- Public networks are large and decentralized, anyone can participate within them at any level — this includes things like running a full node, mining cryptocurrency, trading tokens, or publishing entries. They tend to be more secure and immutable then private or permissioned networks. They’re often slower and more expensive to use. They’re are secured with a cryptocurrency and have limited storage capacity.
- Permissioned networks are viewable to the public, but participation is controlled. Many of them utilize a cryptocurrency, but they can have a lower cost for applications that are built on top of them. This feature makes it easier to scale project and increase transaction volume. Permissioned networks can be very fast with low latency and have higher storage capacity over public networks.
- Private networks are shared between trusted parties and may not be viewable to the public. They’re very fast and may have no latency. They also have a low cost to run and can be built in an industrious weekend. Most private networks do not utilize a cryptocurrency and do not have the same immutability and security of decentralized networks. Storage capacity may be unlimited.
There are also hybrids between these three core types of blockchains that seek to find the right balance of security, auditability, scalability, and data storage for applications built on top of them.
Drawing a blockchain decision tree
Some of the decisions you face while working on a blockchain project within your organization can be difficult and challenging. It pays to take time making deci- sions that involve
- Uncertainty: Many of the facts around blockchain technology may be unknown and untested.
- Complexity: Blockchains have many interrelated factors to consider.
- High-risk consequences: The impact of the decision may be significant to your organization.
- Alternatives: There may be alternative technologies and types of blockchains, each with its own set of uncertainties and consequences.
- Interpersonal issues: You need to understand how blockchain technology could affect different people within your organization.
A decision tree is a useful support tool that will help you uncover consequences, event outcomes, resource costs, and utility of developing a blockchain project.
You can draw decision trees on paper or use a computer application. Here are the steps to create one for uncovering other challenges around your project:
- Get a large sheet of paper.
The more choices there are, and the more complicated the decision, the bigger the sheet of paper you’ll need. - Draw a square on the left side of the paper.
- Write a description of the core goal and criteria for your project in that square.
- Draw lines to the right of the square for each issue.
- Write a description of each issue along each line.
Assign a probability value to encounter each issue. - Brainstorm solutions for each issue.
- Write a description of each solution along each line.
- Continue this process until you’ve explored each issue and discovered a possible solution for each.
Have teammates challenge and review all your issues and solutions before finalizing it.
Making a plan
At this point, you should have a clear understanding of your goals, obstacles, and what blockchain options you have available.
Here’s a simple road map for building your project:
- Explain the project to key stakeholders and discuss its key components and foreseen outcomes.
- Write up a project plan. This is a living set of documents that will change over the life of your project.
- Develop the performance measurements, scope statement, schedule, and cost baselines.
- Consider creating a risk management plan and a staffing plan.
- Get buy-in and define roles and responsibilities.
- Hold a kickoff meeting to begin the project.
The meeting should cover the following:
-
- Vision for the project
- Project strategy
- Project timeline
- Roles and responsibilities
- Team-building activities
- Team commitments
- How your team will make decisions
- Key metrics the project will be measured against
After you complete your project, you aren’t done! Go back and analyze your suc- cesses and failures. Here are some questions to ask yourself:
- Are my key stakeholders happy?
- Did the project stay on schedule?
- If not, what caused it to be delayed?
- What did I learn from this project?
- What do I wish I had done differently?
- Did I actually create new value for my company or save money?
You may want to return to this chapter when you have a deeper knowledge of blockchain technology and you’re developing a plan to build a project.
Getting Your Hands on Blockchain
Blockchains are very powerful tools and are positioned to change how the world moves money, secures systems, and builds digital identities. If you aren’t a core developer, you probably won’t be doing any in-depth block-
chain development in the near future. That said, you still need to understand how blockchains work and what their core limitations are, because they’ll be inte- grated into many everyday online interactions — from how businesses pay people to how governments know that their systems and data are intact and secure.
This chapter helps you get started in the blockchain world. You’ll get acquainted with many of the most important aspects of working with blockchains and crypto- currencies, yet you’ll be working with tools that keep you at a comfortable distance from the intimidating and complex inner workings of blockchains. This chapter also helps you establish the basic crypto accounts that you need in later chapters.
Diving into the Bitcoin Blockchain
The Bitcoin blockchain is one of the largest and most powerful blockchains in the world. It was designed primarily to send Bitcoin, the cryptocurrency. So, natu- rally, in order to create a message in the Bitcoin blockchain, you must send some Bitcoins from one account to another.
When you send Bitcoins from one account to another, a transaction history is recorded in the Bitcoin blockchain. After a transaction has been entered, the information can’t be removed — your message will be around as long as Bitcoin is in existence. This concept of permanence is powerful — it’s the most important characteristic of any blockchain.
You have several ways of adding extra little messages inside your transaction, but sometimes these methods don’t always produce easily readable messages. In this section, I explain how to build the message directly into the Bitcoin transaction.
Embedding the data into the Bitcoin address ensures that it will be easily readable. You can do this by utilizing a Bitcoin vanity address. Think of a vanity address like a vanity license plate on a car. Six-letter Bitcoin vanity addresses can be obtained for free; longer ones cost money. The longer the vanity address, the more costly it is.
In this project, you create two Bitcoin wallets, add funds to one of them, obtain a vanity address, and send a little Bitcoin between your accounts.
If you already have a Bitcoin wallet with funds in it, you can skip the first section and use that wallet.
Creating your first Bitcoin wallet
A Bitcoin wallet address is composed of 32 unique characters. It allows you to send and receive Bitcoins. Your private key is a secret code associated with your Bitcoin address that lets you prove your ownership of the Bitcoins linked with the address.
Anyone with your private key can spend your Bitcoins, so never share it.
Your first Bitcoin wallet needs to be linked to a credit card or bank account. I rec- ommend using one of the following Bitcoin wallets:
- Coinbase (www.coinbase.com)
- Xapo (www.circle.com)
To set up your first wallet, just go to one of these URLs and create an account. It just takes a few minutes. When you have your account open, add a little money to it so you can experiment — $5 is a great starting point.
Creating a second Bitcoin wallet
To receive the Bitcoins you’ll send, you need to make a second Bitcoin wallet. For this second wallet, don’t use a Circle or Coinbase wallet — they don’t have the functionality you need for this purpose.
The easiest Bitcoin wallet to use for this project is the Blockchain.info wallet. Fol- low these steps to create it:
- Go to the Blockchain.info website (www.blockchain.info).
- Click Wallet.
- Click Create Your Wallet.
- Enter an email address and password.
Generating a Bitcoin vanity address
A Bitcoin vanity address is like having a personalized license plate for your car. It is a Bitcoin address that has a string of numbers or letters that appeals to you. A vanity address is optional, but a fun way to see your message in Bitcoin. There are a several free ways to create a Bitcoin wallet vanity address. My favorite is BitcoinVanityGen.com. To create your vanity address using BitcoinVanityGen.com, follow these steps:
- Go to the BitcoinVanityGen.com website (www.bitcoinvanitygen.com).
- Enter six letters into the Type Letters field.
Bitcoin only allows for small messages, and your vanity address will make up the content of your message, which you can easily read in Bitcoin.
Choose something cool because you can reuse your address whenever you want after it has been created. - Click Generate.
- Click Email.
- Enter your email address.
BitcoinVanityGen.com emails you when your vanity address has been found. - Click the link in the email from BitcoinVanityGen.com.
You’ll be given your new vanity address and the private key associated with the address. - Copy your address and private key, and keep them in a safe place.
You will need your address and private key for the next section.
Never share your private keys! Save your private key and a public key someplace safe. Use your public key to receiving or send Bitcoins. (You can share your public Bitcoin keys as much as you want.) The private key is the actual keys to your Bit- coins. If your private key is stolen or lost, you’ve lost your coins forever.
Cryptocurrency is unforgiving. Start off with small amounts of money when you’re learning how to use these systems.
Transferring your vanity address
In this section, you transfer your vanity address to a wallet. Transferring it will allow you to manage your address, and send and receive Bitcoins easily. Follow these steps to get started :
- Log into your Blockchain.info wallet (see “Creating a second Bitcoin wallet,” earlier in this chapter). Figure 3-3 shows The settings page at blockchain.info.
- Click Settings and then click Addresses.
- Next to Imported Addresses, click Manage Addresses.
The screen shown in Figure 3-1 appears. - Click Import Address, enter your private key, and click Import.
You’ve now created an address that allows anyone to read your vanity address when you send or receive Bitcoins.
FIGURE 3-1:
Managing your addresses.
Making an entry into the Bitcoin blockchain
Now that you have two Bitcoin wallets, you can make an entry into the Bitcoin blockchain. You do that by sending Bitcoins between your two wallets. Here’s how (the specifics vary from one wallet to the next, but this is the general idea):
- Log into the Bitcoin wallet that you added the initial funds to (see “Creating your first Bitcoin wallet,” earlier in this chapter).
It prompts you to enter the recipient. - Navigate to the page where you can send money, and copy and paste your vanity address (see “Generating a Bitcoin wallet vanity address”) into the address field.
- Enter a small amount of money that you would like to send, and then click Send.
Congratulations! You’ve just sent your first permanent message! You have forever engraved your message into the history of Bitcoin.
If you enjoyed learning how to do this and want to take your knowledge further, you can access a helpful online tutorial on sending Bitcoin messages at www. blockchainpie.com/blockchain-tutorial-bitcoin-message.
A Bitcoin transaction normally takes ten minutes to be confirmed, but could take several hours. The larger the value of the transaction, the longer you should wait. An unconfirmed transaction has not yet been included in the blockchain and is still reversible.
Reading a blockchain entry in Bitcoin
In the preceding section, I show you how to create a small permanent message in Bitcoin. Data on the Bitcoin blockchain is not encrypted because the data needs to be confirmed by the nodes. This means it will be easy to find the message that you created in the last project.
If you’ve just made the transfer of Bitcoins between your two wallets, wait about 10 or 15 minutes before following these steps.
- Go to the Blockchain.info website (www.blockchain.info).
- Enter your vanity address in the Search box and press Enter.
The transaction page appears.
That’s all it takes to find your transaction and read the massage that you built into the address.
Using Smart Contracts with Bitcoin
A smart contract is autonomous software that can make financial decisions. The blockchain world is abuzz about smart contracts because they’re both amazing and terrifying in their implications for how the world economy operates.
In simple terms, a smart contract is a written contract that has been translated into code and build as complex if-then statements. The contract can self-verify that conditions have been met to execute the contract. It does this by pulling trusted data from outside sources. Smart contracts can also self-execute by releasing payment data or other types of data. They can be built around many dif- ferent types of ideas and do not need to be financial in nature. Smart contracts can do all this while remaining tamper resistant from outside control.
Blockchain technology allowed smart contracts to come into existence because smart contracts offer the permanence and corrupt resistances that were once pro- vided only by paper, ink, and a trusted authority to enforce it all. Smart contracts are a revolution in how we conduct business. They ensure that a contract will be executed as it was written. No outside enforcement is needed. The blockchain acts as the intermediary and enforcer.
Smart contracts are a big deal because when machines start executing contracts, it becomes difficult or impossible to undo. It also brings up an important nature of these instruments that can’t be overlooked and my first law of smart contracts: She who controls the data, controls the contract. All smart contracts verify an external data feed to prove performance and release payment to the correct party.
Although smart contracts are a revolutionary new technology, they can’t yet interpret the intent of the parties entering into the contract. Legal contracts in our society rely on people to interpret what the parties entering into the contract meant. Computers (at least so far) can only understand code, not the intent of the parties.
Building your first smart bond
A smart bond is a type of smart contract that can hold and release an object of value on its own, while also monitoring payments in various currencies using spot price data feeds. Many different types of smart contracts exist, and new ones are being invented every day.
Follow these steps to build your first smart bond:
- Go to the SmartContract website (www.smartcontract.com).
- Click Sign Up.
The Sign Up page appears. - Enter an email address and password and click Create an Account.
SmartContract sends you an email with a confirmation link. - Click the link in the email sent to you by SmartContract to verify your account and log in.
- Click Create Contract.
- Click the Smart Bond tab (see Figure 3-2).
- Click the Create Contract button.
You’re ready to build your first if-then statement. - Click the Smart Terms tab.
Smart contracts verify an outside data feed to prove the performance of your contract and trigger the release of payment. Here you choose the conditions that will trigger your smart contract. - Choose Performance Monitoring.
Performance monitoring will look to see if an action has been taken outside of the contract. In your case, this will be the movement of funds from one account to another. - In the If Payment To field, enter one of your Bitcoin addresses (created earlier in this chapter).
- In the Is field, enter a small dollar amount that you would like to transfer from one Bitcoin address to the other.
- In the By Expiration Date field, enter a date a few days from now.
This sets the time parameters that the contract will use to monitor outside sources. - Click the Description tab (see Figure 3-3).
- In the Smart Contract Title field, enter a name for your contract.
- In the Brief Description field, enter — you guessed it! — a brief descrip- tion of the contract.
The description should act as a brief summary of the agreement’s purpose. Here you can also attach a legal document or other data, such as a image. - Click the Attachments section.
Smart contracts are new technology and can have hiccups. It is best to only attach things that are unimportant and that you’d be okay exposing publicly. - Click Attach Documents.
You can attach an image or a PDF. - Click the Sign & Send tab.
- In the Address field, enter your email address to send yourself the contract.
- Click the Finalize Contract button.
Now your contract will be monitoring the Bitcoin blockchain to monitor whether you send funds to the Bitcoin wallet address that you listed earlier. - Return to your Bitcoin wallets and send funds between the two wallets.
Make sure to use the address and a little more than the amount that you listed on the contract in Steps 10 and 11. When the contract you created sees the record of the transaction of the Bitcoin blockchain, you’ll be notified by email.
The Bitcoin network will take a cut of the transaction, so add a little more to it so that it will meet the terms of the contract. For example, if you set the contract to $5, send $5.15 just to be safe.
FIGURE 3-2:
The Smart Bond tab.
FIGURE 3-3:
The Description tab.
Checking the status of your contract
You can check the status of your contract at any time by following these steps:
- Log into your SmartContract account at www.smartcontract.com.
- Go to your Contract Dashboard.
After your transaction has been completed, the contract will show as complete. Your contract status is located below the Contract Dashboard.
Give the Bitcoin network 10 to 15 minutes to process your transaction before checking the status of it.
Building a Private Blockchain with Docker and Ethereum
Private blockchains hold the promises of both having the benefits of a private database and the security of blockchains. The idea is most appealing for two reasons:
- Private blockchains are great for developers because they allow them to test ideas without using cryptocurrency. The developers’ ideas can remain a secret as well, because the data has not been published publicly.
- Large institutions can capitalize on the security and permanence of blockchain technology without their transactions being public the way they are in traditional blockchains.
Most of this book assumes you’re just learning about blockchain for the first time and have little to no programing skills, but this section requires some knowledge of GitHub, Docker, and how to use your computer’s terminal. If you need a quick recap on coding before you dive in, I recommend Coding For Dummies by Nikhil Abraham (Wiley) for a great overview on coding for nontechnical people. If you don’t plan to ever be hands-on with blockchain technology, you might want to skip the rest of this chapter.
In this section, you dive into building your first blockchain. You build it in two steps. The first step is to prepare your computer to create your private blockchain. Don’t worry — it’s made easier with tools from Docker and work that has been done by talented developers on GitHub. The second step is building your block- chain inside your Docker terminal.
Preparing your computer
You need to download some software on to your computer in order to try this blockchain project. Start by downloading the Docker Toolbox. Go to www.docker. com/toolbox to download the correct version for your operating system.
Next, download GitHub Desktop. Go to http://desktop.github.com. After you’ve installed GitHub Desktop, create a GitHub account at www.github.com by clicking Sign Up and entering a username, email address, and password, and then clicking the Sign Up for GitHub button.
Now you need to create a place to store your blockchain data. Create a folder on your computer’s desktop called ethereum. You’ll use this folder to hold your future repository and other files. Follow these steps to complete the process:
- Open GitHub Desktop.
- Sign into the GitHub Desktop application on your computer with your new GitHub account.
- Return to your web browser and go to www.github.com/Capgemini-AIE/ ethereum-docker.
You see the page shown in Figure 3-4. - Click the Clone or Download button.
You’ll be given two choices: Open in Desktop or Download Zip (see Figure 3-5). - Select the Open in Desktop option.
The GitHub Desktop application will reopens.
In the GitHub Desktop application, navigate to the project folder ethereum and click Clone
FIGURE 3-4:
Navigate to this page at GitHub.
Cloning from GitHub copies the information you need to build your new block- chain. Follow the steps in the next section to get started building your private blockchain.
FIGURE 3-5:
Open in Desktop.
Building your blockchain
You’re going to use the free Docker Quick Start Terminal tool to build your block- chain. It gives you access to a virtual machine, cutting down the time required to set up and debug your system. Because of these features, it lets you create a stable environment for your blockchain, so you don’t have to worry about the settings on your machine, and you can get up and running faster.
Follow these steps:
- Launch Docker on your computer using the Docker Quick Start Terminal.
The Quick Start Terminal should be located with your applications or on your desktop.
The Docker application launches a terminal you will use to build your blockchain. - Change directories in the terminal to ethereum.
The files you create making the new blockchain will go into the desktop file you made in the preceding section. You need to give a command to the terminal in order to change directories. If you’re on a Mac or running Linux, enter the following command:
cd ~ /Desktop/ethereum/ethereum-docker/
If you’re on a PC, enter the following command:
cd ~ \Desktop\ethereum\ethereum-docker\
If these commands don’t work for some reason, search the web for tutorials that explain how to change directories for your type of system.
Now you can utilize the Ethereum–Docker files. - Create one standalone Ethereum node by entering the following com- mand into your terminal:
docker-compose -f docker-compose-standalone.yml up -d
This one line of code will have created the following:- One Ethereum bootstrapped container
- One Ethereum container that connects to the bootstrapped container
- One Netstats container with a web UI to view activity in the cluster
- Take a look at your new blockchain by opening a web browser and going
to http://$(docker-machine ip default):3000.
Congratulations! You’ve built your own private blockchain. If you’re so inclined, say a word of thanks to Graham Taylor and Andrew Dong, who put a lot of time into creating the Ethereum–Docker integration.
Beholding the Bitcoin Blockchain
Warning! After reading this chapter, you may become hooked on this cool emerging technology. Read at your own peril.
Bitcoin demonstrates the purest aspects of blockchain technology. It’s the base- line that all other blockchains are compared to and the framework that nearly all have drawn upon. Knowing the basics of how the Bitcoin blockchain operates will allow you to better understand all the other technology you encounter in this ecosystem.
In this chapter, I fill you in on the fundamentals of how the Bitcoin blockchain operates. I offer safety tips that will make your Bitcoin experience smoother and more successful. I also show you practical things you can start doing now with Bitcoin. In these pages, you find out how to mine the Bitcoin token, giving you a new way to get your hands on Bitcoins without buying them. Finally, you discover how to transfer your tokens to paper wallets, and other practical ways to keep your tokens safe online.
Getting a Brief History of the Bitcoin Blockchain
Bitcoin and the concept of its blockchain were first introduced in the fall of 2008 as a whitepaper and later released as open-source software in 2009. (You can read the Bitcoin whitepaper at www.bitcoin.org/bitcoin.pdf.)
The author who first introduced Bitcoin in that 2008 whitepaper is an anonymous programmer or cohort working under the name of Satoshi Nakamoto. Nakamoto collaborated with many other open-source developers on Bitcoin until 2010. This individual or group has since stopped its involvement in the project and trans- ferred control to prominent Bitcoin core developers. There have been many claims and theories concerning the identity of Nakamoto, but none of them have been confirmed as of this writing.
Regardless, what Nakamoto created is an extraordinary peer-to-peer payment system that enables users to send Bitcoin, the value transfer token, directly and without an intermediary to hold the two parties accountable. The network itself acts as the intermediary by verifying the transactions and assuring that no one tries to cheat the system by spending Bitcoins twice.
Nakamoto’s goal was to close the large hole in digital trust, and the concept of the blockchain was his answer. It solves the Byzantine general’s problem, which is the ultimate human problem, especially online: How do you trust the information you are given and the people who are giving you that information, when self-interest, malicious third parties, and the like can deceive you? Many Bitcoin enthusiasts feel that blockchain technology is the missing piece that will allow societies to operate entirely online because it reframes trust by recording relevant informa- tion in a public space that cannot be removed and can always be referenced mak- ing deception more difficult.
Blockchains mix many old technologies that society has been using for thousands of years in new ways. For example, cryptography and payment are merged to cre- ate cryptocurrency. Cryptography is the art of secure communication under the eye of third parties. Payment through a token that represents values is also something humans have been doing for a very long time, but when merged, it creates cryp- tocurrencies and becomes something entirely new. Cryptocurrency lets you take the concept of money and move it online with the ability to trade value securely through a token.
Blockchains also incorporate hashing (transforming data of any size into short, fixed-length values). Hashing also incorporates another old technology called Merkle trees, which take many hashes and squeeze them down to one hash, while
still being able to prove each piece of data that was individually hashed (see Figure 4-1).
FIGURE 4-1:
A Merkle tree.
Ultimately, blockchains are ledgers, which society has been using for thousands of years to keep financial accounts. When all these old models are merged and facili- tated online in a distributed database, they become revolutionary.
Bitcoin was designed primarily to send the Bitcoin cryptocurrency. But very quickly, the creators realized that it had a much larger potential. With that in mind, they architected the blockchain of Bitcoin to be able to record more than the data concerning the movement of the token. The Bitcoin blockchain is the oldest, and one of the largest, blockchains in the world. It’s composed of thousands of nodes that are running the Bitcoin protocol. The protocol is creating and securing the blockchain.
In very simple terms, the blockchain is a public ledger of all transactions in the Bitcoin network, and the nodes are computers that are recording entries into that ledger. The Bitcoin protocol is the rules that govern this system.
Nodes safeguard the network by mining for the cryptocurrency Bitcoin. New Bit- coins are created as a reward for processing transactions and recording them inside the blockchain. Nodes also earn a small fee for confirming transactions.
Anyone can run the Bitcoin protocol and mine the token. It’s an open-source proj- ect that thrives as more individuals participate in the network. The fewer people
who participate, the more centralized it becomes — and centralization weakens the system. The primary thing that makes Bitcoin a secure system is the large number of independent nodes that are globally distributed.
The most successful miners have robust systems that can outperform slower miners. Early in its history, you could run the Bitcoin protocol and earn Bitcoins on a desktop computer. Now, in order to have any hope of ever receiving Bitcoins, you need to purchase expensive specialized equipment or use a cloud service.
In order to create a message in the Bitcoin blockchain, you have to send some Bitcoin from one account to another. When you send a transaction in Bitcoin, the message is broadcast across the whole network. After the message is sent, it’s impossible to alter it because the message is recorded inside the Bitcoin block- chain. This feature makes it imperative that you always choose your message wisely and never broadcast sensitive information.
Broadcasting the same message to thousands of nodes and then saving it forever in the token’s ledger can add up in a hurry. So, Bitcoin requires that you keep your communications very short. The current limit is just 40 characters.
THE LIMITATIONS OF BITCOIN
Blocks that make up the Bitcoin blockchain are limited to 1MB in size. This limits the number of transactions that the Bitcoin blockchain can handle to seven transactions per second. New blocks occur on average about every ten minutes, but they aren’t guaranteed.
These limitations are hard-coded into the Bitcoin protocol and help ensure that the net- work stays decentralized. And decentralization is key to Bitcoin’s robustness. Larger blocks would impose hardships on the miners and might push out small operations.
Bitcoin has built-in limitations that prevent it from handling the global volume of mone- tary transactions. It is also being used to secure other types of data and systems. The demand to use the secure Bitcoin ledger is high. This difficulty is referred to as Bitcoin bloat, and it has slowed down the network and increased the cost of transactions.
At this point, most blockchain developers are only experimenting with expanding the utility of the Bitcoin blockchain. Most are not at a point where they need to scale up their prototypes and concepts so that the Bitcoin blockchain can handle their request. Other new blockchain technologies have also helped bring down the pressure on Bitcoin and given developers cheaper options to secure data.
AS THE WORLD TURNS: THE DRAMA OF BITCOIN
There is significant conflict around the core development of Bitcoin. Dubbed the Bitcoin Civil War or the block size limit debate, the general conflict is between keeping Bitcoin core as it is and enlarging the functionality of the software. This conflict appears simple, but the repercussions are enormous. Bitcoin’s permanent nature and the billions of dol- lars’ worth of assets that Bitcoin software secures mean that every code change is rigor- ously reviewed and debated.
Beyond the internal conflict, Bitcoin is also under intense scrutiny from the outside. The decentralized nature of Bitcoin that may displace central authorities made it a target for regulators. Bitcoin is also favored by people who want to purchase illicit items anony- mously or move money from a controlled economy to a noncontrolled economy, bypassing governmental controls. All these factors have given Bitcoin a bad rap and drawn the judgment of society. Entrepreneurs that wanted to capitalize on the technol- ogy of Bitcoin rebranded it. The change in terminology was used to differentiate the software structure of Bitcoin and other cryptocurrencies. Software that used the struc- ture of cryptocurrencies began being called blockchain. The shift to deemphasize the controversial tokens and highlight the structure of cryptocurrencies changed both gov- ernment and commercial views of Bitcoin from fear to excitement.
Bitcoin is a living and ever-changing system. The Bitcoin core development com- munity is actively seeking ways to improve the system by making it stronger and faster. Anyone can contribute to the Bitcoin protocol by engaging on its GitHub page (www.github.com/bitcoin). However, there is a small community of domi- nant core developers of Bitcoin. The most prolific contributors are Wladimir Van Der Laan, Pieter Wuille, and Gavin Andresen.
Debunking Some Common Bitcoin Misconceptions
People are often suspicious of anything new, especially new things that aren’t easy to understand. So, it’s only natural that Bitcoin — a totally new currency unlike anything the world had ever seen before — would confound people, and a few misconceptions would result.Here are some of the misconceptions you might have heard about Bitcoin:
- Bitcoin was hacked. There has never been a successful attack on the Bitcoin blockchain that resulted in stolen Bitcoins. However, many central systems that use Bitcoin have been hacked. And wallets and Bitcoin exchanges are often hacked due to inadequate security. The Bitcoin community has fought back by developing elegant solutions to keep their coins safe, including wallet encryption, multiple signatures, offline wallets, paper wallets, and hardware wallets, just to name a few.
- Bitcoin is used to extort people. Because of the semi-anonymous nature of Bitcoin, it’s used in ransomware attacks. Hackers breach networks and hold them hostage until payment is made to them. Hospitals and schools have
been victims of these types of attacks. However, unlike cash, which was favored by thieves in the past, Bitcoin always leaves a trail in the blockchain that investigators can follow. - Bitcoin is a pyramid scheme. Bitcoin is the opposite of a pyramid scheme from the point of view of Bitcoin miners. The Bitcoin protocol is designed like a cannibalistic arms race. Every additional miner prompts the protocol to
- increase the difficulty of mining. From a social point of view, Bitcoin is a pure market. The price of Bitcoins fluctuates based on market supply, demand, and perceived value.
- Bitcoin will collapse after 21 million coins are mined. Bitcoin has a limit to the number of tokens it will release. That number is hard-coded at 21 million. The estimated date of Bitcoin issuing its last coin is believed to be in the year 2140. No one can predict what will happen at that point, but miners will always earn some profit from transaction fees. Plus, users of the blockchain and the Bitcoins themselves will be incentivized to protect the network, because if mining stops, Bitcoins become vulnerable and so does the data that has been locked into the blockchain.
- Enough computing power could take over the Bitcoin network. This is true, but it would be extremely difficult, with little to no reward. The more nodes that enter the Bitcoin network, the harder this type of attack becomes.
In order to pull this off, an attacker would need the equivalent of all the energy production of Ireland. The payoff of this sort of attack is also extremely limited. It would only allow the attacker to roll back his own transaction. He couldn’t take anybody else’s Bitcoins or fake transactions or coins. - Bitcoin is a good investment. Bitcoin is a new and interesting evolution in how people trade value. It isn’t backed by any single government or organiza- tion, and it’s only worth something because people are willing to trade it for goods and services. People’s willingness and ability to utilize Bitcoin fluctuates a lot. It’s an unstable investment that should be approached cautiously.
Bitcoin: The New Wild West
The Bitcoin world is much like the early days of the Wild West. It’s best to approach cautiously until you figure out who the good guys and bad guys are and which saloon serves the coldest beer. If you fall victim to a scam, you’ll have little to no protection.
Bitcoins fall within the definition of commodity under the U.S. Commodity Exchange Act and are considered a currency in many European countries, but there is little to no oversight.
In this section, I list three of the common scams that are prevalent in the crypto- currency world. They all revolve around stealing your coins and look a lot like traditional cons you might already be familiar with. This list isn’t exhaustive, and crooks are nothing if not creative, so be very cautious when using Bitcoins. You never know what’s around the next corner.
Fake sites
Websites that look like exchanges or web wallets but are fakes have plagued some of the top Bitcoin websites. This type of scam is common in the Bitcoin world and on the web in general. Scammers hope to make money by stealing login informa- tion from users or misleading them into sending Bitcoins.
Always double-check the URL and only use secure websites (those that start with https://) to avoid this problem. If a website or claim seems doubtful, check to see if it’s listed on Badbitcoin.org (www.badbitcoin.org). This is not an exhaustive list, but has many of the bad players listed.
No, you first!
“Send me your Bitcoins, and then I’ll ship you the goods.” Smells fishy, right? Scams like this are similar to money wire fraud. In this type of fraud, an individual pretends to sell you something but never delivers.
The semi-anonymous nature of Bitcoins — combined with the inability to do a charge back — make it tough to get your money back. Plus, governments do not currently offer protection for Bitcoin transactions, so you’re up that proverbial creek without a paddle.
Fraudsters will try to win your trust by sending fake IDs or even impersonating other people you may know. Always double-check the information they send you.
The best way to dodge this sort of scam is to listen to your instinct and never put more Bitcoins at risk than you’re willing to lose. If there is a way to verify the identity of the person offline, do so.
Get-rich-quick schemes
Crazy get-rich-quick schemes have proliferated the cryptocurrency world. The good news is: It’s easy to recognize them if you know what to look for.
Often, you’ll be promised massive returns, and there is some kind of recruitment and indoctrination process. This process could include things like sales training, asking you to recruit your friends and family, and promising that this is a risk- free investment and that you’ll never lose your money.
The bottom line: If a scheme looks too good to be true, it probably is. No matter what, take a hard look at how the investment is generating value outside of what you’ll receive from your investment. If there is no clear and rational reason that a significant amount of value is generation rate, it’s a scam.
Run all investments by a lawyer and a CPA. They can help you understand your risks and tax implications.
Mining for Bitcoins
You can get started earning Bitcoins in a variety of ways. Mining for Bitcoin is how to earn Bitcoins by participating in the network. It’s usually handled by special mining hardware that is expensive and specialized. The equipment also needs Bitcoin mining software to connect to the blockchain and your mining pool (a col- laboration of many miners jointly work together and then splitting the rewards of their efforts).
Here are three standard ways to explore mining Bitcoin:
- Bitcoin-QT: The Bitcoin-QT client is the original software written by Satoshi Nakamoto. You can download it at https://bitcoin.org/en/download.
- CGminer: CGminer is one of the most popular mining software. It is open source and available for Windows, Linux, and OS at www.github.com/ ckolivas/cgminer.
- Multiminerapp: The Multiminerapp is an easy Bitcoin client to run. You can download it at www.multiminerapp.com.
Bitcoin is a very competitive environment, and unless you buy specialized mining equipment, you may never earn any Bitcoins. I don’t endorse or recommend any particular mining equipment in this book because the industry is constantly changing and quickly out of date. Expect to pay between $500 and $5,000 per machine on average. Amazon.com is a good place to look. They have a large offer- ing and many customer reviews to help guide you.
Cloud mining allows you to start earning bitcoins in an industrious afternoon, without the need to download software or buy equipment. Just follow these steps:
- Go to https://hashflare.io/panel.
The return on investment for cloud mining can be negative. Review your option carefully to make sure it is a positive investment. - Scroll down the home page and click the Buy Now button under SHA-256 Cloud Mining.
When I wrote this book, this option had the highest return on investment and the lowest startup cost. Take the time to reassess this on your own because this might have changed. - Go through the sign-up process.
- Link your bitcoin address.
If you haven’t established a bitcoin address, turn to Chapter 3 and follow the directions to create a bitcoin wallet. You’ll need to do this in order to claim your mining rewards. - Buy a small amount of mining power.
This will allow you to join the bitcoin network. - Join a mining pool.
This step allows you to get a faster mining reward than mining on your own. It pools the resources of several miners and then shares the prize between the pool.
Congratulations! Now just sit back and wait for your mining rewards to start rolling (or dripping) in.
Making Your First Paper Wallet
A paper wallet is a paper copy of your public and private key for your Bitcoins. Because they’re completely offline, paper wallets are one of the most secure ways to hold Bitcoins when done correctly. The advantage is that your private key is not
stored digitally, so it isn’t subject to hacking. Making a paper wallet is fairly easy. Just follow these steps:
- Go to www.bitaddress.org.
- Move your mouse around the screen until the amount of randomness shows 100%.
- Click the Paper Wallet button.This gives the option to create a paper wallet that you can print.
- In the Addresses to Generate field, enter 1. You can make several wallets at once, if you need to, but you might as well just start with one to get the hang of it.
- Click the Generate button.nFigure 4-2 shows a paper wallet I created.
- Click the Print button. Do not let anyone watch you create your paper wallet. This isn’t something you want to do at a public computer. Make sure to use a printer that is private and not connected to the Internet so you’re not at risk of your private keys being hacked.
Laminate your paper wallet to make it a little more durable.
FIGURE 4-2:
A paper wallet.
Encountering the Ethereum Blockchain
The Ethereum project is one of the most developed and accessible block- chains in the ecosystem. It is also an industry leader in blockchain innova- tion and use cases. Understanding this technology is important because it’s leading the charge in smart contracts and decentralized organizations.
In this chapter, I cover the makeup of Ethereum and explain the new way to build organizations and companies on the Ethereum blockchain. I also go into depth on safety and practical business applications of the Ethereum blockchain. I fill you in on how the project started and where it plans to go.
This chapter sets you up to create your own decentralized organization. I explain how to mine the cryptocurrency on the test net to fuel your projects. After reading this chapter, you’ll be able to set up your own Ethereum wallet and trade the token.
Exploring the Brief History of Ethereum
Ethereum was first described in 2013 in a whitepaper written by Vitalik Buterin, who was very active in the Bitcoin community as a writer and programmer. Buterin saw that there was significantly more potential in Bitcoin than the ability to move value without a central authority. He had been contributing to the colored coin effort within Bitcoin to expand the utility of Bitcoin beyond the trade of its native token. Buterin believed that other business and government use cases that require a central authority to control them could also be built with blockchain structures.
At that time, there was a fierce debate about the Bitcoin network being “bloated” by lots of low-value transactions from applications securing themselves against Bitcoin. The main concerns were that additional applications, built on the Bitcoin protocol, would have problems scaling in volume. Bitcoin was not built to handle the number of transactions needed by the applications. Vitalik and many others saw that in order for people to build decentralized applications in the Bitcoin blockchain, either the blockchain would need a massive code overhaul or they would need to build a new blockchain altogether.
Bitcoin had already been well established at that point. It was clear that the kinds of upgrades to core code that were needed were well beyond what was realistically possible. The politics of Bitcoin would stall any changes to the network. Vitalik and his team established the Ethereum Foundation in early 2014 to raise funds to build a blockchain with a programming language built within it.
The initial development was funded by an online public crowd sale during July and August of 2014. The foundation initially raised a record $18 million through the sale of its cryptocurrency token called ether. People have passionately debated whether this sort of crowd sale is illegal because it may constitute an unlicensed security.
The regulatory gray zone has not hindered the project. If anything, the cutting edge nature of the project has attracted more attention and talent to the founda- tion. Discontented and disenfranchised developers and entrepreneurs from around the world have flocked to the project. Decentralization is seen as the perfect solu- tion to corrupt and oppressive central authorities.
The $18 million raised in the token sale gave the foundation the funds to hire a large development team to build Ethereum. Ethereum Frontier, the first release of the Ethereum network, went live to the public in July 2015. It was a bare-bones software release that only the more technically savvy could use to build their own applications.
Homestead, the current Ethereum software release, was made available in 2016. It’s much more user friendly. Almost anyone can utilize the application template available on it. It has intuitive and friendly user interfaces and a large devoted development community.
Metropolis is the next planned Ethereum release. The main difference will be that applications will be fully developed and well tested. It will also feature even easier- to-use applications and have a larger market appeal where even the nontechnical individuals will feel comfortable using it.
Serenity is the last planned phase of Ethereum development. It’s where Ethereum will move from a proof-of-work consensus (in which miners compete to create the next block) to a proof-of-stake model. In a proof-of-stake model, nodes are chosen pseudo-randomly with the possibility of being selected increasing based on their stake in the network. Their stake is measured by the amount of crypto- currency in their possession. The main benefit of the change will be the reduction in cost of energy associated with proof of work. This may make it more attractive for individuals to run nodes in the network, which would increase decentraliza- tion and increase security.
Ethereum: The Open-Source World Wide Computer
Ethereum may be one of the most complex blockchains ever built. It has its own Turing-complete programming language (a full-functioning programing language that allows developers to build any type of application). The Ethereum protocol can do just about anything that your average programming languages can do, except it’s built inside a blockchain and has the added benefits and security that comes with that. If you can imagine a software project, it can be built on Ethereum.
The Ethereum ecosystem is currently the best place to build decentralized appli- cations. They have wonderful documentation and user-friendly interfaces that get you up and running quickly. Rapid development time, security for small applica- tions, and the ability for applications to easily interact with one another are key characteristics of this system.
The Turing-complete programming language is the main feature that makes the Ethereum blockchain vastly more powerful than the Bitcoin blockchain for build- ing new programs. Ethereum’s scripting language makes things like Twitter application possible in few lines of code, and extremely secure.
Smart contracts, like the one you create in Chapter 3, can also be built on Ethe- reum. The Ethereum protocol has opened up a whole new genre of applications. You can take just about any business, government, or organization’s processes and build a digital representation of it inside of Ethereum. Currently, Ethereum’s platform is being explored to manage digital assets (a new class of asset that lives online and may represent a whole digital asset such as a Bitcoin token or a digital representation of a real-world asset such as corn commodities), financial instru- ments (like mortgage-backed securities), recording ownership of assets such as land, and decentralized autonomous organizations (DAOs), a new way of organiz- ing a business, nonprofit, government, or any other body that needs to come to agreement and work together for common interest. DAOs are built primarily on the Ethereum platform.
Decentralized applications: Welcome to the future
The most revolutionary and controversial manifestation of Ethereum is the self- governing and decentralized application (DAPP). DAPPs can manage things like digital assets and DAOs.
DAPPs were created to replace centralized management of assets and organiza- tions. This structure has a lot of appeal because many people believe that absolute power corrupts absolutely. For those who are fearful of losing control, this type of structure has massive implications.
Etheria (www.etheria.world), a Minecraft-like game, is an interesting example of this technology at work (see Figure 5-1). The game can’t be censored or taken down and will exist as long as Ethereum does. When things are created within Ethereum, even if there were good cause to remove a structure or organization, it’s practically impossible to do so.
The power of decentralized autonomous organizations
DAOs are a type of Ethereum application that represents a virtual entity within Ethereum. When you create a DAO, you can invite others to participate in the gov- ernance of the organization. The participants can remain anonymous and never meet, which could trigger Know Your Customer (KYC) rules (the process a busi- ness must go through to verifying the identity of its clients) and anti-money laundering (AML; the laws and regulations designed to stop the practice of gener- ating income through illegal means) compliance issues.
FIGURE 5-1:
The world’s first immortal digital game, Etheria.
DAOs have been created for raising funds for investing, but they could also be designed for civic or nonprofit purposes. Ethereum gives you a basic framework for governance. It’s up to the organizers to determine what’s being governed. Ethereum has created templates for you to help in the creation of DAOs.
Figure 5-2 shows a depiction of the organization of an Ethereum application.
FIGURE 5-2:
Ethereum.org blockchain application depiction.
WITH GREAT POWER COMES . . . GREAT POWER
The first Ethereum DAO ever built is called, confusingly enough, “The DAO.” It’s an example of some of the dangers that come with decentralized and autonomous enti- ties. It is the largest crowdfunded project in the world — its founders raised approxi- mately $162 million in 26 days with more than 11,000 members. What people had thought was the greatest strength of The DAO became its greatest weakness. The immutable code within The DAO locked into place how the organization would be gov- erned and how funds would be distributed. This allowed the members to feel secure in their investment. Although the code was well reviewed, not all the bugs had been worked out.
The first significant threat to Ethereum came from the hack of The DAO. An unexpected code path in The DAO’s contract allowed any sophisticated user to withdraw funds. An unknown user managed to remove about $50 million before he could be stopped.
The Ethereum community debated bitterly about whether it could or should reclaim the ether. The DAO hacker had not technically done anything wrong or even hacked the system. Fundamentalists within the Ethereum community felt that code was law and, therefore, nothing should be done to recover the funds.
The very thing that made Ethereum strong was also its greatest weakness. Decentralization, immutability, and autonomy meant no central authority could decide what to do quickly. There was also no one to punish for the misuse of the system. It really did not have any consumer protection measures. It was a new frontier, like the software name suggested.
After spending several weeks discussing the problem, the Ethereum community decided to shut down The DAO and create a new Ethereum. This process is called hard forking. When the Ethereum community hard-forked the network, it reversed the trans- action the hacker had committed. It also created a two Ethereums: Ethereum and Ethereum Classic.
Not everyone was in agreement with this decision. The community continues to use Ethereum Classic. The tokens for Ethereum Classic are still traded but have lost signifi- cant market value. The new Ethereum token still hasn’t regained its old high from before the hack.
The decision to fork rocked the blockchain world. It was the first time a majority block- chain project had hard-forked to make whole an investor. It called into question many of the principles that make blockchain technology so attractive in the first place.
Here’s how DAOs basically work:
- A group of people writes a smart contract to govern the organization.
- People add funds to the DAO and are given tokens that represent ownership.This structure works kind of like stock in a company, but the members have control of the funds from day one.
- When the funds have been raised, the DAO begins to operate by having members propose how to spend the money.
- The members vote on these proposals.
- When the predetermined time has passed and the predetermined number of votes has accrued, the proposal passes or fails.
- Individuals act as contractors to service the DAO.
Unlike most traditional investment vehicles, where a central party makes deci- sions about investments, the members of a DAO control 100 percent of the assets. They vote on new investments and other decisions. This type of structure threat- ens to displace traditional financial managers.
DAOs are built with code that can’t be changed on the fly. The appeal of this is that malicious hackers can’t monkey with the funds in a traditional sense. Hackers can still find ways to execute the code in unexpected ways and withdraw funds. The immutable nature of a DAO’s code makes it nearly impossible to fix any bugs once the DAO is live in Ethereum.
Hacking a Blockchain
Ethereum has never been hacked. The hard fork in 2016 due to the DAO hack men- tioned in the “With great power comes . . . great power” sidebar was not an actual hack of the system, but confusingly is often referred to as a hack. Ethereum worked perfectly. The problem was it was too perfect. It became necessary to restart the system when a large amount of money and a majority of its users were threatened.
The only way to correct an action on a blockchain like Ethereum is to do a hard fork, which allows for a fundamental change to the protocol. A hard fork makes previously valid blocks and transactions invalid. Ethereum did this to protect the funds that were being pulled out of the first DAO by a user. The DAO hack was conceptually, one of the largest bug bounties ever.
That said, many scams and hacking attempts occur in the cryptocurrency space. Most of these attacks target centralized exchanges and applications. Many
hackers want to steal cryptocurrency. It has real value and isn’t protected in the same ways that regular money is protected by governments. The anonymous nature of cryptocurrency also makes it appealing to crooks. Catching and prose- cuting these individuals is difficult. The cryptocurrency community is fight back, however, and creating new measures to protect themselves.
Hacking one place is significantly easier and cheaper than trying to overcome a decentralized network. When you read about hacking in the blockchain world, it’s likely just a website or a cryptocurrency wallet that has been hacked, not the whole network.
Understanding smart contracts
Ethereum smart contracts are like contractual agreements, except there is no central party to enforce the contract. The Ethereum protocol “enforces” smart contracts by attaching economic pressure. They can also enforce implementation of a require- ment if it lives within Ethereum, because Ethereum can prove certain conditions were or were not met. If it doesn’t live within Ethereum, it’s much harder to enforce.
Ethereum smart contracts are not yet legally enforceable and may never be because the perception is that you don’t need outside authorities enforcing agreements. Legal systems are controlled by governments. As they stand now, governments are central authorities — some with more or less consent and democratic princi- ples. Within an Ethereum smart contract, each participant has an inalienable vote.
Ethereum smart contracts do not include artificial intelligence. This is a cool pos- sibility in the near future. But for now, Ethereum is just software code that runs on a blockchain.
Ethereum smart contracts are not safe. The DAO hack is a great example of the type of dangers that can occur. It is still early days, and putting a lot of money into an unproven system isn’t smart. Instead, experiment with small amounts until all the bugs have been worked out of new contracts.
Discovering the cryptocurrency Ether
Ether is the name of the cryptocurrency for the Ethereum blockchain. It was named after the substance that was believed to permeate all space and make the universe possible. In that sense, Ether is the substance that makes Ethereum pos- sible. Ether incentivizes the network to secure itself through proof-of-work min- ing, like how the token Bitcoin incentivizes the Bitcoin network. Ether is needed to execute any code within the Ethereum network. When utilized to execute a contract in Ethereum, Ether is referred to as gas.
Executing the code within a smart contract also costs some amount of ether. This feature gives the token added utility. As long as individuals want to use Ethereum for applications and contracts, ether will hold a value beyond speculation.
The wild growth in the value of ether has made it a popular token to speculate on. It’s widely traded on exchanges around the world. Some new hedge funds are looking at it as an investment vehicle. However, the volatile nature and low mar- ket depth make ether a risky investment.
Getting Up and Running on Ethereum
In this section, I walk you through how to get started in the Ethereum blockchain ecosystem. Before you can build anything on Ethereum, you need an Ethereum wallet.
Your wallet will hold your Ethereum tokens call ether. Ether is the cryptocurrency that allows you to create smart contracts inside Ethereum. This is sometimes referred to as gas.
Downloading the Ethereum wallet can take some time, but the interface is very intuitive and the instructions provided throughout the process are easy to follow.
Within the Ethereum wallet, you can win test ether to build your test contracts and organizations. You don’t need to mine ether to learn how it works.
Mining for ether
Ethereum is kept running by a network of computers all over the world that are processing the contracts and securing the network. These computers are some- times referred to as nodes, and they’re mining crypto Ether.
In order to reward individuals for the time and cost involved in mining, there is a prize of five ethers about every 12 seconds. The prize is given to the node that was able to create the latest block in the Ethereum blockchain.
All new blocks have a list of the latest transactions. The proof-of-work consensus algorithm guarantees that prizes are won most often by nodes with the most computational power. Computers that aren’t as powerful can win, too — it just takes longer. If you want to try your hand at mining ether, you can do it with your home computer, but it will take a very long time to successfully mine a block and win ether.
Mining ether is not for the technical novice. You need to be familiar with com- mand line. If you don’t have a clue what command line is, you probably want to skip this process. Also, be sure to follow the most up-to-date instructions on the Ethereum GitHub (http://github.com/ethereum).
Setting up your Ethereum wallet
To set up your Ethereum wallet, follow these steps:
- Go to www.ethereum.org.
- Click the Download button.You have to scroll down the page a bit to find the button.Be sure to save the Ethereum wallet download someplace you can find it later.
- Open the Ethereum wallet.
- Click Use Test Net.Here you get set up to mine test ether. This process is much less time consuming then real ether mining, but it still takes some time.
- Create a strong password. Don’t forget to save your password someplace safe.
- Click through the startup menu.The Ethereum team has a few tutorials that are interesting to review while you’re waiting on your test net to download. The download may take ten minutes or so.
- Choose Develop ➪ Start Mining.Don’t skip this step. You need the ether for later projects.
You’ve just set up your wallet, and you’re earning test ether for your future smart contract projects.
Building Your First Decentralized Autonomous Organization
DAOs will change how the world does business in the future. They allow anyone in the world to create a new type of company online that is governed by pre-agreed- upon rules that are then enforced through the blockchain network. Creating a DAO
is easier than you might think. In this section, you build your first test DAO. I break this project into three sections: build, congress, and governance.
In order to successfully complete your test DAO, you need to have set up your Ethereum wallet and done some mining on the Ethereum test net (see the preced- ing section).
Follow these steps to create your first test DAO:
- Go to www.ethereum.org/dao.
- Scroll down the page to the Code box (shown in Figure 5-3) and copy the code.
- Open the Ethereum wallet you made earlier.
You’ll develop your DAO in your Ethereum wallet.
FIGURE 5-3:
The Code box.
Test net and congress
The next phase of your DAO project is setting up the framework for your DAO. Fol- low these steps:
- In your Ethereum wallet, choose Develop ➪ Network ➪ Test Net.
- Click the Contracts tab and then click Deploy Contract. The Ethereum team has set up a few test templates for DAOs.
- Paste the code you copied in the preceding section into the Solidity code box.
- From the Contract Picker, choose Congress.
- Pick some variables when prompted to do so.
Here are your options:
-
- The minimum quorum for proposals is the fewest votes a proposal needs to have before it can be executed.
- The minutes for debate is the shortest amount of time, in minutes, that needs to pass before it can be executed.
- The margin of votes for a majority. Proposals pass if there are more than 50 percent of the votes plus the margin. Leave it at 0 for a simple majority.
Governance and voting
Now you’re going to name and set up the governance of your DAO. You need to set up a minimum quorum for proposals (how many votes a new proposal needs to have before it is passed). You also set up the margin of votes for a majority (how many votes a plan needs to pass) and the time allotted for discussing new plans.
- Name your new DAO. This is kind of like naming a company.
- For Debate Times, select 5 minutes. This is how long new proposals are open for conversation.
- Leave Margin of Votes for Majority set to 0. This sets up how the democracy of your contract works.
- Confirm the price of the DAO. You’ve mined some Ether in the test net via your wallet when you first set up it up. If you skipped that step, go back and do it now. You need a little of the test net Ether to build your DAO.
- Click Deploy and type your password. The DAO may take some time to deploy. When you arrive at your new dashboard, scroll down, and you’ll be able to see your DAO being produced.
- Click the New icon. A new unique icon will generate that represents your DAO.
Congratulations! You’ve created your first DAO.
Uncovering the Future of DAOs
Smart contracts and decentralized organizations hold a lot of promise. The pure democratic and hyper-rational nature of them is very appealing. However, at this point, there are more possibilities then knowns, and each contract that is created could be groundbreaking or a massive flop.
If you approach Ethereum as the new frontier that it is, you’ll have more success. The Ethereum network has more benefits than drawbacks if you’re careful. But expecting everything to work flawlessly and all the participants to act with integ- rity will open you up to greater losses. Ethereum has its share of bandits, not to mention those friendly enthusiasts who would like you to succeed.
The smart contract hacks of 2016 have highlighted the importance of security and properly reviewing contracts. It also illustrated that there are people with integ- rity that who fight to fix issues.
Reading this book is only the beginning. It will give you a sound bases to build your knowledge of Ethereum, but as with all new technologies, Ethereum is quickly evolving. Keep reviewing best practices and security measures.
In the following sections, I mention some things to keep in mind as you build your first few DAOs, build smart contracts, and debug your new blockchain systems.
Putting money in a DAO
Don’t trust large sums of money to untested and contracts and contracts that haven’t been fully vetted. Large contracts are more often targeted by hackers. The DAO hack described earlier in this chapter (see the sidebar “With great power comes . . . great power”) showed that even well thought-out contracts have unex- pected weaknesses.
Although, smart contracts and blockchains let you conduct business with anyone around the world, it’s still the early days. You can mitigate your risk by working only with known and trusted parties.
The security landscape will constantly be evolving with new bugs. Reviewing all new best practices is imperative. Manage the amount of money you’re putting at risk and roll out contracts slowly and in phases. Ethereum is a new technology, and mature solutions are not yet built.
Building smarter smart contracts
Smart contract programming requires a different mind-set than standard con- tract writing. There is no third party to make things right if the contract executes in a way that you didn’t expect or intend. The immutable and distributed nature of blockchains makes it tough to change an unwanted outcome.
Your contract will have flaws and may fail. Build safety valves into your contracts so you can respond to bugs and vulnerabilities as they come up. Smart contracts also need an off switch that let you pull the plug and pause your contract when things are going wrong.
If your contract is big enough, offer bug-hunting bounties that incentivizes the community to find vulnerabilities and flaws in your contract.
As with many things, the complexity of your contract also increases the likelihood of errors and attack vectors. Keep your contract logic simple. Build out small mod- ules that hold each section of the contract. Creating a contract in this manner will help you compartmentalize any issues.
Finding bugs in the system
Don’t reinvent the wheel by building your own tools such as random number gen- erators. Instead, leverage the work that the community has already done and that has been well tested.
You can only control for things within your own contract. Be cautious of external
contract calls. They can execute malicious code and take away your control.
The Ethereum community has an excellent known bug list and even more helpful tips on how to build secure smart contracts on its GitHub page at https://github. com/ethereum/wiki/wiki/safety.
Regarding the Ripple Blockchain
ipple is the one of the most interesting blockchains for moving and trading value globally. The Ripple protocol allows for the fungibility of any type of asset — even between two unlike assets and in nonliquid markets. It does
all this at extremely low cost, with exceptionally high security, and in record time. The Ripple infrastructure is being implemented as the framework for new modern banking and trading.
This chapter looks at the important nuances of the technology behind the Ripple blockchain. I explain the finer point of how Ripple is revolutionizing banking and fintech globally. I also fill you in on the practical uses of the Ripple blockchain and specific safety tips for working with Ripple protocol.
This chapter prepares you to trade many different types of value globally. Here, you discover why this technology is important for your industry and how to get started using the Ripple protocol today. You also find out how to set up an account that trades on the Ripple protocol and scams to avoid when operating in this ecosystem.
If you aren’t looking for a large-scale solution for a corporation that is exempt or can obtain a banking license, you may want to skip this chapter because Ripple primarily servicing financial institutions.
Getting a Brief History of the Ripple Blockchain
The Ripple project is older than Bitcoin. It has gone through several iterations, but the original implementation was created by the Canadian developer Ryan Fugger in 2004. Fugger’s first iteration was a decentralized monetary system that allowed individuals and communities to set up their own money.
Jed McCaleb, Arthur Britto, and David Schwartz later add to Ryan’s work through a company called OpenCoin. Their work helped add more blockchain-like features such as a digital currency system in which transaction chains are published by consensus among members of the network.
Chris Larsen, the first CEO of Ripple, was the founder of several companies includ- ing E-Loan and Prosper, both of which were disruptive organizations that changed the consumer lending market. He joined Ripple in August 2012 and led it until 2016.
Ripple has since grown to be a large venture-backed startup. It has some of the big- gest names in the investing world backing them, Google Ventures and Andreessen Horowitz just to name a few. As of 2016, Ripple had raised more than $93 million in venture funding. Ripple is also politically active and sits on the Federal Reserve’s Faster Payments Task Force Steering Committee and co-chairs the W3C’s Web Payments Working Group. It has offices in San Francisco, New York, London, Lux- embourg, and Sydney. Many of the founding team have since left Ripple and started new projects.
Ripple has been very disruptive in the banking industry and has seen substantial pushback for its efforts. In 2015, FinCEN fined Ripple $700,000 for Secrecy Act violations. The fine was for selling XRP to Roger Ver, a well-known Bitcoin inves- tor, and failing to file a suspicious activities report because Ver has a felony convic- tion for selling fireworks on eBay. After the fine, DBS Bank and the Oversea-Chinese Banking Corporation Limited began refusing banking services to Ripple Singapore. It is believed that this happened because these banks felt that issuing assets on blockchains posed more regulatory risk than reward for them. Since then, Ripple has shifted its focus to primarily serving global and regional banks.
Today Ripple is a global financial settlement solution that enables banks and con- sumers to exchange value. Similar to Bitcoin, the Ripple protocol lowers the total cost of settlement by allowing users to transact directly and instantly. It’s built on a distributed open-source Internet protocol, uses a blockchain, and has a native currency called ripples.
Ripple’s distributed financial technology enables users to send real-time interna- tional payments across its networks. Using Ripple, global markets can meet demand for fast, low-cost, and on-demand global payment services.
Ripple is particularly good at cross-border payments and exchanging value between two unlike things. Ripple has created a global network of financial insti- tutions, market makers, and consumers. You can now exchange just about any type of value anywhere in the world and instantly. Ripple is the new foundation for the Internet of Value. The idea behind the Internet of Value is that value such as money, cars, land, and commodities can all live and be traded completely online and without intermediaries that facilitate the process. Protocols, such as Ripple, facilitate the trade and fill in the role of intermediary.
Ripple: It's All About Trust
Ripple is an exchange network and a trading platform with a blockchain backend. Institutions use the protocol to clear transactions through Ripple’s distributed ledger. They can also settle obligations through Ripple’s distributed funds exchange.
There are two main ways to interact on the Ripple network:
- The financial users of the system participate in the network by issuing, accepting, and trading assets to facilitate payments.
- The node operators participate in the network by keeping track of transac- tions and coming to consensus about the validity and ordering of those transactions with the other nodes in the network.
The terms node and computer are often used interchangeably. Both terms refer to the machines and code that are used to run the network.
A financial participant must trust the issuers of assets they hold, and a node oper- ator must trust the other nodes in its validator list not to collude to block valid transactions from being confirmed. It is all about trust and aligned incentives for cooperation.
The Ripple network finds a trusted path to exchange all the different types of value within its distributed network. The cryptocurrency for Ripple, XRP, is used to facilitate trade between unlike things of values that have a low trading volume or no trusted path. Between the nodes, the network, and the financial participant,
Ripple has built the basic infrastructure that optimizes the modern payment process and exchanges globally.
In this section, I cover the core functions that the Ripple protocol enables for the banking industry.
There are two critical functions the Ripple network provides:
- It acts as a common ledger to connect banks and payment networks. This allows banks and payment networks to clear transactions in five seconds. It also gives users continuous connectivity between each other, and has constant monitoring of the flow of transactions across the network.
- It acts as a neutral transaction protocol. Ripple transfers value bilaterally for the same type of value. For cross-currency transactions, Ripple sources funds from its marketplace of liquidity providers. This is a big deal, because liquidity is a major problem for many markets.
Banks are very excited about this technology because it allows them to move away from intermediaries and clearinghouses to a faster, cheaper, and less risky sys- tem. Banks have dramatically sped up the process of cross-border payments by removing the need for paper and intermediaries.
Ripple also helps banks reduce risk and cut operational costs of foreign exchange operations by enabling them to directly transact with other banks globally and sourcing liquidity from Ripple’s open marketplace of third parties.
The main advantages Ripple offers are the following:
- Real-time payments
- Comprehensive transaction traceability
- Near-instant reconciliation
- The ability to convert almost any type of currency, commodity, or token
Seeing How Ripple Differs from Other Blockchains
Ripple, like Bitcoin, is neutral and decentralized software. Almost anyone can use Ripple as an open standard to facilitate connectivity and interoperability.
Ripple is significantly different from Bitcoin in its structure and the way the net- work operates. Ripple is finding the most efficient exchange route, structuring transactions as debts, and using its cryptocurrency as the exchange mechanism between the different types of value that are traded on the Ripple network.
Ripple is all about trust, whereas other blockchains, for the most part, are about trustless systems. In Bitcoin, any two parties can send one another Bitcoin tokens and the network then validates that no one is cheating in that transaction. Part of the way Bitcoin balances every block of transactions is to check to make sure that all the tokens involved have only been spent once.
Another significant difference is that Ripple does not use proof-of-work consen- sus. The Ripple team has eliminated the large power burden needed by most blockchains to secure themselves. In doing so, Ripple uses significantly less elec- tricity and is faster than traditional blockchains. You can dive deeper into how Ripple works by checking out the whitepaper at https://ripple.com/files/ ripple_consensus_whitepaper.pdf.
Ripple works very differently from other blockchains. One of the most noteworthy differences is how the network is decentralized and comes to consensus. The nature of decentralization in Ripple is subtle. A node can put any other nodes it wants into its validator list in order to listen to what transactions those nodes want to confirm. The only requirement is that there is sufficient overlap between each node’s validator lists, so the network doesn’t accidentally come to multiple different consensuses.
Ripple manages that by having each node maintain its own validator list, includ- ing Ripple’s own nodes. This ensures that there is sufficient overlap. As a node’s network grows, the node’s list will include more and more validators from well- known trustworthy and independent institutions around the world. Over time, Ripple’s consensus process will become more and more decentralized.
Beyond how decentralization and consensus work on Ripple, here are some other important ways in which Ripple differs from Bitcoin:
Ripple is in the middle. Ripple is software that acts as middleware between financial products and institutions. If you plan to use the Ripple network, you’ll likely need to be a licensed money services provider or mobile money operator.
The Bitcoin protocol is open for anyone to utilizes as he or she sees fit. Regulation may change, but at this time, you don’t have to be licensed to use Bitcoin.
Any developers can get up and running on Ripple, but using the Ripple software may be illegal if you aren’t licensed to do so. This is one of the reasons that Ripple targets large financial institutions as their users. Bitcoin can be used by everyone, and it’s specifically useful for small transactions.
- Ripple is based on a consensus algorithm rather than mining. It uses probabilistic voting among trusted nodes. This type of consensus allows the
- nodes to come to agreement and confirm transactions in five seconds. With Bitcoin, a transaction may take hours.
- Assets inside of Ripple, except XRP (the native token of Ripple), exist as debts. Bitcoin on the other hand only accounts for the transfer of the Bitcoin token between Bitcoin addresses. Outside markets assess the value of the Bitcoin token.
- The supply of XRP is set at 100,000,000,000, and Ripple owned and created all 100 billion XRP units at the outset of the network. They then distributed the XRP to owners of the company and others.
Bitcoin creates new Bitcoin tokens every time it creates a new block. The new tokens are awarded to nodes that win the blocks during consensus. Over time, the supply increases. Algorithmically, Bitcoin is set to stop making new Bitcoins when it hits 21 million. - Ripple protects itself from spam and denial-of-service attacks by requiring a minimum transaction cost. The standard transaction fee is 0.00001 XRP, which is called ten drops.
The Ripple protocol will increase the number of drops required, if higher-than- normal transaction volumes are seen. This is similar to how Bitcoin protects itself from spam, but there is no minimum fee. Bitcoin miners will probably ignore your transaction and it won’t be confirmed without including one. - XRP does not need a “trust path” to be traded. Because of this, it facilitates trade when there is no path between two parties. You would need to do an XRP exchange in the middle to facilitate the trade with untrusted parties or low-liquidity markets.
Bitcoin on the other hand is a trustless system. It allows any two parties to trade, even if the parties don’t know or trust one another — but the trade is limited to the Bitcoin token. This extra feature in Ripple allows users to exchange just about anything. - Ripple picks the nodes used to secure their consensus system for their network. It isn’t quite as open as Bitcoin, where anyone can participate fully in the network. This means that Ripple is somewhat centralized, but it will become more decentralized over time.
Unleashing the Full Power of Ripple
Ripple has stopped opening new consumer wallet accounts on Ripple Trade, its consumer-facing portal. For the most part, Ripple has also pulled down all its consumer-facing products. The regulatory burden of servicing consumers was too high and was clarified by the Financial Crimes Enforcement Network (FinCEN) ruling regarding the need for participants in the virtual currency arena to register as money services businesses under federal law.
The network growing out of the consumer-facing portal wasn’t going to rival the growth in the banking network for Ripple. As of now, Ripple is focusing its efforts on servicing large enterprise customers. Banks are the ones who truly need what Ripple can offer at a scale that is profitable for them.
As a consumer, you can access Ripple through third parties. The wallet that Ripplereferences is GateHub.
The GateHub wallet stores all your different currencies; allows you to send money; and allows you to trade gold, silver, XRP, and Bitcoin on the Ripple network directly from your wallet. It also shows you the net worth of your different currencies as they fluctuate with the market.
GateHub will require you to identify yourself, and setting up your account will take some time. When your account is up and running, you’ll be able to explore the power of the Ripple network.
Follow these steps to get up and running on GateHub:
- Go to www.gatehub.net.
- Click Sign Up.
- Enter your email address and a password, and click Sign Up.
- Save your recovery key in a safe place.
- Verify your email.
- Verify your identity.
GateHub verifies your identity and asks for your phone number, a name, a photo, and supporting documents.
After you provide your personal information, GateHub will clear your account and you’ll be set to trade through the Ripple protocol.
At this point you can send funds to your new account from your Bitcoin wallets.
If you want to build anything on Ripple, you’ll need to be a programmer or at least have access to one. Ripple has great documentation and a support team to get you started.
Ripple is made for moving money faster and cheaper. This area of the economy is very heavily regulated. Ripple states clearly that it’s only software that enables you to perform these tasks. It’s completely up to you to understand and comply with regulations.
If you’re still interested in building a custom project on the Ripple network, they’ll offer you support. The best way to get started is by going directly to the Ripple build page (https://ripple.com/build/). If you want to dive even deeper into the Ripple network, check out its GitHub at https://github.com/ripple.
Exercising Caution with Ripple
Ripple, like other blockchains, which work through cryptocurrencies, has many dangers. Use common sense while working in the cryptocurrency world, and fol- low all other security best practices described in this book. It truly is the new wild west, full of opportunity and risk.
Here are some risks unique to Ripple:
- Unethical trading: As described earlier, Ripple was created to move value across the world cheaper and faster than any another network. The structure of Ripple works with clusters of markets. These markets have trusted nodes confirming transactions together. There are small price differences between these groups at times, and these price differences attract unethical trading.
- Transaction manipulation: The Ripple network, in particular, is prone to arbitrage (the simultaneous buying and selling assets in different markets in order to take advantage of differing prices for the same asset) because it has many currencies and multiple markets, and clever programmers can manipu- late the order of transactions. The two known forms of this on Ripple are as follows:
- Advantageous arbitrage transaction placement: Taking advantage of a price difference between multiple markets before the ledger closes. The ledger closes every five seconds, so traders use arbitrage bots to exploit the market. These bots strike a combination of matching deals that capitalize on the small imbalances between the markets and also push their transactions into an optimal position within the ledger. The traders then profit by taking the difference in price of these markets.
- Large trade front running: The structure and latency in Ripple’s consen- sus exposes the network to a new type of front running of large trades. It is possible to do this because each node in the network broadcasts transac- tions to other trusted nodes. During this time, bots will be monitoring all transactions for opportunities to jump in front of large trades.
The bot will buy up initial offers to fulfill the large purchase and then upsell them to the original owner. At the same time, the bots will also reposition the transactions within the ledger to allow this to happen. The net result of this behavior is that the original owner will receive less value in the trade.
You can find out more about this vulnerability at http://available imagination.com/exploiting-ripple-transaction-ordering-for- fun-and-profit/.
- Advantageous arbitrage transaction placement: Taking advantage of a price difference between multiple markets before the ledger closes. The ledger closes every five seconds, so traders use arbitrage bots to exploit the market. These bots strike a combination of matching deals that capitalize on the small imbalances between the markets and also push their transactions into an optimal position within the ledger. The traders then profit by taking the difference in price of these markets.
Ripple is excellent about keeping exploits out of its network and has an open offer for programmers to earn money through hunting down bugs, exploits, and vulnerabilities. It is highly likely that these two bugs will be fixed in the near future.
Finding the Factom Blockchain
he Factom blockchain is a powerful tool that will help industry scale block- chain technology. It’s different from other public blockchains and has unique properties that make it ideal for publishing data streams and secur-
ing systems. The Factom blockchain also has a corporation behind it — Factom, Inc. — which spearheads its development and builds tools and products on top of the protocol.
Factom software is being built into systems that govern identity and security of both people and things. They’re integrating and bridging other blockchains and blockchain technology as well. The linking between blockchains improves the security of Factom and makes the other blockchains more interoperable.
This chapter explains how Factom works, fills you in on its unique properties, and provides easy-to-follow instructions that will help you get started using it. After reading this chapter, you’ll understand many of the core concepts of Factom blockchain technology and know where it will add value to your blockchain projects.
This may be the time to mention that I am a co-founder of and the chief market- ing officer at Factom, Inc. Although my aim is objectivity, my enthusiasm for Factom is hard to hide.
A Matter of Trust
Blockchains at their core are about allowing different entities to cooperate and collaborate without needing to trust each other’s data security or business pro- cesses. Historically, trusted middlemen or industry consortiums have enabled this to happen, but those have high overhead costs and merely shift the trust to a dif- ferent party. Blockchains shift the trust to a network of disimpassioned third par- ties and, ultimately, math.
Factom, Inc., is a company that builds blockchain software on top of the open- access Factom blockchain. Factom’s recordkeeping software works at a high level by publishing encrypted data or a cryptographically unique fingerprint of that data to the Factom blockchain (shown in Figure 7-1). Additional measures are taken to secure the network by publishing a hash of the whole Factom blockchain every ten minutes in multiple other public blockchains. This extra publishing fea- ture makes Factom different from most public blockchains.
FIGURE 7-1:
The structure of the Factom blockchain-Illustration courtesy of Factom, Inc.
The concept of the protocol was presented as a whitepaper in 2014 to address scalability issues of Bitcoin. As decentralized applications began securing them- selves in Bitcoin, it became clear that entering data into the Bitcoin blockchain was prohibitively expensive at scale, and the Bitcoin couldn’t handle high trans- actional volumes. There was no way to metaphorically get 10 pounds of data into the 5-pound Bitcoin bag.
The Factom protocol was designed to address the cost and volume limitations of other blockchains. The primary objective was to secure data and systems. Because of this objective, Factom is often described as a publishing engine. It allows users to
write data to its ledger for a small fee. These entries are limited to 10 kibibytes and have a fixed cost that is less expensive and has more capacity for transaction vol- ume by an order of magnitude compared to blockchains that use proof of work.
An important concept to understand is that the Factom blockchain is built in layers and chains. The layers have to do with how the data is structured. They use Merkle trees to leave cryptographic proof that any given data was published within Factom. The cryptographic proof, called a Merkle root (32 random characters that can repre- sent a whole tree of individual data), is then published into other public blockchains like Ethereum. This is redundant security that other blockchains don’t offer.
A Merkle tree is a mathematical tree constructed by hashing paired data and then pairing and hashing the results until a single hash remains, known as the Merkle root. This cryptographic proof was named after Ralph Merkle in 1979.
Organizing data into chains helps with scalability. Chains allow applications to only pull the data that they’re interested in from the Factom blockchain, without needing to download the full data set. How they work is very simple: You can pub- lish your data into an existing chain within Factom, or you can create a new chain. The chain ID is then used in the subsequent items you publish as a way to trace back the data you care about.
The purpose of the Factom blockchain: Publishing anything
Factom is a publishing platform. At its core, it was designed to publish and vali- date any data. All other tools on it are built around these simple functionalities. Factom can handle transactions that are up to 10 kibibytes; larger transactions need special structuring and require multiple entries. Alternatively, a hash that represents the data can also be published.
Because the Factom protocol is open source, the system acts as a public utility. It’s a place where anyone can publish anything and be secured by the Factom block- chain. Not surprisingly, some individuals have published obscene content, but the limit on entry size means they can’t publish much. And spam is curbed in the system by charging a small amount per entry. So if you want to swear in the blockchain, it’ll cost you.
Factoids are the Factom network cryptocurrency. Decentralized systems need a reward mechanism to incentivize participants. Having this closed system requires cooperation, and builds the long-term network value creation. Factoids can be
traded and purchased like any of the other 700 cryptocurrencies on the cryptocur- rency market. In the end, Factoids are used to purchase entry credits for the Fac- tom Network.
The cost of an entry is fixed, while the cost of a Factoid fluctuates. As a Factoid increases in value, the user can buy more entry credits. This system allows users to be separated from tradable tokens and maintains fixed cost for consumers while allowing for a free market on the speculation of Factoids. This functionality was built into the initial release of Factom to allow heavily regulated industries and governments to utilize blockchain technology without dirtying their hands with tradable tokens.
As of early 2017, the Factom Network sees about 40,000 entries a day. These include things like the Russell 3000 Index and a record of altcoin prices each day. These records are used as historical references and can be utilized as input to smart contracts or to prove history.
Storing and accessing of data today is mostly a solved problem in the industry. Computer backups can be replicated and archived on a massive scale. A big prob- lem that remains is determining which document is the most recent revision, especially across different organizations. With a blockchain-based document management system, organizations can ensure that they’re using the same docu- ments as their partners.
Incentives of federation
Many blockchains, such as Bitcoin and Ethereum, use a “proof of work” consen- sus. In this kind of a blockchain, the consensus algorithm is how a blockchain comes to agreement on new data entered into the system. The consensus system examines whether new data is valid. Public blockchains need a robust system because anyone can add data to a blockchain. Their consensus mechanism is the rule set that determines what makes a block valid and what chain should be trusted.
Proof of work has many characteristics that make it very attractive. It can often require a capital investment into specialized computer hardware and access to electricity (the cheaper, the better). This means that the only requirement to join as an authority in the system is to burn electricity with commodity hardware. It also means that in order to rewrite history, an equivalent amount of energy must be re-burned. This expense makes rewriting history unprofitable and, thus, unlikely.
Proof of work is excellent at securing blockchains. On the other hand, it consumes vast sums of energy and is expensive to operate. It’s a cannibalistic arms race where the fastest computers win, and each additional gigahash added to the net- work increases the challenge.
The more data contained in each block, the more difficult it is to validate. Proof- of-work systems like Bitcoin also requires the full blockchain to validate a specific data point in the system. For others to prove the transaction you made in the Bitcoin blockchain is valid, they must have all of Bitcoin’s blockchain downloaded. Currently, that takes several days.
Factom steps back from the question, “Is an entry valid?” The question instead is, “Has the entry been paid for?” The users of the system are the ones validating entries. Factom also structures data in subchains that can be parsed individually to prove the validity of any entry without downloading the full blockchain.
Figure 7-2 shows a diagram of the Factom chain structure.
FIGURE 7-2:
Factom chainstructure. Illustration courtesy of Factom, Inc.
Factom has been structured this way for commercial applications because mem- bers of one industry don’t need to download all the irrelevant data about an unre- lated industry. For example, verifying that all documents related to a mortgage have been accounted for does not also require downloading years of stock exchange history.
The Factom blockchain also spreads itself out to secure its network against data corruption. Every few minutes, it creates a small anchor into Bitcoin and Ethe- reum. This does two key things:
First and most important, it prevents the servers building the Factom blockchain from undetectably rewriting history. Because the servers can’t control Bitcoin or Ethereum, any history they had recorded is permanent.
It prevents the Factom servers from showing two different versions of the blockchain to different people. Personal customization of web pages is something that Amazon and Facebook routinely do. Showing conflicting
histories of business transactions to different companies is a recipe for misunderstanding. Because there is only one Bitcoin blockchain, that prevents altered versions of history from being created.
THE CRAZY EIGHT
Factom, Inc., began as a project to scale Bitcoin and moved into an enterprise software company that builds applications and products for government and large institutions. The company formed by the Factom team had eight original founders that came from a mixed background of sales, development, and engineering.
This is an unusually large founding team that needed a different way of governing, dividing responsibility, and distributing equity. They adopted holacracy, a management structure that closely resembles the decentralized networks that they build. Authority and decision-making are distributed among managers. The consensus is created weekly through a 45-minute management meeting.
The company is headquartered in Austin, Texas, and has global projects that involve identity, document management, real estate, and the Internet of Things (IoT). In each case, Factom is working on the record keeping and sharing. It has a partnership with Smartrac, a manufacturer and supplier of radio-frequency identification (RFID) products and IoT solutions, to secure breeder documents (documents, like birth certificates, that enable people to get other documents, like Social Security cards or driver’s licenses) and prevent identity theft. It’s working on IoT security and identity with the Department of Homeland Security and medical record management with the Gates Foundation.
Building on Factom
Factom was created for applications to be built on top of it. It’s built for scale, speed, and low cost. It was created to take to the security of the Bitcoin blockchain and make that permanence available to more than what can fit in its limited space.
Authenticating documents and building identities using APIs
Factom has come out with a set of application programming interfaces (APIs) that can be used by development teams to manage and authenticate documents and build identities for people and things. You still need a developer to help you, and they’re designed for enterprise integration, not ideal for a small project at this point.
There are two core offerings for the general public:
- Apollo: Apollo is your publish and authentication option. It allows users to feed massive amounts of data into Factom and then refer to it as needed, historically. It would be an ideal place to publish an archive of your website or updates to your protocols, for example.
- Iris: Iris is the platform used to build an identity. It’s the underlying technology behind the IoT identity project for the Department of Homeland Security. It builds on the Apollo platform for record management.
You can use the APIs without needing to set up a blockchain or run a cryptocur- rency wallet. It takes the headache out of the process and is ideal for those who are worried about the regulatory gray zone that cryptocurrency still falls under.
Getting to know the Factoid:Not a normal token
Factom has a unique value token system, which uses something called the Factoid. The Factoid is a digital commodity that is tradable on some exchanges. It isn’t a currency in the same sense as Bitcoin. Factoids can be converted by the owner into entry credits (nontransferable tokens that are used to purchase publishing power within the Factom network). This transaction is one-way and it can’t be undone. Factoids are effectively burned and are removed from circulation.
Factoids fluctuate in price depending on speculation and utility. Entry credits, on the other hand, have a stable price that is maintained at US$0.001. This makes the fees paid to publish a predictable cost.
The Factom team issued some number of tokens during the crowd sale to raise funds for the core Factom development. At this point, the Factom network has not reached full federation of 32 nodes as outlined in the whitepaper. When the Fac- tom networks reaches 32 nodes, the network will begin rewarding federated nodes and audit nodes with new tokens.
Federated nodes are nodes that are elected by the network to maintain consensus and validate transactions. Audit nodes check the honesty of these nodes and will take one of their positions as a federated node if any given federated node goes offline or breaks one of the system rules.
The issuance of new Factoids to the servers coupled with the extinguishing of the Factoids by the users represents a value transfer. The users are effectively paying for the operation of the servers.
Anchoring your application
Blockchain technology has opened the doors for new products and services. The blockchains themselves serve as the base layer that old technology can reinvent itself with or innovation can be built against. Each blockchain has its own unique properties that make it ideal for specific applications.
Factom is particularly good at securing information, but it still has limitations: the size of each entry, and the fact that the more you publish, the more it costs. Factom is ideal for storing large files in a cloud solution and then using pointers within Factom to locate those files for your application.
Factom is primarily being used as a system to manage documents, and data, and build identity. It integrates with other blockchains, and it can be used to create an oracle for your smart contract.
Publishing on Factom
Factom was built by developers for developers. It requires utilizing your terminal and downloading special software to both use your wallet and make entries into the network.
The team at Factom has been working hard to build a robust system first. They have documentation that will walk you through the process and a GitHub
repository with all their open-source software for you to review and even contrib- ute to. Efforts have been made to make Factom more individual consumer friendly, but that’s still some time away.
FreeFactomizer is one of my favorite apps built by a Factom fan. It’s very simple to use and allows you to check out the basic functionality of Factom without being a developer, opening a terminal, or doing any coding. It creates a hash of data that you enter into a text box or when you upload a file. It then gathers other hashes of docu- ments submitted by other visitors. Every ten minutes, it combines all these hashes into an entry in the Factom blockchain. It offers a simple proof of existence.
FreeFactomizer is a free service provided by an individual. It costs money to sup- ply this service and may not be available in the future. There is also no warranty of any kind.
To use FreeFactomizer, follow these steps.
- Go to www.freefactomizer.com.
Figure 7-3 shows the FreeFactomizer home page. -
- Upload a document to be hashed.
Use an unimportant document — one that doesn’t contain sensitive information — because this service is not warranted or secure.
- Click Factomize the File Signature.
You’re given a time estimate for how long it will take for the file to be added to Factom.
- Wait for the file to be added to Factom.
It take at least ten minutes for your file to be bundled with other documents and data. When this process is complete, FreeFactomizer will provide you a link back to Factom Explore.
- Check the entry by using Factom Explore, a search tool for the Factom database that allows you to look up entries.
Another option to try is to uploading the document again. It will send back a note like this: “->Signature already registered.” This means that they have added it already to Factom.
Congratulations! You’ve just stored a fingerprint of data in Factom and explored its core functionality.
- Upload a document to be hashed.
FIGURE 7-3:
FreeFactomizer is a great way to try out the Factom blockchain.
Building transparency in the mortgage industry
A blockchain document management service, Factom Harmony is the company’s first commercial product. It’s targeted for mortgage originators, the institutions that issue loans to consumers for homes.
Factom Harmony (shown in Figure 7-4) works by converting various imaging systems utilized by banks into a blockchain vault for documents. It creates and manages entries in real-time as the mortgage is processed. Then it secures a record of the data within Factom, allowing metadata to be shared transparently and points to confidential data between trusted parties.
FIGURE 7-4:
Factom Harmony.Illustration courtesy of Factom, Inc.
In simple terms, Factom Harmony is a document catalog that sits on an imaging system. It’s a radical improvement over the existing systems because individuals who get involved years later can be sure that the records they’re handed are iden- tical to the ones that originated the loan. No longer do mortgage buyers need to trust the fastidiousness of the many intermediaries between origination and themselves.
Factom is hoping to capture some of the value that comes from eliminating costs associated with document assembly. Banks and other originators currently spend immense amounts of time ensuring audits and record reviews are only conducted using the correct set of records and data. This often breaks down when multiple stakeholders coordinate while interacting with loan documents across disparate sources.
Securing data on the blockchain: The digital vault
Factom Harmony (see the preceding section) provides the ability to store the spe- cific data and documents, used for decision and compliance, to a permanent blockchain, while at the same time sharing that data with any party that needs it. Data that has been stored within this system has a clear version history. Missing data is also evident. It was designed for scenarios like audits, lawsuits, foreclo- sures, loan trading, securitization, and regulatory reviews.
Core technology limitations, during the decade leading up to the 2008 market crash, were focused on speed, throughput, checklist management, and document collection. The systems were not designed to collect records and the associated data in a manner that permanently preserves evidence of the decisions and actions.
Today’s regulatory environment requires business to be far more diligent in their efforts to document and maintain the records and data associated with every deci- sions. Any deficiencies in the documentation of the process are often attributed to malice. Without the ability to perfectly preserve the evidence of the data and the decisions associated with it.
How Harmony works with Factom technology
Factom’s technology is a combination of blockchain technology, digital signa- tures, and a set of cryptographic functions developed by the U.S. National Institute of Standards and Technology (NIST). A series of data points is preserved along with a cryptographic proof on other blockchains that allows users to preserve the data and documents for future use. This process creates an electronic catalog of files that can be accessed and validated at any time by any authorized parties.
Using the SHA-256 cryptographic function, Factom generates a hash of each doc- ument and data file stored within the Factom blockchain. The hash creates cryp- tographic proof that a file has never been altered or changed.
A hash is a kind of “fingerprint” for a set of data that represents the contents of a file but without the risk of the data being exposed.
Additionally, Harmony generates and stores a set of key meta-data points along with the hash for every document and data file associated with the record. Within the metadata documents and data files are associated and linked using the same cryptographic tools. This metadata along with the file hashes is written to the Factom blockchain.
Using blockchain as a public witness
Factom creates multiple public witnesses for the data that it secures. Its block- chain is tiny in comparison to the behemoths such as Bitcoin and Ethereum. Their system does not have mining as part of the consensus mechanism. Currently, the system is not even producing any new tokens. The larger and more decentralized a blockchain, the more secure it is from a successful attack.
Mining cryptocurrency is what most public blockchains do to secure themselves. It’s what incentives nodes to join the network.
Factom overcomes this obstacle with a clever method that gives it compounded security. It anchors the data placed in the Factom blockchain within Bitcoin and Ethereum. This is done every ten minutes through hashing. They take the full data set and hash it until there is only one hash that can represent the whole Factom blockchain.
Verifying physical documents:
dLoc with Factom
Smartrac, the world’s leading developer, manufacturer, and supplier of RFID transponders, inlays, prelaminates, and semifinished cards partnered with Fac- tom. Out of this partnership, a new way of securing physical objects with block- chains was created. This product and service is called dLoc. dLoc was designed as a sticker that can be placed on almost anything. It has special utility for paper- based documents such as breeder documents.
dLoc is an end-to-end secure document management system that uses both hardware and software. dLoc’s adhesive Smartrac encoded Near Field Communi- cation (NFC) transponder sticker with an embedded chip is placed on documents or other goods and then secures them using the Factom blockchain.
NFC communication protocols allow two electronic devices, to establish connec- tion when brought near each other.
By combining cloud-based software with Factom’s technology, an immutable identity is created over time for just about anything. People with certain levels of clearance can access and validate the physical document using the dLoc mobile app.
dLoc also allows issuing agencies or entities to turn their offline documents into digital instances that can be easily connected to the existing digital systems and bridge the gap between the offline and online worlds. This solution can be applied to a broad range of documents such as birth certificates, land titles, court, and medical records.
dLoc represents the first practical document authentication system that uses the Factom blockchain to solve the data integrity gap between the physical and digital world. It’s the first reliable way to secure information on paper-based documents with digital data using blockchain technology. dLoc’s data and identity authenti- cation solution hold great promise for both public and private sectors, where paper-based documents are widely used.
dLoc does not eliminate fraud. People will be people and find ways to bypass, cir- cumvent, and steal. This technology makes it much more challenging and costly to do so. At this point, someone can buy a new identity or forge goods almost anywhere. And in some cases, these identities are indistinguishable from authen- tic documents and commodities.
dLoc was created as a way to extend the impossibility of blockchain technology to physical objects and documents. They have also created a system that can notify you if your identity is being tampered with and the possibility of doing something about it.
Digging into DigiByte
igiByte is the blockchain that is owning the gaming space. It’s a unique system that works well with many interesting applications, from gaming to document management. The team at DigiByte has discovered the right
mix of speed, accessibility, and utility for blockchains.
One unique aspect of DigiByte is the five separate algorithms, each of which aver- ages 20 percent of new blocks. This is a big deal because most blockchains are running on just one algorithm, and only the fastest nodes win tokens.
Each of the five DigiByte algorithms accommodates a different type of miner, which has made the DigiByte protocol appealing to more users and increased decentralization. Because of this protocol’s approach, attackers would need to gain control of around 60 percent of the total network hash rate to cause any problems. This would entail control of at least 93 percent of one algorithm and 51 percent of the other four (as compared to Bitcoin, which is running one algo- rithm and is subject to a 51 percent attack). The 51 percent attack concept is one of the greatest weakness of the Bitcoin blockchain. If more than 51 percent of the miners in the Bitcoin network are controlled by one group, they can manipulate the Bitcoin blockchain. If the network is compromised, the token will lose its value and the data secured within the network will be compromised.
This chapter dives into the practical applications and future of the DigiByte block- chain and explains down-to-earth uses for this technology.
Getting Familiar with DigiByte: The Fast Blockchain
DigiByte, also known as the cryptocurrency DGB, is a blockchain that is focused on gaming, payments, and security. The company is headquartered in Hong Kong and was founded by Jared Tate. Tate came from a military and early computer sci- ence background and was involved in Bitcoin for many years. After becoming frustrated in the development of Bitcoin core, he launched DigiByte in 2014 and raised a seed round of funding to expand his work in payment and trade.
The DigiByte team has done amazing work that many other projects utilize. Currently, DigiByte is processing 300 transactions per second. To put that into perspective, Bitcoin does about seven transactions per second. The team has many inspiring goals for its project, including match Visa’s staggering transaction speed by 2021.
DigiByte is one of the most widely distributed networks, with more than 8,000 nodes in 82 countries. It works similar to Bitcoin in that it can be used to move value between two parties quickly and at a very low cost. It also has some of the same functionality as Bitcoin in that it can secure a small amount of information within its blockchain. Through this mechanism, it allows you to secure data, doc- uments, and contracts at an even faster speed than Bitcoin.
The approachable team at DigiByte has also worked hard to make its project fun. The team offers up prizes for gaming through the platform and tweeting nice things about them. DigiByte has a GitHub and is an open-source project under the MIT license.
DigiByte Gaming, a division of DigiByte is a platform utilizing cryptocurrency within the gaming environment to facilitate a new type of digital advertising. It has a growing user base of more than 10,000. It’s a form of permission marketing, where campaigns and incentives drive brand engagement with cryptocurrency prizes and bounties. The ability to do secure micropayments that are nearly bor- derless gives this type of marketing platform a very interesting competitive advantage.
The borderless engagement allows companies to reach a wider audience. The cryptocurrency also lets companies make payments and offer prizes of just about any size to anyone in the world. It will be exciting to see DigiByte marketing expand beyond the gaming industry.
Mining on DigiByte
DigiByte uses five mining algorithms to process transactions. Each algorithm accounts for 20 percent of all blocks created on the network. This system makes DigiByte a unique and diverse blockchain.
The DigiByte team saw that there was greater advantage to gain by allowing more types of mining on its platform. In systems that have a single algorithm, only the fastest and latest technology will win. This creates a sort of cannibalistic arms race for technology and speed. Because it allows all different types of machines to successfully win tokens, the DigiByte system is open to greater diversity and participation.
Here is a quick breakdown of the five-algorithm system of DigiByte:
- SHA-256 (https://dgb-sha.theblocksfactory.com): You must have ASIC mining equipment to utilize the SHA-256 mining option for DigiByte.
- Scrypt (https://dgb-scrypt.theblocksfactory.com): You can use ASIC mining equipment or GPU to run Scrypt for DigiByte.
- Qubit (http://dgb-qubit.theblocksfactory.com): Qubit is a GPU algorithm to mine DigiByte.
- Skein (http://dgb-skein.theblocksfactory.com): Skein is a GPU algorithm to mine DigiByte.
- Groestl (http://dgb-groestl.theblocksfactory.com): Groestl is a GPU algorithm to mine DigiByte.
The multiplicity of DigiByte’s algorithms incentivizes more individuals to partici- pate in mining by lowering the barrier to enter the network successfully. The decentralization that resulted from this diversity has attracted many interesting uses for the network. Cryptocurrency miners will often repurpose outdated Bit- coin mining equipment to use on the DigiByte network where they can still find utility for it.
This section dives into how to gain some of the DigiByte tokens, known as DGB. You can mine the cryptocurrency and use it later.
If you have old Bitcoin mining equipment, it can be used to earn DGB.
Before mining DGB, you should calculate if mining will be a profitable endeavor. Follow these steps:
- Go to www.coinwarz.com/calculators. Here, you find a calculator to estimate the payback time for mining many different cryptocurrencies. Figure 8-1 shows the cost and profitability calculator tool from CoinWarz.
- In the Pool Fees % field, enter 3. This is a high estimate on the cost to participate in a mining pool. It often ranges between 0.5 percent and 3 percent.
- In the Hardware Costs (USD) field, enter 500. The cost of specialized mining equipment varies widely. A good average cost estimate is $500.
- In the Hash Rate (KH/s) field, enter 470000. This is the estimate of how fast your machine can hash in kilohashes per second (KH/s), or 1,000 hash computations per second. The higher the hash rate for mining on a particular blockchain, the more difficult it is to mine thattype of cryptocurrency. You may also see megahashes per second (MH/s), or 1 million hash computa- tions per second; gigahashes per second (GH/s), or 1 billion hash computations per second; terrahashes per second (TH/s), or 1 trillion hash computations per second; and petahashes per second (PH/s), or 1 quadrillion hash computations per second.
- Click Calculate.
The calculator will give you an idea about the costs and profitability of engaging in cryptocurrency mining.
FIGURE 8-1:
The cost and profitability calculator.
THE EVOLUTION OF MINING
When Bitcoin began, a desktop computer could be used to mine. However, the increase in the hash rate for the Bitcoin blockchain soon consumed all the system resources of normal computers to keep up.
Blockchains that have reached the hash difficulty of gigahashes are beyond the capacity of your average computer. Even this rate can be prohibitive for many miners. It requires a lot of energy, time, and resource to be profitable. Because of DigiByte’s five algorithm system, you can still use a normal computer to earn tokens.
Bitcoin miners discovered that they could adapt the graphical processing unit (GPU) in computer graphics cards to do mining. The GPU gave miners often over 50 times the speed advantage, and the GPU also consumed less electricity, so it was cheaper to run.
In 2011, mining farms started popping up. They used specialized equipment called field- programmable gate array (FPGA) processors. These devices attached to miners’ com- puters using a USB port and used less power than CPU or GPU mining.
The best mining hardware now utilizes application-specific integrated circuit (ASIC). ASIC machines mine at extreme hashing speeds and, from my personal experience, they
can be quite noisy. If you choose to buy one, take your time and read the reviews. Also, check to make sure it will have a reasonable payback time and be compatible with what you want to mine.
Signing Docurnents on DigiBytes DiguSign
DiguSign, created by the DigiByte team, is an interesting alternative to traditional cloud storage and e-signature services. DiguSign takes the basic functionality of these applications and adds the permanence and the verifiability of blockchain technology. It allows you to digitally sign documents and then secure them in the DigiByte blockchain.
The DigiByte team believes that DiguSign will be very valuable to lawyers, health- care providers, and in financial services arenas where it’s important to keep a clear version history for contracts and a clear established time line on what docu- ments were provided when and to whom.
You may be able to link your DiguSign account to your cloud storage providers, such as Google Docs, Dropbox, and OneDrive. Until then, each document must be individually uploaded to DiguSign. DiguSign has a free testing version for this service that allows you to create three free blockchain-backed documents or contracts.
DiguSign is still in early testing, but it already allows you to store, unofficially
notarize, and validate digital documents.
DiguSign publishes a SHA256 hash of your document by embedding the hash into a DigiByte blockchain transaction. That transaction is then secured in the DigiByte blockchain.
To set up your account, follow these steps:
- Go to www.digusign.com and sign up for a DiguSign account.
- Upload your document to DiguSign.You’re given the option for creating a document or contract template.
- Choose the option to create a document.
- Configure all the required signatures and other fields on your document.
- Enter the emails of the individuals whom you would like to e-sign your document.
- Select the Secure Final Version option. When all parties have signed the document, you need to send the final version to the DigiByte blockchain by clicking Secure Final Version.
You’ve created a near permanent fingerprint of your document that you can refer- ence at any time.
Earning DigiBytes While Gaming
DigiByte has made the connection between the gaming community’s affinity for digital tokens and blockchain technology. Gamers are familiar with using digital currencies within games, so the DigiByte team believes that it’s an easy jump to utilize its cryptocurrency token as a way to incentivize user engagement.
DigiByte has set up options to earn DigiByte tokens by playing games such as Counter Strike, League of Legends, and World of Warcraft. The awards are pro- vided through sponsorships by gaming companies and do not draw on a user’s GPU power to mine.
DigiByte has created an interesting opportunity for gaming companies to build in added incentive models to gain new players and retain existing ones. It has also found a clever way for gamers to translate the prizes they win in a digital world into money they can spend in the physical world.
You can earn DigiBytes through the DigiByte gaming website. Every day, DigiByte offers multiple Quests that give you the opportunity to gain what are called XP. XP then translate into DigiBytes at a set daily rate. You can play World of Warcraft or any of the other games offered, and get paid DigiBytes for playing.
Then you can trade the DGB token on exchanges, such as Poloniex, for Bitcoin. And you can easily turn Bitcoin into other currencies. There are a few layers of separation, but it’s a clear fun path to getting paid!
Getting up and running to earn DigiBytes through gaming is fairly easy. You won’t be mining to earn tokens, but you won’t need to open command line to get started either. Just follow these steps:
- Go to www.digibytegaming.com.
- Create a new account.DigiByte allows for social login, making it fast and easy to set up.
- Verify your account.Check your email for the link.
- Go to www.battle.net. From here, you can create a profile to link to your DigiByte account. This profile will act as a bridge between World of Warcraft and DigiByte.
- Set up World of Warcraft on your computer.If you already play this game, you can connect your game key in this step.
- Return to www.digibytegaming.com.
- Click the World of Warcraft option.
- Connect your Battle.net account.
- Open your World of Warcraft application and start playing.
You’re now earning DigiBytes while you play!
Getting Your Hands on Hyperledger
Hyperledger is a community of software developers and technology enthu- siasts who are building industry standards for blockchain frameworks and platforms. Their work is important because they’re the main group shep- herding the blockchain industry into the mainstream and commercial adoption.
Hyperledger is the “safe” deployment platform for enterprise teams.
The organization and their unique project are growing every day. As of this writ- ing, they have more than 100 member companies and have several projects in incubation. Their first few projects include Explorer, a web application to view and query blocks, and Fabric, a plug-and-play blockchain application builder. They also have Iroha and Sawtooth, which are modularized blockchain platforms.
In this chapter, I explore the three key projects that are under incubation at Hyperledger. You get a deep understanding of what the future of commercialized blockchain will be for your company and industry. This knowledge will help you as you explore what technologies to utilize and which to avoid, saving you devel- opment time and resources.
Getting to Know Hyperledger: Dreams of a Hyper Future
At the end of 2015, the Linux Foundation formed the Hyperledger project to develop an enterprise-grade and open-source distributed ledger framework. They hoped to focus the blockchain community on building robust, industry-specific applications, platforms, and hardware systems to support businesses.
The Linux Foundation saw that there were many different groups building block- chain technology without a cohesive direction. The industry was duplicating effort and the tribalism was leading teams to solve the same problem twice. The founda- tion knew from its experiences that if this technology was to realize its full poten- tial, an open-source and collaborative development strategy was desperately needed.
The Hyperledger project is led by Executive Director Brian Behlendorf, who has decades of experience dating back to the original Linux Foundation and Apache Foundation, as well as being a CTO of the World Economic Forum. So it’s not sur- prising that Hyperledger has been well received. Many of the top business and industry leaders have joined the project, including Accenture, Cisco, Fujitsu Lim- ited, IBM, Intel, J.P. Morgan, and Wells Fargo. It has also attracted many of the top blockchain organizations.
R3, a consortium supporting the banking industry, has contributed its financial transaction architectural framework. Digital Asset, the software company, gave the Hyperledger mark and some of its enterprise-grade code. The Factom Foun- dation is also contributing enterprise-grade code and developer resources. IBM and many other organizations are contributing code and other resources to the project.
Hyperledger’s technical steering committees ensure robustness and interopera- bility between these different technologies. The hope is that the cross-industry, open-source collaboration will advance blockchain technology and deliver billions in economic value by sharing the costs of research and development across many organizations.
Hyperledger is identifying and addressing the important features and require- ments missing from the blockchain technology ecosystem. It’s also fostering a cross-industry open standard for distributed ledgers and holding open space for developers to contribute to building better blockchain systems.
Hyperledger has a project life cycle similar to that of the Linux Foundation. A pro- posal is submitted and then the accepted proposals are brought into incubation.
When a project has reached a stable state, it graduates and is moved into an active state. As of yet, all Hyperledger projects are in the proposal or incubation stage. Each of the projects is led by a large corporation or startup. For example, Fabric is led by IBM, Sawtooth by Intel, and Iroha by the startup Soramitsu.
Hyperledger, like many open-source projects, uses GitHub (www.github.com/ hyperledger) and Slack (https://slack.hyperledger.org) to connect with teams working on each of the projects. These are great places to get the latest updates and to check on the progress that these projects are making in development.
Focusing on Fabric
Hyperledger’s first incubation project, Fabric, is a permissioned blockchain platform. It works like most blockchains in that it keeps a ledger of digital events. These events are structured as transactions and shared among the different participants. The transactions are executed without a cryptocurrency. An optional resource for you to dive deeper into the subject is at https://trustindigitallife. eu/wp-content/uploads/2016/07/marko_vukolic.pdf.
All transactions are secured, private, and confidential. Fabric can only be updated by consensus of the participants. When records have been inputted, they can never be altered.
Fabric is an enterprise solution interested in scalability and being in compliance with regulations. All participants must register proof of identity to membership services in order to gain access to the system. Fabric issues transactions with derived certificates that are unlinkable to the owning participant, thereby offering anonymity on the network. Also, the content of each transaction is encrypted to ensure only the intended participants can see the content.
Fabric has a modular architecture. You can add or take way components by imple- menting its protocol specification. Its container technology can handle most of the mainstream languages for smart contracts development.
Bitcoin, on the other hand, allows anyone to participate anonymously and the community is always looking for ways to be censorship resistant and to enable those who have been disenfranchised. Bitcoin was also mainly engineered for the movement and security of its cryptocurrency token. For this reason, comparing the best practices of Bitcoin to those of Fabric may be unfair.
Building your system in Fabric
A lot of work has gone into making Fabric accessible, but it’s still only approach- able by people who are technically savvy.
Hyperledger has detailed several use cases that it’ll be gearing its technology toward. You’ll be able to use Fabric over the outlined use cases in the near future with intuitive user interfaces. For now, you can develop and test the listed use cases with the help of a core developer.
Diving into chaincode development
Contracts between two parties can be translated into code on the Hyperledger Fabric via Chaincode. Chaincode is Hyperledger’s version of Ethereum’s smart contract. It automates the agreements made within a contract in a way that both parties can trust.
Chaincode is Turing complete like the smart contracts of Ethereum. Currently, you can have a Java developer build a chaincode contract for you. The Fabric team has prepared some common use cases such as digital currencies and sending text messages as part of the core framework.
The Fabric team is also exploring other interesting business use cases that were not complete at the time of this writing but may be available by the time you’re reading this.
Hyperledger is early in development and its projects are about two years behind Ethereum’s work. However, each of the projects does have substantial teams and resources devoted to it:
Business contracts: Hyperledger has come up with ways to have both public contracts and private contracts. Private contracts are between two or more parties and contain confidential information. Public contracts are viewable by
anyone who takes the time to search for them within Hyperledger. For example, you might use a public contract to make a public offer to sell a product or as a way to solicit bids on a contract.
The makeup of these contracts is more complex than traditional contracts because arbitration and third-party enforcement are removed. Additionally, the authentication of the individuals participating in the contract is needed. Plus, most contracts are unique and can’t be standardized. The more complex the contract, the more places it can be corrupted from its original intent.
Hyperledger is working on creating a contract management system to help enhance the scalability of Chaincode.
Manufacturing supply chain: Supply chain management is an exciting blockchain scheme that is being explored on Fabric. Final assemblers could manage all the component parts and supplies that they used in creating their
product. This feature would enable you to be responsive to demands and be able to track back the origin of each part to the original producer. In the case of a product recall, it would be easy to find the culprit or the ability to tell the authenticity of each part before it’s utilized.
Fabric requires more development before it’s ready for this use case because it will need to be easily accessible to everyone in the supply chain. The Fabric team is working on a standard protocol to allow every participant on a supply chain network to input and to track numbered parts that are produced and used on a specific product.
When it’s finished, this use case would allow deep searches to be done on the production of each product at any time. This might be ten or more layers deep in the production of any one item. Consumers could then establish the prov- enance of any manufactured good that is made up of other component goods and supplies. This may have an interesting social impact on consumption.
Securities and assets: Securities and other assets are well suited to block- chain because they can automate many of the functions that third parties perform. Fabric will allow all stakeholders of an asset to have direct access to
that asset and its makeup and history, bypassing intermediaries that now hold that information. Fabric will also speed up the settlement time on assets to near real time.
Direct communication: In the future, Fabric could also be used as a place where companies can make public announcements and offers. For example, if a company wanted to raise funds and needed to notify all shareholders
of the complete details of the offer in real time, it could. Like the decentralized autonomous organization (DAO) of Ethereum, shareholders can make decisions and execute them. Their decisions will be processed and settled in real time. This will make shareholder meetings and voting much easier and faster.
Interoperability of assets: In the future, Fabric may also have some of the same functionality as the Ripple network (see Chapter 6). It has imagined use cases where companies could exchange assets in low-liquidity markets by
matching demands between multiple parties. Instead of settling for market limits on direct trading between two parties, a chain network connects buyers with sellers and finds the best match across multiple asset classes. Hyperledger looks to be well positioned in the future to trade derivatives. You can read more about this work at http://events.linuxfoundation.org/
sites/events/files/slides/TradingDerivatives_LinuxCon_2016.pdf.
Investigating the Iroha Project
Hyperledger’s Iroha project is building on the work completed in the Fabric proj- ect. It’s meant to complement Fabric, Sawtooth Lake, and the other projects under Hyperledger. Hyperledger added the Iroha project to incubation because the other projects didn’t have any infrastructure projects written in C++. Not having a C++ project severely limited how many people could benefit from the work on Hyperledger and the number of developers who could contribute to the project.
In addition, most blockchain development at this point has been at the lowest infrastructure level, and there has been little to no development work on user interaction or mobile applications. Hyperledger believes that Iroha is necessary for the popularization of blockchain technology. This project fills the gap in the market by bringing in more developers and providing libraries for mobile user interface development.
At the time of this writing, Iroha is a very new project and has not integrated with Fabric or Sawtooth Lake. Hyperledger has plans to expand functionality to work with the other blockchain projects soon. Its iOS, Android, and JavaScript libraries will provide supportive functions like digitally signing transactions. It will be very useful for commercial app development, and it will add new layers of security and business models only possible with blockchain technology.
Introducing Sumeragi: The new consensus algorithm
Blockchains have systems that allow them to first agree on a single version of the truth and then record that agreed-upon truth in their ledger. An agreement sys- tem is called a consensus.
A consensus is complicated. Grasping the nuances of how and why consensuses act in the way they do is well beyond the scope of this book. It’s also far more then you’ll ever need as a business professional. What does matter for you are the con- sequences of different consensus mechanisms and how they affect what you’re doing on that particular blockchain. I’m highlighting Iroha’s consensus, Sumer- agi, because it’s very different from traditional blockchains.
Here are a few key things that make Sumeragi different:
Sumeragi does not have a cryptocurrency.
Nodes that start consensus are added into the system by the Fabric mem- ber services. Nodes build a reputation over time based on how they’ve interacted with the ledger. This is a permission blockchain run by known entities.
New entries are added to the ledger in a unique way. The first node that
starts consensus, called the leader, broadcasts the entry to a group of other
nodes; those nodes then validate. If they don’t validate, the first node will rebroadcast after a predetermined duration of time. The broadcasting element is similar to how Ripple’s consensus works.
Depending on your use case for blockchain, Iroha may be positive or negative. If you’re worried about censorship, Iroha may not be right for you. In this case, you’ll be better off looking at a blockchain that is censorship resistant. If you’re worried about other players on the network committing arbitrage, Iroha may also not be right — further investigation is needed. If you want to know all the players in your blockchain, Iroha may be exactly what you’re looking for.
Developing mobile apps
Skip this section if you aren’t part of the app development space.
Iroha is built for the web and mobile app developers so they can access the strengths of the Hyperledger systems. The Iroha team saw that having a distrib- uted ledger wasn’t useful if there were no applications utilizing it.
Iroha has a development path for the following encapsulated C++ components:
- Sumeragi consensus library
- Ed25519 digital signature library
- SHA-3 hashing library
- Iroha transaction serialization library
- P2P broadcast library
- API server library
- iOS library
- Android library
- JavaScript library
- Blockchain explorer/data visualization suite
One of the major hurdles of the blockchain industry has been in making systems user-friendly. Iroha has created open-source software libraries for iOS, Android, and JavaScript and made common API functions convenient to call. It’s still early in development, but Iroha is a good resource to explore for business use cases.
Diving into Sawtooth Lake
Sawtooth Lake by Intel is another distributed ledger project in Hyperledger. It’s focused on being a highly modular platform for building new distributed ledgers for companies.
As of this writing, the release version has software that is only simulating the con- sensus. It doesn’t provide security for your project and should only be utilized for testing out new ideas.
Sawtooth Lake does not operate with a cryptocurrency. It maintains the security of the platform by allowing businesses to create private blockchains. These busi- nesses running private blockchains then share the burden of computational requirements of the network. In its documentation, Sawtooth Lake states that this type of setup will ensure universal agreement on the state of the shared ledger.
Sawtooth Lake has taken the basic model of blockchains and turned it on its head. Most blockchains have three elements:
- A shared record of the current state of the blockchain
- A way of inputting new data
- A way of agreeing on that data
Sawtooth Lake merges the first two into a signal process they call a transaction family. This model is best in use cases where all the participating parties have a mutual benefit to having a correct record.
Intel has allowed its software to be flexible enough to accommodate custom transaction families that reflect the unique requirements of each business. It also built three templates for building digital assets:
- EndPointRegistry: A place to record items in a blockchain
- IntegerKey: A shared ledger that is used for supply chain management
- MarketPlace: A blockchain trading platform for buying, selling, and trading
- digital assets
Exploring the consensus algorithm: Proof of Elapsed Time
The consensus algorithm for Sawtooth Lake is called Proof of Elapsed Time (PoET). It was built to run in a secure area of the main processor of your computer, called a trusted execution environment (TEE). PoET leverages the security of the TEE to prove that time has passed by time-stamping transactions.
Other consensus algorithms have some kind of time-stamping element as well. The way they ensure the records have not been changed is through publicly pub- lishing their blockchains as proof that it has not been altered. The published led- ger acts as a public witness that anyone can roll back and check. It’s sort of like publishing an ad in a newspaper to prove something happened.
PoET also has a lottery system that works a bit differently from other blockchains using proof of work. It randomly selects a node from the pool of validating nodes. The probability of a node being selected increases proportionally to how much processing resources that node contributed to the shared ledger. Measures may be put in place to prevent nodes from gaming the system and corrupting the ledger.
Deploying Sawtooth
Intel has put together some fantastic documentation and tutorials at https:// intelledger.github.io/tutorial.html. They walk you through the process of setting up a virtual development environment for a blockchain, and they even have one for building a blockchain Tic-Tac-Toe game. You need to be familiar with Vagrant and VirtualBox in order to take advantage of what they have to offer.
