What is a smart contract?
Smart contracts predate blockchain by decades, although they have become synonymous with blockchain and Web3 technologies. Like Dean Tribble d’Agoric said in an interview with The New Stack, “At its core, a smart contract is software that enforces the terms of an agreement, such as a legal contract between third parties.”
Some familiar examples might be something like Uber using software to connect you to an unknown driver who agrees to take you to a pre-selected destination; it’s a kind of smart contract. The transaction requires a trusted intermediary, in this case a centralized software company, which has privileged access to information such as your credit card and payment-side location, and driver availability. The software connects the two sides, giving you a ride and the driver a fee.
“Blockchains bring replicated execution,” Tribble said, “where you have machines in multiple jurisdictions and administrative domains that all vote to agree on what happens. or government cannot compromise the integrity of the execution.
This allows for things like financial transactions that cross borders in a more complicated trust than a driver and passenger located in the same city. Agoric’s goal is to allow a large part of the commercial world to work in this environment, which means that it must be programmable by more than a few thousand developers. So there’s nothing better than a language understood by 16 million developers, allowing them to use a familiar development environment.
I asked Tribble about the potential downsides, and he started with a concise response, saying, “There are probably downsides, but that doesn’t matter. Github did an analysis and 97% of the code in [applications on Github] comes from third-party libraries.
But he followed up with a bit more detail.
“There are a lot of downsides to specific component models,” he said. “You really want a language, framework, and libraries that minimize security risks while making them easy to assemble. React is a good example of this because the model had the means and solved the right challenges to tie things together. There were a lot of UX frameworks before React, but React got it right. Our components are like React components and our framework supports using our components and composing an application with other components.
What about security?
The Solidity programming model, on the other hand, has security risks and issues with things like reentrancy. Reentrancy has been a problem with synchronous programming models for as long as there have been synchronous programs. This occurs when a program can effectively repeat the same request to another program several times before the requester receives an acknowledgment that the original request has been made. This means, for example, that you can request the same amount of ETH repeatedly and keep getting more before the program you are requesting it from has time to recognize that you have received your money. Will Shahda offers a good example of this on Medium.
According to Tribble, the risk of these reentrancy attacks was highlighted by Agoric lead engineer Brian Warner in a security review of Ethereum before it went live. He also acknowledged that it was potentially the right compromise to make at the time. Switching to an asynchronous model allows you to avoid a reentrancy problem, but since this is a fundamental feature of Ethereum’s design, it is not something that can be fixed.
Reduced user fees
One of the biggest complaints about Ethereum is the gas charges associated with proof of work. At the heart of this problem is a fundamental misalignment between people who want to increase activity on the Ethereum network and miners who want to increase fees. As Tribble puts it, “Miners are the slum lords and Ethereum is the building. The only way for the landlord to get more money is to raise the rent.
In addition to being a Layer 1 proof-of-stake network, Agoric seeks to address this economic incompatibility in order to align their blockchain network priorities with the dynamics of a functioning economy. As a result, they separated their governance token, BLD, and their fee token, RUN, with the goal of RUN being a stable token that does not fluctuate.
Tribble explains the reasoning this way: “Think of gas costs like your rent or electric bill. Ethereum is like paying your rent with Apple shares. It’s not great from a business planning perspective. It is difficult to compare whether the rent has increased or decreased from month to month. What you want instead is to pay a stablecoin for the gas, which means it has to be intrinsic to the chain and shouldn’t go into validators’ pockets – there’s no therefore no incentive to increase the rent. ”
This is where RUN comes in. “RUN which is used in execution goes into FX reserves to provide stability and execution growth for the chain,” Tribble said. “All fees for validators come from the RUN borrowing fee, not the run payment. This means that as the economy grows, as I send you more checks, as as I buy more NFTs, as I lock more tokens, the amount of RUN in circulation increases and a small fraction goes to BLD holders for staking and delegation, so their reward increases as the economy is growing.
Featured image from DepositPhotos by peshkova.