{"id":"smart-contract","title":"Smart Contract","content":"**A smart contract** is a self-executing computer program stored on a blockchain that automatically runs when predetermined conditions are met. The terms of an agreement between parties are written directly into lines of code, and because this code exists across a distributed, decentralized blockchain network, the process automates the execution of an agreement and allows all participants to be certain of the outcome without the involvement of an intermediary. Once completed, the transactions are trackable and irreversible. [\\[2\\]](#cite-id-5mlttgp8o8x)[\\[5\\]](#cite-id-b8zcecqmro)[\\[1\\]](#cite-id-3l63eaqe5x2)\n\nSmart contracts seek to reduce dependence on trusted intermediaries, lower arbitration costs and fraud losses, and minimize both malicious and accidental exceptions. Linked closely with [cryptocurrencies](https://iq.wiki/wiki/cryptocurrency), smart contracts serve as the foundational building blocks for [Web3](https://iq.wiki/wiki/web3) applications, including [decentralized finance](https://iq.wiki/wiki/defi) (DeFi) and [non-fungible token](https://iq.wiki/wiki/non-fungible-token-nft) (NFT) applications. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[2\\]](#cite-id-5mlttgp8o8x)$$widget0 [YOUTUBE@VID](ZE2HxTmxfrI)$$\n\n## History\n\nThe concept and term \"smart contract\" were first introduced in 1994 by American computer scientist [Nick Szabo](https://iq.wiki/wiki/nick-szabo), who defined it as “a computerized transaction protocol that executes the terms of a contract.” [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[2\\]](#cite-id-5mlttgp8o8x) In 1998, Szabo also designed a virtual currency called \"Bit Gold,\" a decade before [Bitcoin](https://iq.wiki/wiki/bitcoin) was introduced. Szabo was often rumored to be the real [Satoshi Nakamoto](https://iq.wiki/wiki/satoshi-nakamoto), the anonymous [Bitcoin](https://iq.wiki/wiki/bitcoin) inventor, which he denied. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[6\\]](#cite-id-29n01f4imjEdM9Di)\n\nThe launch of the [Bitcoin](https://iq.wiki/wiki/bitcoin) blockchain in 2009 supported the first \"protocol smart contract,\" which established a set of conditions that must be met to transfer BTC, such as the sender signing with the correct private key. By 2012, the [Bitcoin](https://iq.wiki/wiki/bitcoin) network evolved to support multi-signature (multisig) transactions, a more advanced form of smart contract requiring multiple private keys to approve a transaction. [\\[1\\]](#cite-id-3l63eaqe5x2)\n\nThe modern era of smart contracts began with the publication of the [Ethereum](https://iq.wiki/wiki/ethereum) whitepaper in 2013 by [Vitalik Buterin](https://iq.wiki/wiki/vitalik-buterin), which proposed a new type of blockchain for more versatile, programmable smart contracts. [Ethereum](https://iq.wiki/wiki/ethereum) launched in 2015, functioning as a \"world computer\" capable of running many independent and complex smart contracts simultaneously, significantly expanding their capabilities. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[3\\]](#cite-id-m1k658u6xqh)$$widget0 [YOUTUBE@VID](buvLR2WjD38)$$\n\n## How Smart Contracts Work\n\n### Basic Mechanics\n\nSmart contracts operate on a dedicated virtual machine embedded within a blockchain, following the logic: \"if/when x event occurs, then execute y action.\" [\\[1\\]](#cite-id-3l63eaqe5x2) By running on a decentralized network instead of a central server, they enable multiple parties to achieve a shared, tamper-proof result without needing to trust each other. A single smart contract can encompass various conditions, and an application may employ multiple smart contracts to facilitate an interconnected series of processes. [\\[5\\]](#cite-id-b8zcecqmro)\n\nBecause they operate on top of blockchains, smart contracts are automatically and deterministically executed exactly as programmed. This guarantees that the contract's outcome cannot be changed by any single party. A variety of programming languages are used for development, with [Solidity](https://iq.wiki/wiki/solidity) (for [Ethereum](https://iq.wiki/wiki/ethereum) and compatible chains), Vyper, and Rust being among the most prominent. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[3\\]](#cite-id-m1k658u6xqh)\n\n### Benefits\n\n* **Security & Reliability:** Decentralized execution eliminates central points of failure and makes outcomes resistant to tampering. The logic is processed and verified by a network of nodes, ensuring high uptime and that it executes exactly as coded. [\\[1\\]](#cite-id-3l63eaqe5x2)\n* **Efficiency & Accuracy:** Contracts execute immediately once a condition is met. Automation eliminates the need for manual paperwork and removes the potential for human error. [\\[5\\]](#cite-id-b8zcecqmro)\n* **Trust & Transparency:** Since there is no third-party involvement and encrypted transaction logs are shared among participants, information cannot be altered for personal gain. [\\[5\\]](#cite-id-b8zcecqmro)\n* **Cost Savings:** They remove the need for intermediaries to handle transactions, thereby eliminating their associated fees and time delays. [\\[5\\]](#cite-id-b8zcecqmro)\n\n### Limitations and Risks\n\n* **Immutability:** Once deployed, a smart contract's code cannot be easily changed. While this is a security feature, it makes it difficult to patch bugs. A common workaround is to use \"upgradable\" proxy contracts that can direct users to a new, updated contract. [\\[1\\]](#cite-id-3l63eaqe5x2)\n* **Smart Contract Risk:** Flaws, bugs, or exploits in a contract's code can lead to security vulnerabilities and loss of funds. Because contracts execute exactly as written, a faulty program will produce a faulty result. This risk makes comprehensive security audits a critical part of the development process. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[2\\]](#cite-id-5mlttgp8o8x)\n\nA prominent example of this risk was the attack on The DAO in June 2016, which drained US$50 million in Ether. The incident was ultimately rectified via a controversial hard fork of the [Ethereum](https://iq.wiki/wiki/ethereum) blockchain to claw back the funds from the attacker. [\\[4\\]](#cite-id-zhqtp26hlxn)\n\n### The Oracle Problem and Hybrid Smart Contracts\n\nBlockchains are inherently isolated systems and cannot natively access external, off-chain data such as real-world asset prices, weather data, or sports results. This is known as the \"oracle problem\" and limits the scope of smart contracts without a supplementary solution. [\\[1\\]](#cite-id-3l63eaqe5x2)\n\nTo overcome this limitation, smart contracts use \"oracles,\" which are secure middleware services that connect blockchains to external systems. Oracles provide off-chain data and computational resources, enabling \"hybrid smart contracts\" that combine on-chain code with off-chain infrastructure. This connection allows smart contracts to react to real-world events, greatly expanding their potential use cases. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[5\\]](#cite-id-b8zcecqmro)\n\n## Implementations and Platforms\n\nNot all blockchains have the native ability to run complex, programmable smart contracts. The key differentiator is the underlying network's capacity to execute and store arbitrary application logic, often through a built-in virtual machine.\n\nNotable platforms supporting advanced smart contracts include:\n\n* **Ethereum:** Implements a nearly Turing-complete language on its [blockchain](https://iq.wiki/wiki/blockchain) and is the most prominent smart contract framework.\n* **Other Compatible Blockchains:** A large ecosystem of blockchains are compatible with the [Ethereum](https://iq.wiki/wiki/ethereum) Virtual Machine (EVM), including [Arbitrum](https://iq.wiki/wiki/arbitrum), [Avalanche](https://iq.wiki/wiki/avalanche), [Base](https://iq.wiki/wiki/base), and [BNB Chain](https://iq.wiki/wiki/binance-smart-chain).\n* **Bitcoin:** The base [Bitcoin](https://iq.wiki/wiki/bitcoin) blockchain provides a Turing-incomplete Script language. While this allows for the creation of custom logic like multi-signature accounts, payment channels, and escrows, it does not have the native programmable smart contract capability akin to [Ethereum](https://iq.wiki/wiki/ethereum). Layer-2 solutions like Rootstock (RSK) bring Ethereum-compatible smart contract functionality to the [Bitcoin](https://iq.wiki/wiki/bitcoin) network.\n\nCollectively, these platforms facilitate the creation of highly customized logic for a wide range of decentralized applications. [\\[1\\]](#cite-id-3l63eaqe5x2)\n\n## Use Cases and Applications\n\n### Financial Products (DeFi)\n\n[Decentralized finance](https://iq.wiki/wiki/defi) (DeFi) encompasses applications leveraging smart contracts to replicate traditional financial products such as money markets, options, [stablecoins](https://iq.wiki/wiki/stablecoin), exchanges, and asset management. These applications employ permissionless composability to combine services, creating new financial primitives. Smart contracts within DeFi can securely manage user funds, holding them in escrow and distributing them between users based on predetermined conditions. For instance, [BarnBridge](https://iq.wiki/wiki/barnbridge) automates trades for users seeking fixed asset exposure, and [Aave](https://iq.wiki/wiki/aave) facilitates permissionless and decentralized lending and borrowing through smart contracts. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[3\\]](#cite-id-m1k658u6xqh)\n\n### Rights Management (Tokens)\n\nToken smart contracts are used to create, track, and assign ownership rights to specific digital tokens existing on blockchain networks. The token contract programs functionalities into the tokens it issues, providing holders features like utility/insurance in a [dApp](https://iq.wiki/wiki/decentralized-application) ([utility token](https://iq.wiki/wiki/utility-token)), voting weight in a protocol ([governance token](https://iq.wiki/wiki/governance-tokens)), equity in a company (security token), ownership claim to a unique real-world or digital asset ([non-fungible token](https://iq.wiki/wiki/non-fungible-token-nft)), and more. For example, the FIL token is used to pay for [Filecoin’s](https://iq.wiki/wiki/filecoin) decentralized storage services and the [COMP](https://iq.wiki/wiki/comp) token allows users to participate in the governance of [Compound protocol](https://iq.wiki/wiki/compound). [\\[1\\]](#cite-id-3l63eaqe5x2)\n\n### Gaming and NFTs\n\n[Blockchain](https://iq.wiki/wiki/blockchain)-based games use smart contracts for tamper-proof execution of in-game actions. One example is [PoolTogether](https://iq.wiki/wiki/pooltogether), a no-loss savings game where users [stake](https://iq.wiki/wiki/staking) their funds in a shared pool that is then routed into a money market where it earns interest. After a predefined period, the game ends and a winner is randomly awarded all the accrued interest while everyone else can withdraw their original deposit. [\\[1\\]](#cite-id-3l63eaqe5x2)\n\nSimilarly, limited-edition NFTs can have fair distribution models and RPGs can support unpredictable loot drops using randomness, helping to ensure all users have a fair shot at getting rare digital assets. Many projects access randomness using [Chainlink](https://iq.wiki/wiki/chainlink) Verifiable Random Function (VRF)—a random number generator (RNG) that uses cryptography to prove it's tamper-proof, meaning the RNG process is publicly auditable. [\\[1\\]](#cite-id-3l63eaqe5x2)\n\n### Insurance\n\nParametric insurance ties payouts directly to predefined events, leveraging smart contracts for tamper-proof creation and execution based on data inputs. For instance, crop insurance can be implemented through smart contracts, where policies are linked to specific weather conditions like seasonal rainfall. Upon policy completion, the smart contract automatically issues payouts if trusted oracle data confirms the predefined conditions were met. Platforms like Arbol use smart contracts and oracles for weather-based parametric insurance. This model ensures timely payouts with reduced overhead and opens the supply side of insurance to the public through smart contracts where users can deposit funds into a [pool](https://iq.wiki/wiki/liquidity-pool) to earn premiums. [\\[1\\]](#cite-id-3l63eaqe5x2)[\\[2\\]](#cite-id-5mlttgp8o8x)\n\n### Voting & Governance\n\nSmart contracts can be utilized in voting and governance within a [DAO](https://iq.wiki/wiki/dao) (Decentralized Autonomous Organization) by encoding the rules and procedures for decision-making directly into the contract code. Participants in the DAO can then interact with the smart contract to cast votes, propose changes, or participate in governance decisions. This ensures transparency, immutability, and tamper-proof execution of the voting process, enhancing the democratic and decentralized nature of DAO governance. Smart contracts can automate the tallying of votes, enforce voting rules, and execute decisions based on predefined conditions, providing an efficient and trustless mechanism for managing the DAO's affairs. [\\[5\\]](#cite-id-b8zcecqmro)\n\n### Blockchain Crowdfunding\n\nSmart contracts can be employed in [blockchain](https://iq.wiki/wiki/blockchain) crowdfunding by automating the fundraising process and ensuring transparent and secure handling of contributions. Through a predefined set of rules encoded in the smart contract, participants can send contributions to a crowdfunding campaign. The smart contract then automatically manages the release of funds based on specific conditions, such as reaching a funding goal or a predetermined timeline. This eliminates the need for an intermediary and enhances trust among participants, as the contract's execution is verifiable on the blockchain. Additionally, smart contracts can facilitate the distribution of tokens or rewards to contributors based on the terms set within the contract. [\\[5\\]](#cite-id-b8zcecqmro)\n\n### Other Industries\n\nThe potential applications for smart contracts extend to numerous other sectors, including supply chain management for automating payments upon delivery, real estate transactions, stock and commodity trading, and healthcare for managing sensitive data with patient consent. [\\[2\\]](#cite-id-5mlttgp8o8x)","summary":"A smart contract is a self-executing agreement, automated by computer programs, making transactions trackable and irreversible, predominantly used in decentralized finance and cryptocurrency.","images":[{"id":"QmVNQtE45m2B3kPNf7BoTAGoNdDkQpLWzVeTDHaqTYppNS","type":"image/jpeg, image/png"}],"categories":[{"id":"defi","title":"Decentralized Finance"}],"tags":[{"id":"Glossary"}],"media":[{"id":"https://www.youtube.com/watch?v=ZE2HxTmxfrI","size":"0","name":"ZE2HxTmxfrI","type":null,"source":"YOUTUBE"},{"id":"https://www.youtube.com/watch?v=buvLR2WjD38","size":"0","name":"buvLR2WjD38","type":null,"source":"YOUTUBE"}],"metadata":[{"id":"references","value":"[{\"id\":\"3l63eaqe5x2\",\"url\":\"https://chain.link/education/smart-contracts\",\"description\":\" chain link - smart contracts\",\"timestamp\":1702751621876},{\"id\":\"5mlttgp8o8x\",\"url\":\"https://www.investopedia.com/terms/s/smart-contracts.asp\",\"description\":\"investopedia - smart contract\",\"timestamp\":1704451638308},{\"id\":\"m1k658u6xqh\",\"url\":\"https://cointelegraph.com/learn/what-are-smart-contracts-a-beginners-guide-to-automated-agreements\",\"description\":\"cointelegraph - smart contract tech\",\"timestamp\":1704453963531},{\"id\":\"zhqtp26hlxn\",\"url\":\"https://www.coindesk.com/learn/understanding-the-dao-attack/\",\"description\":\"coindesk - the dao attack\",\"timestamp\":1704455651698},{\"id\":\"b8zcecqmro\",\"url\":\"https://www.simplilearn.com/tutorials/blockchain-tutorial/what-is-smart-contract\",\"description\":\"smart contract utility\",\"timestamp\":1704457293725},{\"id\":\"29n01f4imjEdM9Di\",\"url\":\"https://www.fon.hum.uva.nl/rob/Courses/InformationInSpeech/CDROM/Literature/LOTwinterschool2006/szabo.best.vwh.net/smart\\\\_contracts\\\\_2.html\",\"description\":\"Smart Contracts: Building Blocks for Digital Markets\",\"timestamp\":1773242063096}]"},{"id":"previous_cid","value":"\"https://ipfs.everipedia.org/ipfs/QmUfdJ5dcQojwdCDwqktDtYK7xiohar94stqusMpjrEBPS\""},{"id":"commit-message","value":"\"Removed legacy content and user profile\""},{"id":"previous_cid","value":"QmUfdJ5dcQojwdCDwqktDtYK7xiohar94stqusMpjrEBPS"}],"events":null,"user":{"id":"0x8af7a19a26d8fbc48defb35aefb15ec8c407f889"},"author":{"id":"0x40b4c3e9309f3D5DF098C724be04615d64605Fe3"},"operator":{"id":"0x212Cb3F4aE6611054637f9f78F18fB628AD258bb"},"language":"en","version":1,"linkedWikis":{"blockchains":[],"founders":[],"speakers":[]},"recentActivity":"{\"items\":[{\"id\":\"cef502d1-5df3-446e-bd18-f2914a27dd40\",\"title\":\"Smart Contract\",\"description\":\"A smart contract is a self-executing agreement, automated by computer programs, making transactions trackable and irreversible, predominantly used in decentralized finance and cryptocurrency.\",\"timestamp\":\"2026-03-11T15:24:23.145Z\",\"category\":\"Decentralized Finance\",\"status\":{\"icon\":\"RiGlobalLine\",\"label\":\"Wiki Updated\",\"iconClassName\":\"text-green-500\"},\"user\":{\"name\":\"0x40b4c3e9309f3D5DF098C724be04615d64605Fe3\",\"address\":\"0x212Cb3F4aE6611054637f9f78F18fB628AD258bb\"},\"button\":{\"label\":\"View Summary\",\"icon\":\"RiFileTextLine\"},\"summarySections\":[{\"title\":\"Introduction\",\"subtitle\":\"The introduction was updated with a more detailed definition of smart contracts and their role in Web3.\",\"variant\":\"modified\",\"changeCount\":2,\"changes\":[\"Expanded the definition of a smart contract to be a computer program stored on a blockchain that automates agreement execution without an intermediary. [[2]](#cite-id-5mlttgp8o8x)[[5]](#cite-id-b8zcecqmro)[[1]](#cite-id-3l63eaqe5x2)\",\"Updated the context to state that smart contracts are foundational building blocks for Web3 applications. [[1]](#cite-id-3l63eaqe5x2)[[2]](#cite-id-5mlttgp8o8x)\"]},{\"title\":\"History\",\"subtitle\":\"The History section was substantially rewritten to cover the evolution from initial concepts to modern implementations.\",\"variant\":\"modified\",\"changeCount\":1,\"changes\":[\"The history section was rewritten to include Nick Szabo's initial 1994 concept, Bitcoin's early support for protocol smart contracts, and the modern era of programmable smart contracts ushered in by Ethereum. [[1]](#cite-id-3l63eaqe5x2)[[2]](#cite-id-5mlttgp8o8x)[[6]](#cite-id-29n01f4imjEdM9Di)[[3]](#cite-id-m1k658u6xqh)\"]},{\"title\":\"Technology\",\"subtitle\":\"The 'Technology' section and its subsections were removed.\",\"variant\":\"removed\",\"changeCount\":1,\"changes\":[\"Removed the 'Technology' section, which included subsections on 'Implementations', 'Security Issues', and 'Applications'.\"]},{\"title\":\"Smart Contract Utility\",\"subtitle\":\"The 'Smart Contract Utility' section header was removed and its content was restructured under a new section.\",\"variant\":\"removed\",\"changeCount\":1,\"changes\":[\"Removed the 'Smart Contract Utility' section. Its content was reorganized under the new 'Use Cases and Applications' section.\"]},{\"title\":\"How Smart Contracts Work\",\"subtitle\":\"A new section was added to detail the mechanics, benefits, risks, and the oracle problem for smart contracts.\",\"variant\":\"added\",\"changeCount\":1,\"changes\":[\"Added the 'How Smart Contracts Work' section, including subsections on 'Basic Mechanics', 'Benefits', 'Limitations and Risks', and 'The Oracle Problem and Hybrid Smart Contracts'. [[1]](#cite-id-3l63eaqe5x2)[[5]](#cite-id-b8zcecqmro)[[3]](#cite-id-m1k658u6xqh)[[2]](#cite-id-5mlttgp8o8x)[[4]](#cite-id-zhqtp26hlxn)\"]},{\"title\":\"Implementations and Platforms\",\"subtitle\":\"Added a new section covering platforms that support advanced smart contracts.\",\"variant\":\"added\",\"changeCount\":1,\"changes\":[\"Added the 'Implementations and Platforms' section, which lists notable platforms like Ethereum, EVM-compatible blockchains, and Bitcoin (via Layer-2 solutions). [[1]](#cite-id-3l63eaqe5x2)\"]},{\"title\":\"Use Cases and Applications\",\"subtitle\":\"A new 'Use Cases and Applications' section was added, restructuring and expanding on the previous 'Smart Contract Utility' section.\",\"variant\":\"added\",\"changeCount\":4,\"changes\":[\"Added section title 'Use Cases and Applications' to replace 'Smart Contract Utility'.\",\"Updated the 'Insurance' subsection to mention the use of trusted oracle data and added Arbol as a platform example. [[1]](#cite-id-3l63eaqe5x2)[[2]](#cite-id-5mlttgp8o8x)\",\"Changed the 'Gaming & NFTs' subsection title to 'Gaming and NFTs'.\",\"Added a new 'Other Industries' subsection outlining applications in supply chain, real estate, and healthcare. [[2]](#cite-id-5mlttgp8o8x)\"]},{\"title\":\"References\",\"subtitle\":\"The list of references was updated, removing three sources and adding one.\",\"variant\":\"modified\",\"changeCount\":4,\"changes\":[\"Added a new reference for 'Smart Contracts: Building Blocks for Digital Markets'.\",\"Removed a reference from 'askemos.org'.\",\"Removed a reference titled 'Secure Property Titles with Owner Authority'.\",\"Removed an older reference link for 'Smart Contracts: Building Blocks for Digital Markets'.\"]}]}]}"}