Here is a brief recap of yesterdayβs talk at ETH LATAM entitled βVyper + DeFi = πβ, a title equally good whether you speak English, Spanish or mathematics.
The nature of the talk is non-technical, but intended to provide users a background into the nature of high level smart contract programming languages (ie Vyper, Solidity) and the EVM bytecode to which they compile.
The talk is also intended to ratchet down the temperature in the developer flame wars between Solidity and Vyper. We all agree that the best case scenario is more great languages to allow more programmers more methods of creating great applications on Ethereum β hence why Vitalik and the Ethereum Foundation support languages like Vyper and FE.
All these languages share a common goal. Keep users from having to work directly on assembly-level bytecode, which is ugly and hard to code directly. We want more high-level interpreters so humans can avoid playing with this difficult type of code:
In fact, Vyper proponents are all on record saying nice things about Solidity. So this is not a flame war, weβre all on the same team!
The talk goes into more detail on Vyper in particular, and how its core values of security, simplicity, and audibility have informed the evolution of the compiler. Since Vyper 3.2 brought Vyper into full compatibility with Solidity, the decision of whether to use Solidity or Vyper no longer became one dictated by the limitations of what could be compiled and published on-chain. Now, it becomes a choice of which compiler the developer prefers for the task at hand.
At the moment, we argue Vyper has advantages in terms of readability and optimization for gas efficiency. In contrast, Solidity programmers currently see gas optimization and readability as an βeither-orβ tradeoff β arguing in some cases itβs important to sacrifice gas efficiency for readability (OpenZeppelin contracts) or vice versa (Azukiβs ERC721A or OpenSeaβs Seaport).
The strongest advantage of Solidity, in our estimation, lies in this modularization and the range of easy to plug-in templates, which Vyper presently lacks. One can easily import a variety of templates for ERC-721 NFTs or ERC-20 fungible tokens and launch products quickly.
Solidity + NFT = π
If our thesis is that Vyper and DeFi is a perfect match, letβs concede the opposite. Perhaps Solidity is the best fit for NFTs. We stated that Vyper rejects the false dilemma between gas optimization and readability. Vyper has both.
However, the NFT community appears to care about neither. Donβt go quoting gas optimization to users who donβt care about fighting multi-million dollar gas wars to get their collectible.
NFT mints involve a scarce number of collectibles, and users will push their price up to some theoretical market equilibrium, without much regard for whether this value is captured by auction mechanics or gas prices is irrelevant to the end user.
So if NFT enthusiasts donβt particularly care about gas prices, perhaps they care about readability? Judging by the occasionally crude infosec skills on display among some NFT holders, weβre assuming this is not a priority.
It amounts to NFTs being a pretty good use case for Solidity. Easy to plug and play templates, low concerns about readability or gas use.
This is in fact a major strategic concession for this Vyper maxi! NFTs are more or less cryptocurrencyβs bread and butter. Ethereum is essentially a globally distributed supercomputer used to print overpriced pictures of animal cartoons.
In fact, it was only until recently that Vyper even had its first NFT appear on OpenSea. Vyper, lacking easy imports at the moment, means the community may as well cede this ground. Any snapshot of the most recent contracts on Etherscan is certain to see these are overwhelmingly Solidity and disproportionately NFTs.
Vyper + DeFi = π
So weβll be happy to concede NFT may not be a natural advantage for Vyper, but in the same breath letβs assert Vyper a better choice for DeFi. This may explain why despite 99% of contracts being Solidity, Vyper has a disproportionately strong share of TVL.
NFT users may not care about throwing money into a bottomless pit to retrieve a collectible, but in DeFi being able to tally the efficiency of a transaction down to a single Wei is crucial. Gas savings can become a key differentiator in this arms race.
At the moment, Vyperβs compiler is consistently able to generate more gas efficient tokens.
Moreover, DeFi users rightly have intense concern about where they are putting their money. This is big points to they care a lot more that the contracts are easy to read and easier to audit.
Even if Solidity flexes its capability of integrating assembly level programming to reduce gas costs, this may remain a barrier to devs forking and extending this code. Besides which, if youβre directly manipulating raw assembly code, do you really need Solidity or Vyper to serve as an abstraction layer?
At this level, Vyperβs compiler has added a variety of functionality of great interest to developers, particularly those who are interested in some greater mathematical functionality.
Perhaps more importantly, for some time Vyperβs compiler has demonstrated extraordinary efficiency at handling local variables. For simple contracts this may not matter, but more complex contracts have a variety of βstack too deepβ errors in Solidity that had historically required complex workarounds. Newer versions of Solidity are addressing this, but we give the edge to Vyper for users interested in building complex and mathematically intense projects.
The interesting part from my POV is that most DeFi offerings remain fairly simple at this point β add one token balance, subtract another β little that could not easily be accomplished with a four function calculator.
In my humble opinion, DeFi has a major opportunity to build out richer applications. Weβre really in the infancy of products built atop more advanced mathematics. If I were delineating DeFi 2.0, this is what I would like to see.
TriCrypto is a great example of this β the technical complexity involved in building a self-rebalancing pool capable of inferring oracle prices internally is understood by few. Encode this logic into a smart contract and it becomes indistinguishable from magic.
I hope the next generation of DeFi takes full advantage of the raw capability of the Ethereum distributed supercomputer. Weβre just scratching the surface of what can happen when higher level math is used in decentralized FinTech applications.
Whether itβs built in Vyper, Solidity, or other new languages, we all look forward to seeing the fruits of our familyβs innovation!
Disclaimers! Join the Vyper Discord for more!
Stage Talk Featuring: @VitalikButerin, @ApeFramework, @0xngmi, @emilianobonassi, @k06a, @PatrickAlphaC, @fubuloubu, @BowTiedDevil, @melwritesmiami, @0xKofi, @omurovec, @libevm, @transmissions11, @TransientLabs, @big_tech_sux, @jtriley_eth, @crypto_condom, @ksin751119, @0xhagen, @ZacharyCarlin, @syrebl, @kagniea, @zrowgz, @xenoliss, @maurelian_, @chibuezemiller, @str_xs, @0xSisyphus, @hildobby_, @arzenyEth, @eth_call, @BowTiedEffer, @Scooby_Doomer, @PacDao, @eiber_david, @0xAlcibiades, @bantg, @pcaversaccio, @_bout3fiddy_, @vefunder, @0xz80, @CurveCap