{"id":9006,"date":"2022-09-30T18:40:37","date_gmt":"2022-09-30T18:40:37","guid":{"rendered":"https:\/\/mdr.foobrdigital.com\/?p=9006"},"modified":"2022-09-30T18:40:37","modified_gmt":"2022-09-30T18:40:37","slug":"5-smart-contracts-dapps-gas","status":"publish","type":"post","link":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/2022\/09\/30\/5-smart-contracts-dapps-gas\/","title":{"rendered":"5. Smart Contracts, dApps &amp; Gas"},"content":{"rendered":"\n<p>Smart Contracts are written in a programming language specific to Ethereum, called Solidity, which for anyone with a programming background (especially Javascript) shouldn\u2019t present a huge challenge to learn.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>\u201cI call these new contracts \u201csmart\u201d, because they are \nfar more functional than their inanimate paper-based \nancestors. No use of artificial intelligence is \nimplied. A smart contract is a set of promises, \nspecified in digital form, including protocols within \nwhich the parties perform on these promises\u201d\u00a0\u2014 \nNick Szabo, 1996<\/code><\/pre>\n\n\n\n<p>Smart Contracts are stored within the EVM, with their latest state reflected in the most recent block in the Ethereum blockchain.<\/p>\n\n\n\n<p>A few lines of code within a Smart Contract can create a new cryptocurrency or financial service, so long as certain basic standards are followed. The standardisation within the Ethereum Protocol enables interoperability between dApps and is one of the reasons why the market for DEFI and NFTs has grown so rapidly in such a short period of time.<\/p>\n\n\n\n<p>Thousands of dApps now run on Ethereum, while other blockchains are trying to imitate and improve on Ethereum\u2019s design, offering similar Smart Contract functionality and providing EVM compatibility so that applications can be easily ported.<\/p>\n\n\n\n<p>The increasing use of Smart Contracts has made Ethereum a victim of its own success as the execution fees users have to pay to engage with DEFI services or mint NFTs are pricing out the average user.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">6. Ethereum Nodes<\/h2>\n\n\n\n<p>Like Bitcoin, Ethereum\u2019s network features different types of Node fulfilling the required functions of the Ethereum Protocol. You can think of Node as a computer which requires Client Software to function.<\/p>\n\n\n\n<p>We\u2019ll summarise the basics of Nodes and Clients, then look at each in more detail in dedicated articles:<\/p>\n\n\n\n<p>Full Nodes<\/p>\n\n\n\n<ul><li>Run the Ethereum client software<\/li><li>Store the entire blockchain record of transactions<\/li><li>Validate blocks &amp; all states.<\/li><li>Propagate transactions &amp; store them for miners to pick up<\/li><li>Can function as a Miner to verify blocks &amp; issue new Ether<\/li><\/ul>\n\n\n\n<p>Miner<\/p>\n\n\n\n<ul><li>A Miner must be a Full Node but a Full Node doesn\u2019t need to be a Miner<\/li><li>Runs the EthHash algorithm to show Proof of Work<\/li><li>Verifies transactions in new blocks<\/li><li>Gets rewarded with ETH for every block mined plus transaction fees<\/li><\/ul>\n\n\n\n<p>Light node<\/p>\n\n\n\n<ul><li>Stores a portion of the blockchain<\/li><li>Can validate transactions based on the portion of blockchain stored<\/li><li>Useful for low capacity devices like mobile phones not suited for storing Gigagytes of data<\/li><\/ul>\n\n\n\n<p>Archive node<\/p>\n\n\n\n<ul><li>Everything stored in the full node plus an archive of historical states<\/li><li>Can amount to Terabytes of data so only suitable for enterprise level users<\/li><\/ul>\n\n\n\n<p>Ethereum\u2019s move to Proof of Stake will implement something called sharding, a method to improve the efficiency of transaction processing, and reduce the overall size of the Ethereum blockchain which is so much larger than Bitcoin given the requirement to store all state changes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">7. Ethereum Clients &amp; Networks<\/h2>\n\n\n\n<p>The Client Software is an implementation of the Ethereum Protocol, providing a formal specification for how the Ethereum network and blockchain functions. It is available in a variety of different languages and with different approaches to how it syncs with the rest of the network.<\/p>\n\n\n\n<figure class=\"wp-block-table is-style-regular\"><table><tbody><tr><td><strong>Ethereum Client<\/strong><\/td><td><strong>Language<\/strong><\/td><td><strong>Operating System<\/strong><\/td><td><strong>Network<\/strong><\/td><td><strong>Sync Strategy<\/strong><\/td><\/tr><tr><td>Geth<\/td><td>Go<\/td><td>Linux, Windows, macOS<\/td><td>Mainnet,G\u00f6rli, Rinkeby, Ropsten<\/td><td>Snap, Full<\/td><\/tr><tr><td>Nethermind<\/td><td>C#, .NET<\/td><td>Linux, Windows, macOS<\/td><td>Mainnet, G\u00f6rli, Rinkeby, Ropsten<\/td><td>Fast, Beam<\/td><\/tr><tr><td>Besu<\/td><td>Java<\/td><td>Linux, Windows, macOS<\/td><td>Mainnet, G\u00f6rli, Rinkeby, Ropsten<\/td><td>Fast, Full<\/td><\/tr><tr><td>Erigon<\/td><td>Go<\/td><td>Linux, Windows, macOS<\/td><td>Mainnet, G\u00f6rli, Rinkeby, Ropsten<\/td><td>Full<\/td><\/tr><tr><td>OpenEthereum (Deprecated)<\/td><td>Rust<\/td><td>Linux, Windows, macOS<\/td><td>Mainnet, G\u00f6rli, Rinkeby, Ropsten<\/td><td>Warp, Full<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>At present running an Archive or Full Node takes several days for a full synchronisation and requires significant storage capacity. This can put running a node outside the reach of someone with technical abilities and resources, which some people argue compromises Ethereum\u2019s decentralisation. You can get around that issue by using&nbsp;<strong>Node Client Services<\/strong>&nbsp;that run the infrastructure for you and simply provide an API .<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Different Ethereum Networks<\/h3>\n\n\n\n<p>The Ethereum Protocol is open source software so it doesn\u2019t necessarily need to apply to the main the Ethereum network which is known as the Mainnet.&nbsp;<\/p>\n\n\n\n<p>There are different implementations for testing &#8211; Ropsten &#8211; or bespoke product applications (as shown in the table above).<\/p>\n\n\n\n<p>Each network operates independently so the balance and transaction history of an Ethereum account on the Mainnet will not apply to other networks. Users simply need to connect to the different networks within their wallets, such as MetaMask.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Different Sync Strategies<\/h3>\n\n\n\n<p>One of the reasons why there are different Ethereum Clients is that each takes a slightly different approach to syncing with the rest of the network to download the latest version of the blockchain. They will offer different features and be lighter or heavier in terms of their application size.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">8.Types of Ethereum account<\/h2>\n\n\n\n<p>Though the Bitcoin blockchain supports a monetary system individual users don\u2019t have accounts, balances are represented through Unspent Transactions (UTXOs). Ethereum differs on this point as it does operate a distinct Account structure:<\/p>\n\n\n\n<ul><li>External Account &#8211; A user with a public address\/key stored in a wallet<\/li><\/ul>\n\n\n\n<ul><li>Contract Account &#8211; Created when a Smart Contract is created, using the address of the creator and the number of transactions sent, and controlled by the code within the Smart Contract.<\/li><\/ul>\n\n\n\n<p>All accounts have a balance, displayed in Ether which simply send Ether back and forth, or a specific payload (binary data), which is sent to a contract account with code, and provides an input for executions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">9. Ethereum Standards<\/h2>\n\n\n\n<p>One of the most forward thinking aspects of the Ethereum Protocol are the clearly defined standards which enable interoperability across all the dApps that the EVM supports. These standards have been replicated across layer 1 networks that seek to replicate its function.<\/p>\n\n\n\n<p>These are some of the most common:<\/p>\n\n\n\n<ul><li><strong>ERC-20<\/strong>&nbsp;&#8211; A standard for fungible (interchangeable) tokens, like virtual currencies, which can also be used to give holders voting rights in DAOs.<\/li><\/ul>\n\n\n\n<ul><li><strong>ERC-721<\/strong>&nbsp;&#8211; A standard interface for non-fungible (unique) tokens, like a collectible, one-off digital asset or deed of ownership.<\/li><\/ul>\n\n\n\n<ul><li><strong>ERC-777<\/strong>&nbsp;&#8211; A standard that enables you to build additional functionality on top of tokens such as creating more transaction privacy or a recovery tool if you lose your private keys.<\/li><\/ul>\n\n\n\n<ul><li><strong>ERC-1155<\/strong>&nbsp;&#8211; A multi-token standard that can do the same things as an ERC-20, or ERC-721 token, but additionally enables movement of batches of tokens, calling balances of collections or approving a group of tokens to a single address.<\/li><\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Smart Contracts are written in a programming language specific to Ethereum, called Solidity, which for anyone with a programming background (especially Javascript) shouldn\u2019t present a huge challenge to learn. Smart Contracts are stored within the EVM, with their latest state reflected in the most recent block in the Ethereum blockchain. A few lines of code [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[510],"tags":[],"_links":{"self":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9006"}],"collection":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/comments?post=9006"}],"version-history":[{"count":0,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/posts\/9006\/revisions"}],"wp:attachment":[{"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/media?parent=9006"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/categories?post=9006"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mudassirbackup.infinitycodestudio.com\/index.php\/wp-json\/wp\/v2\/tags?post=9006"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}