{"id":12488,"date":"2022-06-14T16:29:00","date_gmt":"2022-06-14T16:29:00","guid":{"rendered":"https:\/\/hederav2stg.wpenginepowered.com\/learning\/ethereum-virtual-machine\/"},"modified":"2025-12-17T07:21:08","modified_gmt":"2025-12-17T07:21:08","slug":"ethereum-virtual-machine","status":"publish","type":"learning","link":"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/","title":{"rendered":"What is the Ethereum Virtual Machine and how does it work?"},"content":{"rendered":"<p>Bitcoin introduced the world to <strong>cryptocurrency<\/strong> in 2008. Still, most crypto-enthusiasts believe Ethereum\u2019s seamless integration of smart contracts in 2015 was the first step towards perfecting Bitcoin\u2019s formula. Ethereum\u2019s smart contracts gave developers an easy way to store on-chain transaction protocols using a programming language. To understand smart contracts, you have to understand the Ethereum Virtual Machine (EVM). It is the state machine that enables smart contract deployment and execution in Ethereum\u2019s decentralized ecosystem. The EVM is also the virtual machine used to power the <a href=\"https:\/\/hedera.com\/smart-contract\" target=\"_blank\" rel=\"noopener\">Hedera Smart Contract service<\/a>, and optimized for blazing-fast transactions, low fees, and incredible scalability.<\/p>\n<h3>What is EVM?<\/h3>\n<h3>The EVM is a virtual machine<\/h3>\n<p dir=\"ltr\">The EVM is a <strong>Turing complete <\/strong>virtual machine that can be accessed globally through a participating network node. The EVM\u2019s Turing completeness is measured by the fact it can run any program. Without the EVM, developers wouldn\u2019t be able to implement the numerous dApps (decentralized applications) for which Ethereum is known.<\/p>\n<p dir=\"ltr\">Virtual machines aren\u2019t tied to a specific physical device and have no system interface or hardware. A <strong>virtual machine<\/strong> uses the computing power of many participants to provide a runtime environment similar to a physical computer. Unlike physical computers, virtual machines aren\u2019t bound to a single operating system or location. People worldwide can use the machine regardless of where they live or what kind of computer they use.<\/p>\n<h3>The EVM is a state machine<\/h3>\n<p dir=\"ltr\">State machines are computation engines that can switch between various states. When a transaction causes a <strong>smart contract<\/strong> to execute, the EVM changes Ethereum\u2019s state to meet the needs of this contract call.<\/p>\n<p dir=\"ltr\">The EVM\u2019s ability to interpret and execute smart contracts during transactions separates Ethereum from simpler blockchains like Bitcoin. The Bitcoin blockchain is simply a distributed ledger. Alternatively, the EVM\u2019s state transition function allows Ethereum to update to a new valid state from block to block in response to a smart contract\u2019s input data.<\/p>\n<p dir=\"ltr\">Ethereum\u2019s state changes allow developers to create custom currencies and NFTs<strong>,<\/strong> represent ownership of underlying physical assets, create non-fungible domain names, and make fully-functioning decentralized finance applications or autonomous organizations (DAOs).<\/p>\n<p dir=\"ltr\">The EVM can run any program written into a\u00a0<a href=\"https:\/\/hedera.com\/blog\/how-to-deploy-smart-contracts-on-hedera-part-1-a-simple-getter-and-setter-contract\" target=\"_blank\" rel=\"noopener\">smart contract<\/a>. However, more <strong>complex smart contracts use more gas,<\/strong> resulting in a higher gas cost. Although gas costs have become a point of contention for many crypto-enthusiasts, they\u2019re an essential part of the EVM. According to Ethereum\u2019s yellow paper, \u201cthe computation is intrinsically bounded through a parameter, gas, which limits the total amount of computation done.\u201d The gas, and gas limits, enable the EVM to avoid network abuse.<\/p>\n<h3>Is the EVM decentralized?<\/h3>\n<p dir=\"ltr\">The EVM could be described as<strong> \u201cmostly decentralized.\u201d <\/strong>Countless individuals worldwide run\u00a0<a href=\"https:\/\/hedera.com\/network-nodes\" target=\"_blank\" rel=\"noopener\">nodes<\/a>, but the majority of Ethereum nodes are hosted on centralized servers like Amazon Web Services. If the owners shut down the nodes, it could damage the network. Still, over time, as new computers participate in the Ethereum network by running nodes, the ecosystem becomes more decentralized.<\/p>\n<h3>How does the Ethereum Virtual Machine work?<\/h3>\n<h3>EVM functionality<\/h3>\n<p dir=\"ltr\">The EVM uses a stack-based architecture and a word size of 256 bits. The 256-bit word size allows the EVM to facilitate <strong>native hashing and elliptic curve operations<\/strong> that ensure funds can be spent only by their rightful owners. The EVM supports various programming languages such as Vyper and Solidity, with\u00a0<a href=\"https:\/\/hedera.com\/blog\/introduction-solidity-smart-contracts\" target=\"_blank\" rel=\"noopener\">Solidity<\/a> being the most popular programming language for smart contract source code. These programming languages are used to write smart contracts, which are converted into the bytecode needed to be utilized by the EVM.<\/p>\n<p dir=\"ltr\">The bytecode stored on-chain, known as the <strong>runtime bytecode,<\/strong> is then converted into an opcode that the EVM computation engine interprets to carry out those actions.<\/p>\n<p dir=\"ltr\">When an <strong>Ethereum transaction<\/strong> executes a smart contract, an EVM is loaded with the information for the transaction being processed. For example, one variable needed for a smart contract execution is the <strong>gas supply<\/strong>, which is set to the amount of gas paid by the sender. The\u00a0<a href=\"https:\/\/www.investopedia.com\/terms\/g\/gas-ethereum.asp\" target=\"_blank\" rel=\"noopener\">gas supply<\/a> is reduced as the transaction progresses, and if, at any point, the gas supply reaches zero, the transaction is abandoned. Although abandoned transactions don\u2019t result in changes to the Ethereum state and are not considered valid transactions, the block\u2019s beneficiary is paid for providing resources up to the halting point.<\/p>\n<p dir=\"ltr\">Smart contracts can initiate transactions and call other contracts on their own. In this case, each call results in another EVM being loaded with specific information for the <strong>new transaction.<\/strong> This new information is initialized from the EVM one level above. If there isn\u2019t enough gas to complete the execution, the state is discarded, and the transaction execution is reset to the EVM one level above.<\/p>\n<h3>How is data stored?<\/h3>\n<p dir=\"ltr\">The\u00a0<a href=\"https:\/\/eth.wiki\/concepts\/evm\/evm\" target=\"_blank\" rel=\"noopener\">Ethereum protocol<\/a> uses two distinct data types \u2013 permanent data and ephemeral data. <strong>Permanent data,<\/strong> such as a transaction, is recorded in Ethereum\u2019s tree-like data structure and will never be altered. <strong>Ephemeral data,<\/strong> such as a wallet\u2019s balance, is recorded and changed in response to new transactions.<\/p>\n<p dir=\"ltr\">EVM\u2019s opcodes use <strong>contract memory <\/strong>to retrieve data. Contract state memory is stored at the contract address and is not persistent. A variable\u2019s position in a smart contract\u2019s storage array is determined by its order in the code. If a given variable is 256 bits or less, the EVM will try to fit multiple variables in the space. When a contract inherits another contract, the storage variables of the base contract are stored in the first slots in the order of inheritance.<\/p>\n<p dir=\"ltr\">Whereas contract memory is impermanent, <strong>contract storage<\/strong> is stored indefinitely. Contract storage is like a public database where values can be read externally without the need to send a transaction. Still, contract storage is expensive compared to contract state memory.<\/p>\n<h3>Using the Ethereum Virtual Machine<\/h3>\n<p dir=\"ltr\">Ethereum\u2019s EVM has allowed the project to achieve its goal of <strong>\u201cdecentralizing everything<\/strong>.\u201d<\/p>\n<p dir=\"ltr\">The EVM is complex in its functionality but accessible to new developers, leading to many decentralized applications. Still, newer projects and blockchains continue to <strong>improve upon the EVM model.<\/strong> For example, Hedera recently announced\u00a0<a href=\"https:\/\/hedera.com\/blog\/smart-contracts-2-0-live-on-mainnet\" target=\"_blank\" rel=\"noopener\">smart contract 2.0 availability<\/a> on the Hedera mainnet.<\/p>\n<p><strong>Hedera\u2019s investment<\/strong> in the EVM will lead to numerous benefits for developers, including low gas fees, fast transaction finality, carbon-negative operations, and leaderless architecture. Additionally, because new blockchain developers use the EVM 30 percent of the time, Hedera\u2019s EVM compatibility will give entry-level Solidity developers a new, less expensive way to develop and deploy dApps.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Bitcoin introduced the world to cryptocurrency in 2008. Still, most crypto-enthusiasts believe Ethereum\u2019s seamless integration of smart contracts in 2015 was the first step towards perfecting Bitcoin\u2019s formula. Ethereum\u2019s smart contracts gave developers an easy way to store on-chain transaction protocols using a programming language. To understand smart contracts, you have to understand the Ethereum [&hellip;]<\/p>\n","protected":false},"author":4,"featured_media":0,"template":"","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"tags":[38],"class_list":["post-12488","learning","type-learning","status-publish","hentry","tag-smart-contracts"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.9 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>What is the Ethereum Virtual Machine and how does it work? | Hedera<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"What is the Ethereum Virtual Machine and how does it work? | Hedera\" \/>\n<meta property=\"og:description\" content=\"Bitcoin introduced the world to cryptocurrency in 2008. Still, most crypto-enthusiasts believe Ethereum\u2019s seamless integration of smart contracts in 2015 was the first step towards perfecting Bitcoin\u2019s formula. Ethereum\u2019s smart contracts gave developers an easy way to store on-chain transaction protocols using a programming language. To understand smart contracts, you have to understand the Ethereum [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/\" \/>\n<meta property=\"og:site_name\" content=\"Hedera\" \/>\n<meta property=\"article:modified_time\" content=\"2025-12-17T07:21:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hedera.com\/wp-content\/uploads\/2025\/12\/HH60178_OGHederaSite_V2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/\",\"url\":\"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/\",\"name\":\"What is the Ethereum Virtual Machine and how does it work? | Hedera\",\"isPartOf\":{\"@id\":\"https:\/\/hedera.com\/#website\"},\"datePublished\":\"2022-06-14T16:29:00+00:00\",\"dateModified\":\"2025-12-17T07:21:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/hedera.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"What is the Ethereum Virtual Machine and how does it work?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/hedera.com\/#website\",\"url\":\"https:\/\/hedera.com\/\",\"name\":\"Hedera\",\"description\":\"Hello future\",\"publisher\":{\"@id\":\"https:\/\/hedera.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/hedera.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/hedera.com\/#organization\",\"name\":\"Hedera\",\"url\":\"https:\/\/hedera.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/hedera.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png\",\"contentUrl\":\"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png\",\"width\":500,\"height\":375,\"caption\":\"Hedera\"},\"image\":{\"@id\":\"https:\/\/hedera.com\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"What is the Ethereum Virtual Machine and how does it work? | Hedera","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/","og_locale":"en_US","og_type":"article","og_title":"What is the Ethereum Virtual Machine and how does it work? | Hedera","og_description":"Bitcoin introduced the world to cryptocurrency in 2008. Still, most crypto-enthusiasts believe Ethereum\u2019s seamless integration of smart contracts in 2015 was the first step towards perfecting Bitcoin\u2019s formula. Ethereum\u2019s smart contracts gave developers an easy way to store on-chain transaction protocols using a programming language. To understand smart contracts, you have to understand the Ethereum [&hellip;]","og_url":"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/","og_site_name":"Hedera","article_modified_time":"2025-12-17T07:21:08+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/hedera.com\/wp-content\/uploads\/2025\/12\/HH60178_OGHederaSite_V2.jpg","type":"image\/jpeg"}],"twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/","url":"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/","name":"What is the Ethereum Virtual Machine and how does it work? | Hedera","isPartOf":{"@id":"https:\/\/hedera.com\/#website"},"datePublished":"2022-06-14T16:29:00+00:00","dateModified":"2025-12-17T07:21:08+00:00","breadcrumb":{"@id":"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/hedera.com\/learning\/ethereum-virtual-machine\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/hedera.com\/"},{"@type":"ListItem","position":2,"name":"What is the Ethereum Virtual Machine and how does it work?"}]},{"@type":"WebSite","@id":"https:\/\/hedera.com\/#website","url":"https:\/\/hedera.com\/","name":"Hedera","description":"Hello future","publisher":{"@id":"https:\/\/hedera.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/hedera.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/hedera.com\/#organization","name":"Hedera","url":"https:\/\/hedera.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/hedera.com\/#\/schema\/logo\/image\/","url":"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png","contentUrl":"https:\/\/hedera.com\/wp-content\/uploads\/2025\/09\/hedera_logo.png","width":500,"height":375,"caption":"Hedera"},"image":{"@id":"https:\/\/hedera.com\/#\/schema\/logo\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/learning\/12488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/learning"}],"about":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/types\/learning"}],"author":[{"embeddable":true,"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/users\/4"}],"version-history":[{"count":0,"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/learning\/12488\/revisions"}],"wp:attachment":[{"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/media?parent=12488"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hedera.com\/wp-json\/wp\/v2\/tags?post=12488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}