B. A private key lets you decode messages sent to you over public channels.
C. A private key lets you enter public channels.
D. A private key lets you publish information on public channels.
5. What is a public key?
A. A public key allows anyone to send you a private message over a public channel.
B. A public key lets you decode messages.
C. A public key opens up a public channel.
D. A public key allows known people to send you a private message over a public channel.
6. What is a hash?
A. A hash is a two-way mathematical proof of data. It creates a digital fingerprint of information and allows you to take a data input of any size and produce a fixed-length string.
B. A hash is a three-way mathematical proof of data. It creates a large data file of information.
C. A hash is a one-way mathematical proof of data. It creates a digital fingerprint of information and allows you to take a data input of any size and produces a fixed-length string.
D. A hash is a one-way mathematical proof of data. It creates a large data file of information.
7. Do you always get the same fixed-length string from a data set when it is hashed?
A. Yes, hashes are deterministic, no matter how many times a block runs through a hash function, you will always get the same result.
B. No, hashes are always unique.
C. Hashes will always give two results.
D. Hashes can be decrypted with a private key.
8. What is a ledger?
A. A ledger is a record of bitcoins.
B. A ledger is a tool for encryption.
C. A ledger is a record of economic transactions.
D. A ledger is device to store bitcoin.
9. In the context of blockchains, what is a “public witness”?
A. A node on a blockchain network is a public witness. It is attesting to the accuracy and truthfulness of information.
B. A witness that attests to its accuracy and truthfulness of information.
C. A digital court house, library, or archive where people store information to reference.
D. A person sending a transaction over a public network.
10. Mining on a blockchain does what three things?
A. Mining hides cryptocurrency, broadcasts transactions and publishes a history of transactions.
B. Mining creates new cryptocurrency, confirms transactions and secures the blockchain’s history.
C. Mining creates new cryptocurrency, blocks bad transactions and secures the blockchain’s history.
D. Mining creates tokens, confirms assets and secures the blockchain’s history.
3 The structure of the network: consensus algorithm
A consensus algorithm is a code that governs how a blockchain operates. It sets the rules that all participants must follow to process transactions. Consensus algorithms create a network structure and process that allows a group of independent systems to agree on a single version of the truth. Consensus algorithms are not unique to blockchain technology, but they are the foundation of all blockchains. They are the set of rules that govern how each blockchain functions.
It is essential to understand the different common blockchain network structures and the consensus algorithms that dictate their structure. Understanding these structures will empower you to make informed design decisions when building applications and processing transactions.
In this section, you will uncover many of the most significant consensus rules that govern how blockchains work. You will discover how these algorithms impact the functionality and, by extension, the best use you can obtain from blockchains that utilize this type of consensus algorithm.
3.1 Proof of Work
Proof of Work (PoW) was proposed by Satoshi Nakamoto and is still used by Bitcoin, Ethereum, Litecoin, Dogecoin and many other public blockchains. It is a competitive consensus algorithm where each mining node on the blockchain is competing to secure blocks. It allows anyone to participate at any level in the creation and maintenance of the system but is very competitive. Nodes that hope to be competitive and be rewarded with cryptocurrency will need to operate specialized equipment. The algorithm is, by design, energy intensive and expensive. The expense and difficulty of obtaining bitcoins was an intentional part of the token economics. Much like mining gold, it is not cheap nor easy to mine, and the difficulty and scarcity of bitcoins is thought to drive part of the value of the asset.
The Proof of Work algorithm functions by having some of the participants of the Bitcoin blockchain, called miners, solve a complex computational problem. The miner who solves the problem first adds a new block of transactions to Bitcoin’s blockchain. The miner is then given a “block reward” with bitcoins. Currently, miners receive 12.5 bitcoins for finishing first. The number of bitcoins rewarded to miners decreases over time.
The number of miners competing for bitcoins changes frequently because each miner is participating willingly and freely. The Proof of Work algorithm will adjust the difficulty of the problem the miners are solving in order to maintain a more consistent time between blocks and to ensure the security of the transactions that are being secured in each block.
It is not uncommon for more than one miner to solve a block problem concurrently. When this happens, miners pick one of the wining blocks to continue building their chain. The longest chain wins. It is recommended that you wait for at least six blocks before confirming a transaction. You do this to ensure that enough blocks have been secured on top of the block your transaction was placed within.
The Bitcoin blockchain is protected from corruption as long as 51% or more of the blocks being created by miners are legitimate. The miners are economically incentivized only to produce valid blocks.
PoW tends to be used for peer-to-peer transaction between parties that are not connected. It can be expensive to scale applications that are built within PoW blockchains (Decentralized application, DApp) as they can be expensive and cumbersome to operate.
Figure 15 Proof of Work.
Pros:
■ It has been tested since 2009 and still works great;
■ It is slower and safer - you know your transaction will not be rolled back;
■ It is trustless - no one can block your transaction from processing.
Cons:
■ It’s slow - you have to wait for your transaction to be confirmed;
■ It’s costly - transaction costs can go up with the number of users;
■ It’s susceptible to centralization over time - those with the most recourses can pool together their efforts in mining.
3.2 Proof of Stake (PoS)
Proof of Stake (PoS) is a competitive consensus algorithm. It was created as an alternative to the Proof of