New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

EVM The Lingua Franca of Smart Contracts Daniel Ferrin

Ethereum DenverSun, Oct 9, 2022, 12:00 AM

Transcript

good morning um my name is dan o'farrin um like i said i'm here pitching i'm not really pitching i'm here talking about the evm the ethereum virtual machine and it is in my opinion the main way that you have to speak with smart contracts today and the way that you will be speaking with it in the future so a bit about who i am um wow getting these pdfs there we go so my name is dan o'farrin i'm ex-oracle i used to work at oracle used to work at google and i used to work at consensus my current employer is hedera hashgraph and i was brought on to hedera to specifically work on improving the evm compatibility that they have in the hashgraph ecosystem and part of the reason they hired me is i'm also still a maintainer at hyperledger basu and the evm we're using is the same evm in hedera as he as hyperledger basu is using for its evm processing um so you know i live when i'm pitching the evm is the lingua franca of what we're doing um at hedera and that the other things that i interact with in the greater ethereum community so when you hear lingua franca you know what what goes through your mind is it some old movie joke about how lingua franca is the french is french language when it really isn't literally it means frankish tongue and if you look up on wikipedia it gives you all the great history about where this term came from and it's really insightful as to when people use this to what it really means it's a bridge language it's a common language it's a trade language it's an auxiliary language a vehicular language or a link language all these ships that would scoot around the mediterranean they spoke french they spoke german they spoke turkish they spoke all sorts of different languages across the the mediterranean but when it came time to trade the cargo that they were shipping between each other they used lingua franca they used a language that everyone understood to talk about the specific things they were doing they might not have a word for um for the type for just how delicious particular food you were eating was but they had a word do they understand that you had wheat that you had pasta that you had vegetables what kind of vegetables how much vegetables so it was used to make communication possible among people who didn't speak a common language it was what bridged them together in all their commerce and all their interactions and that is the key of smart contracts is that we are combining things together into a common language is to to speak and trust to speak in commerce to speak in all the other things to make make all the magic happen so this is a chart um i just updated last night and this is basically a summary of the top 50 assets is determined by massari.io by marketcap and i broadly group them into two categories either they are evm in some aspect or they're not and 90 of them are evm in some aspect so the first category is dap of the top 50 assets 17 of them are distributed applications all of them run on one chain that has the evm as its smart contract language not all of them run on ethereum mainnet but every single one of them that runs that is appeared app runs on the evm the next category is layer 1 tokens like bitcoin bitcoin cash dogecoins platforms that don't really have a smart contract language but there are wrapped versions of these tokens available on ethereum mainnet or one of many other networks there's only one that i found that didn't have it but every other single one that i tried to search has it and if i looked hard enough i could probably find a wrapping of that token and some in some place i only looked at uniswap i didn't have a lot of time to update this but i bet if i tried hard i could find one evm wrapping of that token the next category is of course the evm chains where the base programming language is the evm obviously and then we have the long tail of smart contract languages there is five that work in wasm mostly in the polka dot and cause and uh cosmos ecosystem teal which is what tezos runs i think no michelin's tesos teal i think is um near protocol but then you got haskell and eos and eos is the only one that i couldn't find that had a rap token i mean ubu eos there's just no changing that but cadence and flow and solana has bpf but of these 90 if there's no other standard for what is market dominance ninety percent has got to be the standard if you wanna access the broadest swath of the market and you have only one language platform to choose evm is that language and here's some more examples you know we've got the wrapped bitcoin ripple dogecoin file chrome those are all wrapped stable coins these are what most of the dap categories are they all run on a dap that runs on some sort of evm now some of these are deployed across multiple chains and those multiple chains run the evm it's the power of the distribution of the ethereum virtual machine and then you have other peer adapts like uniswap and chain link games like axiomfinity knowledge sharing platforms like the graph where they use the the dap token to credit people for making information available offline now this is like what i said this is an industry standard and here are pictures of current and industry standards of your if you wanted to write a program to be used for a game in the early 2000s or late 90s it ran on windows or you didn't get an audience if you want to put a video out nowadays you want physical media you use a blu-ray you used to use vhs tape the sjh vhs1 over betamax and then you have the 3.5 millimeter plug despite apple's effort to try and ban it from their ecosystem people still flock the phones with it and it's used everywhere else rather than just phones and the bottom right of course is the keyboard now i'm kind of trolling you with some of these a lot of these are former industry standards they had their day and they're gone and i'm really trolling you with the picture of the keyboard if you look really closely it's the uk standard but you would know how to use it because it's close enough that's the great thing about these industry standards if you're close enough often that's all you need so a lot of the evm is reflected in the philosophy spoken of by jamie zawinski made it popular although he didn't invent this notion he got it from another co-worker at an early company he worked out in the early 90s and that is that worse is better for a lot of these things was windows the best operating system around in 2002 it was not but it was the most widely used and that espouses the new jersey style over the mit approach the new jersey style is a very pragmatic style where you do what works and what gets things done and what causes business to happen versus the right thing approach where you do what is intellectually pure you do what is correct you do what looks great on a research paper but may not necessarily translate well to real practical uses so there's four in this paper there are four categories that they identified that were key to making worses better the first one is simplicity new jersey style it's more important for the implementation to be simple than the interface and when you look through some of these evm and solidity codes it's way simpler to implement it is than it is to use some of these things versus the mit approach where it focuses on the user it's more important to be simple to use it than it is to be in the implementation the next standard is correctness in the right thing correctness is non-negotiable but in the new jersey style it's slightly better to be simple and correct if you can do both go for it don't stress out over it the same goes with consistency you can be inconsistent if it makes things simple but in the right way you need to make it consistent correct and simple at the same time in completeness it's okay to be slightly incomplete to go to market versus the right way where everything has to be complete and everything has to be correct and i think where we are today with evm with smart contracts the new jersey style is evident in a lot of things we've done to get things out the door and get to where we are today and this is fine the mit approach is great but it takes longer and costs market time to get there another great example of worse is better would be javascript if you don't know the history of javascript it started out as a 10-day hack in in netscape i think it was called mozilla at the time it wasn't called mozilla mozilla began netscape so it was the progenitor of mozilla and it began as the 10-day hackathon was mostly based off of lisp until they got talked to the marketing people and said you know what sea based languages are the way to go you need to have some curly braces you need to put some semicolons in uh we can be flexible on the semicolons just as long as you can use them um and so it begat live script it became somewhat c like and then marketing people talked to other marketing people and said oh java's hot we got to get the name java in there even though it has basically very little to do with java that name is marketing gold and initially what they did with it is they integrated with java applets and web pages to bridge between these two things it literally was a lingua franca of the web and it outlived applets you can't put an applet on your web browser today but you can't run a web browser without running javascript it's just impossible and then of course if you got ecmascript it went from the new jersey style to more the right way they standardized it they cleaned up some of the holes they added fancy features like yields and and uh promises and added threading and they've added new features like typescript adds typing and you know javascript is a strong reflection of of solid of what the basis of solidity was but javascript is not without its warts if the internet was better this would be a multi-page a multi-step example that javascript programmers would love a lot of these things are confusing if you go through it a step at a time you don't get what you expect and if i had more time and better internet connection to make a great batman joke at the end with all these not a number jokes but this is javascript this is the industry standard this is how things get done and you learn to work around it because everyone speaks javascript everyone knows the warts everyone knows where the potholes are everyone knows where the speed bumps are it's the lingua franca for better or for worse so how does the evm focus on some of this one of the ways it works on the biggest way it works on a simplicity and it's surprising to hear simplicity when you hear the words evm but the evm is the layer below solidity and has a lot less commands than a typical solidity function would for the simplicity it starts the stack based vm which is a lot easier to implement and a lot easier to port across varying scales of architecture on the cpu the stack is a very consistent 256 bits wide it's kind of a pain in the neck to use it causes performance bottlenecks but there is no question about is this assigned integer is this an unsigned integer is it 16 bits is it 32 bits everything's 256 bits that's what you get it's simpler and it's consistent 250 256 bits is also the width of storage and math the storage is the more important part everything that you store you store in 16 byte segments um not 32 byte segments 32 yeah i'm doing the math in my head wrong but in 32 byte segments everything's stored there so you can store your crypto graphic key and you can store your your strings and those consistents there's also no complex bit code format and i'm speaking today this time next year i'll probably be giving a different story because they're introducing the evm object format but a lot of those things are done to make it stable and more broad there's no fancy validations again hold my beer and there are single byte op codes except of course where there are the push operations so it's more important to be simple and in the end we're sacrificing simplicity and the consistency to get work done worse is better worse is how we got here and is very broad and usable so here's a larger example of what the ecosystem looks like the green box on the bottom is the evm and most people access the evm through solidity and if you're using a modern solidity compiler you're not actually accessing the edm through solidity you're accessing it through yule so you can get from all of your writing your nft your token your governance your game you're coming down you could write it in viper that would go to the evm or solidity or you could have solidity go to wasm they're working on that they've been working on that for years one of these years it may actually work um may actually get the broad adoption and the speed that they've been looking for they've been trying really hard you've got some great people working on that hope they get there but at the end of it at the bottom you're deploying this evm on whether it's a layer 1 or layer 2 roll-up or if you're even transpiling it into another language there's they can take evm and spit it into zk contracts if they want to do that but most of these almost all these paths almost all of them go through the evm not all of them go through the evm but it really shapes the the landscape of the architecture of the landscape architecture of how you would go about doing this this is another slide glow is one example of how they're working around this glow is a language that targets cardano and one of the outputs it does is evm even though cardona was utxo based and kind of formed the way a lot of ethereum does it still targets the evm to show just how how broad-based this acceptance is becoming now here's an example of vipre versus solidity if you don't like curly braces you can still access the evm if you enjoy tabs or spaces but if you like curly braces you can go back and you can still use your javascript looking type things which aren't exactly javascript because solidity's got its own unique features that add value that smart contract developers need and you can see it's roughly the same amount of code to do roughly the same things so it's a lot of style it's just how you prefer to do it and what's great about this is when you compile is you don't know the evm byte code it's going to but your system does and they all speak it now there's a lot of different implementations of the evm floating around um geth is of course the most widely used one because it's the most widely used blockchain client on the ethereum main net but the list goes on and on i ran out of space i didn't want to shrink the font anymore whether i knew i do know a few more than the ones on there but i didn't want to go below 20 point font you got guest hyperledger open ethereum another mine mantis burro aurora near protocol uses that evm1 that thing just blazes it's fast javascript arbitrim has their own platform that you access through the evm python ethereum j and all the get the drive chains like avalanche and phantom and all the other ones all have the evm so from this we get a very significant halo effect in developer tooling reusable libraries tutorials auditing and also wallets um truffle hard hat open zeppelin and remix all work with evm and they work really great with it because they have one thing to target with and it really speeds up development in fact if you're starting up a new blockchain or you're trying to get your existing blockchain the best way to get more developers is to make sure people can use truffle remix and hard hat and they will be able to use it and they just won't care what they're using underneath it tutorials i only put one up here because there's so many tutorials i didn't want to get any vendors upset this is the one off the ethereum.org site but there are all sorts of trainings when you have a single lingua franca language to work with that makes it easier to learn auditing and security i did an update with everyone that's here at east denver but these are just some of the top ones and some of the top features of making sure that you're writing the code right because there's a lot of ways to write solidity wrong and there's a lot of people who are out there to help you to figure out the right way to write it and there's probably a slide i'm missing that i would have put in between here and the end where i would talk about end user tooling meta mask uh ledger wallets any of your other hardware wallets any other browser plugins that you would use to store your keys and sign your transactions those are a significant bridge between the dap and your end user and you know they all speak the solidity of the really good ones understand the bytecode of the solidity uh call format and can tell you exactly what's being requested so if there's one recommendation recommendation i have and it's not going to be a hard one for this crowd if you're writing a smart contract write something that runs on the evm it will get you everywhere it'll get you 90 of the ways it'll get you such amazing market penetration without even trying thanks any questions

Automatic transcript — names and jargon may be misspelled.