{"id":17,"date":"2022-11-30T15:40:01","date_gmt":"2022-11-30T15:40:01","guid":{"rendered":"https:\/\/blog.metu.edu.tr\/e243557\/?page_id=17"},"modified":"2023-01-01T19:14:17","modified_gmt":"2023-01-01T19:14:17","slug":"smart-contract","status":"publish","type":"page","link":"https:\/\/blog.metu.edu.tr\/e243557\/smart-contract\/","title":{"rendered":"Smart Contract"},"content":{"rendered":"<div class=\"wp-block-image\">\n<figure class=\"alignleft size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/blog.metu.edu.tr\/e243557\/files\/2022\/12\/smart-contract-cover-1024x611.jpg\" alt=\"\" class=\"wp-image-57\" width=\"312\" height=\"187\" srcset=\"https:\/\/blog.metu.edu.tr\/e243557\/files\/2022\/12\/smart-contract-cover-1024x611.jpg 1024w, https:\/\/blog.metu.edu.tr\/e243557\/files\/2022\/12\/smart-contract-cover-300x179.jpg 300w, https:\/\/blog.metu.edu.tr\/e243557\/files\/2022\/12\/smart-contract-cover-768x458.jpg 768w, https:\/\/blog.metu.edu.tr\/e243557\/files\/2022\/12\/smart-contract-cover.jpg 1200w\" sizes=\"auto, (max-width: 312px) 100vw, 312px\" \/><\/figure>\n<\/div>\n\n\n<p>A&nbsp;smart contract&nbsp;is a&nbsp;computer program&nbsp;or a&nbsp;transaction protocol&nbsp;that is intended to automatically execute, control or document legally-relevant events and actions according to the terms of a&nbsp;contract&nbsp;or an agreement.&nbsp;The objectives of smart contracts are the reduction of need for trusted intermediators, arbitration costs, and fraud losses, as well as the reduction of malicious and accidental exceptions.&nbsp;Smart contracts are commonly associated with&nbsp;cryptocurrencies, and the smart contracts introduced by&nbsp;Ethereum&nbsp;are generally considered a fundamental building block for&nbsp;decentralized finance&nbsp;(DeFi) and&nbsp;NFT&nbsp;applications.<\/p>\n\n\n\n<p>Vending machines&nbsp;are mentioned as the oldest piece of technology equivalent to smart contract implementation.&nbsp;The original&nbsp;Ethereum&nbsp;white paper&nbsp;by&nbsp;Vitalik Buterin&nbsp;in 2014 describes the&nbsp;Bitcoin protocol&nbsp;as a weak version of the smart contract concept as originally defined by&nbsp;Nick Szabo, and proposes a stronger version based on the&nbsp;Solidity&nbsp;language, which is&nbsp;Turing complete. Since Bitcoin, various cryptocurrencies support&nbsp;scripting languages&nbsp;which allow for more advanced smart contracts between untrusted parties.<\/p>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>A smart contract should not be confused with a&nbsp;smart legal contract, which refers to a traditional, natural-language, legally-binding agreement that has selected terms expressed and implemented in machine-readable code.<\/p>\n<\/blockquote>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Workings<\/strong><\/h2>\n\n\n\n<p>Similar to a transfer of value on a blockchain, deployment of a smart contract on a blockchain occurs by sending a transaction from a wallet for the blockchain. The transaction includes the compiled code for the smart contract as well as a special receiver address.&nbsp;That transaction must then be included in a block that is added to the blockchain, at which point the smart contract&#8217;s code will execute to establish the initial state of the smart contract.&nbsp;Byzantine fault-tolerant&nbsp;algorithms secure the smart contract in a decentralized way from attempts to tamper with it. Once a smart contract is deployed, it cannot be updated. Smart contracts on a blockchain can store arbitrary state and execute arbitrary computations. End clients interact with a smart contract through transactions. Such transactions with a smart contract can invoke other smart contracts. These transactions might result in changing the state and sending coins from one smart contract to another or from one account to another.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A&nbsp;smart contract&nbsp;is a&nbsp;computer program&nbsp;or a&nbsp;transaction protocol&nbsp;that is intended to automatically execute, control or document legally-relevant events and actions according to the terms of a&nbsp;contract&nbsp;or an agreement.&nbsp;The objectives of smart contracts are the reduction of need for trusted intermediators, arbitration costs, and fraud losses, as well as the reduction of malicious and accidental exceptions.&nbsp;Smart contracts are [&hellip;]<\/p>\n","protected":false},"author":8594,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-17","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/blog.metu.edu.tr\/e243557\/wp-json\/wp\/v2\/pages\/17","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.metu.edu.tr\/e243557\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.metu.edu.tr\/e243557\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.metu.edu.tr\/e243557\/wp-json\/wp\/v2\/users\/8594"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.metu.edu.tr\/e243557\/wp-json\/wp\/v2\/comments?post=17"}],"version-history":[{"count":0,"href":"https:\/\/blog.metu.edu.tr\/e243557\/wp-json\/wp\/v2\/pages\/17\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.metu.edu.tr\/e243557\/wp-json\/wp\/v2\/media?parent=17"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}