A blockchain is a distributed system that achieves security through cryptography and consensus, without relying on trust. It’s a breathtaking innovation. Credit: Cybrain / Getty Images If one technology trend could prove to be even more tectonic and enduring than cloud computing, it is the blockchain. While the cloud challenges how we build software and modifies how we operate businesses, blockchain technology potentially alters how we think about and process transactions, authentication, and more. Beyond serving as a foundation for cryptocurrency, blockchain could influence in a fundamental way how we propose and record agreements. The revolutionary nature of blockchain and the cryptocurrencies it enables are much touted. When contemplating how current technology developments might play into the future, it’s tough to identify another development more likely to influence the shape of things to come. Blockchain may prove to be the most significant innovation since the internet. So what is blockchain technology, and what makes it so potentially transformative? The case for decentralized transactions Building distributed software systems is hard. The core of this difficulty is the data: protecting it, making it available, storing it. Although much of the difficulty stems from human beings trying to cheat the system, there is also inherent objective difficulty in overcoming failures and maintaining data consistency (for example, see the CAP theorem). Any time data is sent or retrieved—be it a post about your lunch or check the balance of your bank account—it is subject to these hazards. In the case of something important, like your bank account, the traditional way to make data secure and accurate is via a trusted agent such as a bank. The distributed version of banking was the result of grafting traditional financial management practices onto the internet. The bank was trusted to persist and retrieve our financial information. The limitations of this arrangement are spelled out in the Bitcoin whitepaper that triggered the crypto tidal wave. (The foundational document in cryptocurrency, this paper by Satoshi Nakamoto proposes the first real-world, public blockchain network.) Nakamoto’s criticisms of the “inherent weaknesses of the trust based model” are pegged to the fact that “non-reversible transactions are not possible.” Put another way: banks are required to be in the position of mediating disputes, which causes trust to spread and costs to climb. For a whitepaper that describes a full-blown alternative to traditional banking, this criticism is fairly tempered. Most of us could readily find further problems: surprise fees and interacting with Byzantine corporate structures, for starters. Furthermore, the structures offer significant obstacles to participation in the financial system for disenfranchised players. The Bitcoin paper proposes an alternative: an “electronic payment system based on cryptographic proof instead of trust.” Cryptographic signing The core mechanism for such a network is cryptographic pairs used to sign transactions. Owners of electronic currency (or more generally, a digital state) sign over the currency (or state) to buyers with their public key and verify themselves with their private key. Every transaction also carries a hash of the previous transaction and the owner’s public key. You can see this structure in Figure 1. Figure 1. Blockchain signing IDG Double spending and the blockchain If all the participants in the network operated in good faith, the chains of transactions would already be secure (that is, the system would be safe from external direct tampering thanks to the cryptographic signing). The weakness is that owners of currency could trick the system by spending it more than once. A buyer has no way of knowing if the currency they purchase has already been spent. To solve this problem without retreating back to a central authority is no simple task. It requires that all participants in the network become aware of all transactions and their order of occurrence. If we could achieve that, then nodes could accept only the first instance of a transaction and discard all others. The Bitcoin whitepaper proposed the blockchain as the mechanism to solve the so-called double-spend problem. The central idea is that transactions are gathered into a set (a “block”) and nodes in the network expend computational effort to calculate a value that is challenging to solve. The value, a nonce, is an arbitrary number used only once in a cryptographic communication. When hashed, it produces a value with a certain number of leading zeroes. Every block also refers to the hash of the previous block. This setup means that transactions are accepted into blocks that are verified with computational effort. Each new block creates a longer chain of such work. How consensus truth works As each node works away to validate its block of transactions, other nodes do the same. If a given node receives a competing block from the network, it saves that block to a competing chain and continues working on its own chain. If the node receives enough new blocks on the competing chain, it discards its work and accepts the competing chain as the truth. If the current node finishes its work before the competing chain is confirmed, the current node broadcasts its effort to the network. The other nodes behave in the same way with respect to validating that claim. In this way, the network inevitably accepts the work of the greatest number of nodes, in a sense voting for a consensus version of the truth, backed by the computational work required by the hashes. What is a 51% attack? To fool this system, one would be required to redo all of the work of the chain, which becomes increasingly less likely as the chain grows. The name for attempting to overtake the legitimate chain of blocks is a 51% attack. The idea is that an attacker would obtain more than half of the computational power participating in the system and use it to validate false transactions. As the blockchain grows, this becomes more difficult, and even if achieved it offers limited capabilities. Mining and minting The activity of mining is much publicized, having taken on geopolitical significance. But what is it? With our understanding of the blockchain thus far, we can describe it clearly. When a node succeeds in validating its block (by obtaining a good hash and proving to the network that it is the first valid new block on the chain), it receives a new coin that it owns. This is mining. The coin serves as an incentive for the system to participate in the mining process. Security without trust The chief achievement of the blockchain is in securing a network which runs on nodes owned by everyone. It seems counterintuitive, but the system works by making assumptions not just about cryptography, but about human behavior. That a widely distributed system controlled by (let us be frank) untrustworthy human beings should function securely is breathtaking. Once the functionality of this system was demonstrated by Bitcoin, the explosion of new digital coins has been remarkable. One noteworthy coin is Ether, created by Ethereum, a company that proposes to layer a Turing-complete computer atop a Bitcoin-like blockchain. And there are many others. (See my introduction to Ethereum smart contracts for more about this technology.) In the specific case of currencies, traditional banking will certainly continue to a significant degree as is, and entrenched interests in the financial system will work to gain advantages within the crypto system. They have already moved to introduce their own coins. Perhaps the most history-altering promise of blockchain systems is that humanity may have landed upon a method for arriving at consensus for remotely connected participants. Such capability has far-ranging implications, difficult to specify in detail, but easy to predict as broad. Blockchain challenges Of course, there are challenges to blockchain. For one, the extreme volatility of crypto markets makes it hard to predict cryptocurrency values (stablecoins have been introduced for this reason). For another, programming the blockchain is difficult. Finally, entrenched interests in financial and other industries are resistant to blockchain. Taken as a whole, blockchain technology is an astonishing innovation and fascinating space to watch as it rapidly evolves before our eyes. Related content feature 14 great preprocessors for developers who love to code Sometimes it seems like the rules of programming are designed to make coding a chore. Here are 14 ways preprocessors can help make software development fun again. By Peter Wayner Nov 18, 2024 10 mins Development Tools Software Development feature Designing the APIs that accidentally power businesses Well-designed APIs, even those often-neglected internal APIs, make developers more productive and businesses more agile. By Jean Yang Nov 18, 2024 6 mins APIs Software Development news Spin 3.0 supports polyglot development using Wasm components Fermyon’s open source framework for building server-side WebAssembly apps allows developers to compose apps from components created with different languages. By Paul Krill Nov 18, 2024 2 mins Microservices Serverless Computing Development Libraries and Frameworks news Go language evolving for future hardware, AI workloads The Go team is working to adapt Go to large multicore systems, the latest hardware instructions, and the needs of developers of large-scale AI systems. By Paul Krill Nov 15, 2024 3 mins Google Go Generative AI Programming Languages Resources Videos