Differences between public and private blockchains
When starting to develop applications to be run on the blockchain, the technologies that you will need depend on whether you will allow anyone to join and write data on your blockchain, or whether only known, (partly) trusted entities will be allowed to join and write data. Generally speaking, there are two kinds of blockchains: public, or permissionless, and private, or permissioned. A public blockchain is not specifically owned by anyone, whereas a private blockchain can be owned by a single entity or by a consortium (group of entities). As explained throughout this chapter, both public and private blockchains use the same technologies, but this is where the similarities end.
- Public blockchains: When we talk about public blockchains, we generally mean that the distributed ledger is public, and virtually anyone, without having any permissions granted by a central authority, can write and/or read data to the ledger. Since a public blockchain is designed to be trustless (anyone can write to it), and participants don't need anyone's approval to add data to the ledger, it requires advanced mechanisms for arbitrating discrepancies and ways to defend itself against attacks, as there is no authority to decide what happens when someone misbehaves. To secure a public blockchain, anyone can choose to participate in the consensus (validation) process, assisting in validating transactions by determining which ones get added and by verifying the current form and status of the blockchain. Another advantage stemming from the fact that anyone can join a public blockchain (trustless) is that most are secured by crypto-economics, where participants receive economic incentives for the work they do to validate transactions. This makes it more interesting to join, and it creates a fully decentralized network. The downside of a public blockchain is that these mechanisms create more complexity and raise the cost of running this type of blockchain.
- Private blockchains: Conversely, in a private blockchain, the distributed ledger is only accessible to participants who are known and trusted. The control over who can read verified transactions, who can submit transactions, and who can verify transactions, is done by a preselected set of nodes. Participants can only join after obtaining an invitation or gaining permission. An invitation can be sent by an existing participant, a certificate authority, or by a decision of the entire consortium.
The private blockchain is mandated when a consortium of parties wish to participate in trading, but sometimes do not fully trust one another, or when some information should only be accessible to some of the trading partners. Many of the mechanisms that a public blockchain needs to keep the data tamper-proof are not needed on a private blockchain, but are regulated by legal contracts. This dramatically impacts the technical decisions and changes the building blocks and mechanisms required to run the blockchain. It leads to lower costs and the faster throughput of data, since there are fewer nodes that need to reach consensus. Due to its controlled-access aspect, private blockchains deliver increased privacy so that mission-critical applications can also run on the blockchain. The downside of a private blockchain is that you have to decide which participants have the power of granting permissions.
I will discuss the differences between public and private blockchains and their advantages and challenges in more detail in Chapter 7, Public Versus Permissioned Blockchains and Their Providers.