DeFi and the Future of Finance. Campbell R. HarveyЧитать онлайн книгу.
of Bitcoin we have not experienced any inflation surge. Therefore, there is no empirical evidence of its efficacy.
III DeFi INFRASTRUCTURE
In this chapter, we discuss the innovations that led to DeFi and lay out the terminology.
BLOCKCHAIN
The key to all DeFi is the decentralizing backbone: a blockchain. Fundamentally, blockchains are software protocols that allow multiple parties to operate under shared assumptions and data without trusting each other. These data can be anything, such as location and destination information of items in a supply chain or account balances of a token. Updates are packaged into “blocks” and are “chained” together cryptographically to allow an audit of the prior history – hence the name.
Blockchains are possible because of consensus protocols – sets of rules that determine what kinds of blocks can become part of the chain and thus the “truth.” These consensus protocols are designed to resist malicious tampering up to a certain security bound. The blockchains we focus on currently use the proof of work (PoW) consensus protocol, which relies on a computationally and energy intensive lottery to determine which block to add. The participants agree that the longest chain of blocks is the truth. If attackers want to make a longer chain that contains malicious transactions, they must outpace all the computational work of the entire rest of the network. In theory, they would need most of the network power (“hash rate”) to accomplish this – hence, the famous 51 percent attack being the boundary of PoW security. Luckily, it is extraordinarily difficult for any actor, even an entire country, to amass this much network power on the most widely used blockchains, such as Bitcoin or Ethereum. Even if most of the network power can be temporarily acquired, the amount of block history that can be overwritten is constrained by how long this majority can be maintained.
As long as no malicious party can acquire majority control of the network computational power, the transactions will be processed by the good faith actors and appended to the ledger when a block is “won.”
The focus here is on proof of work, but many alternative consensus mechanisms exist, the most important of which is proof of stake (PoS). Validators in PoS commit some capital (the stake) to attest that the block is valid and make themselves available by staking their cryptocurrency. Then, they may be selected to propose a block, which needs to be attested by many of the other validators. Validators profit by both proposing a block and attesting to the validity of others’ proposed blocks. PoS is much less computationally intensive and requires vastly less energy.
CRYPTOCURRENCY
The most popular application of blockchain technology is cryptocurrency, a token (usually scarce) that is cryptographically secured and transferred. The scarcity is what assures the possibility of value and is itself an innovation of blockchain. Typically, digital objects are easily copied. As Eric Schmidt, the former CEO of Google, said,1 “[Bitcoin] is a remarkable cryptographic achievement and the ability to create something that is not duplicable in the digital world has enormous value.”
No one can post a false transaction without ownership of the corresponding account due to the asymmetric key cryptography protecting the accounts. You have one “public” key representing an address to receive tokens and a “private” key used to unlock and spend tokens over which you have custody. This same type of cryptography is used to protect your credit card information and data when using the Internet. A single account cannot “double spend” its tokens because the ledger keeps an audit of the balance at any given time and the faulty transaction would not clear. The ability to prevent a double spend without a central authority illustrates the primary advantage of using a blockchain to maintain the underlying ledger.
The initial cryptocurrency model is the Bitcoin blockchain, which functions almost exclusively as a payment network, with the capabilities of storing and transacting bitcoins across the globe in real time with no intermediaries or censorship. This is powerful value proposition gives bitcoin its value. Even though its network effects are strong, some competitors in the cryptocurrency space offer enhanced functionality.
THE SMART CONTRACT PLATFORM
A crucial ingredient of DeFi is a smart contract platform, which goes beyond a simple payments network such as Bitcoin and enhances the chain's capabilities. Ethereum is the primary example. A smart contract is code that can create and transform arbitrary data or tokens on top of the blockchain to which it belongs. Powerfully, it allows the user to trustlessly encode rules for any type of transaction and even create scarce assets with specialized functionality. Many of the clauses of traditional business agreements could be shifted to a smart contract, which not only would enumerate but also algorithmically enforce those clauses. Smart contracts go beyond finance to include gaming, data stewardship, and supply chain.
Ethereum charges a gas fee for every transaction – similar to how driving a car takes a certain amount of gas, which costs money. Imagine Ethereum as one giant computer with many applications (i.e., smart contracts). If people want to use the computer, they must pay for each unit of computation. A simple computation such as sending ether (ETH) requires minimal work to update a few account balances and thus has a relatively small gas fee. A complex computation involving minting tokens and checking various conditions across many contracts requires more gas and thus will have a higher fee. The gas fee may lead to a poor user experience, however. It forces agents to maintain an ETH balance to pay it and leads to worry about overpaying, underpaying, or the transaction not taking place at all. So initiatives are ongoing to eliminate gas fees from end users. There are also competitor chains that completely remove this concept of gas.
However, gas is a primary mechanism for preventing system attacks that generate an infinite loop of code. It is not feasible to identify malicious code of this kind before running it, a problem formally known in computer science as the halting problem. Suppose a car is on autopilot, stuck in full throttle with no driver. Gas acts as a limiting factor: the car will stop eventually when the gas tank empties. In the same way, gas fees secure the Ethereum blockchain by making such attacks cost-prohibitive. They incentivize highly efficient smart contract code since contracts that use fewer resources and reduce the probability of user failures have a much higher chance of being used and succeeding in the market.
On a smart contract platform, the possibilities rapidly expand beyond what developers desiring to integrate various applications can easily handle. This leads to the adoption of standard interfaces for different types of functionality. On Ethereum, these standards are called Ethereum Request for Comments (ERC). The best known of these define different types of tokens that have similar behavior. ERC-20 is the standard for fungible tokens and defines an interface for tokens whose units are identical in utility and functionality.2 It includes behavior such as transferring units and approving operators for using a certain portion of a user's balance. Another is ERC-721, the non-fungible token standard, which are unique and often used for collectibles or assets such as peer-to-peer loans. The benefit of these standards is that application developers can code for one interface and support every possible token that implements that interface. We will discuss these interfaces in more detail later on.
ORACLES
An interesting problem with blockchain protocols is that they are isolated from the world outside of their ledger. That is, the Ethereum blockchain authoritatively knows what is happening only on the Ethereum blockchain and not, for example, the level of the S&P 500 or which team won the Super Bowl. This limitation constrains applications to Ethereum native contracts and tokens, thus reducing the utility of the smart contract platform; it is generally known as the oracle problem. In the context of smart