blockchain

What is Smart Contract?

Self-executing code deployed on a blockchain that automatically enforces the terms of an agreement when predefined conditions are met. Smart contracts eliminate the need for intermediaries and enable trustless, transparent transactions. They form the foundation of DeFi, NFTs, and other blockchain applications.

Smart contracts are programs stored on a blockchain that execute automatically when predetermined conditions are met. Conceptualized by computer scientist Nick Szabo in the 1990s and first implemented at scale on Ethereum in 2015, smart contracts enable trustless agreements where code replaces the need for intermediaries. Once deployed, smart contracts execute exactly as programmed and cannot be altered (unless designed with upgrade mechanisms), providing transparency and predictability.

Smart contracts power virtually every application in the crypto ecosystem. DeFi protocols like Aave and Uniswap are collections of smart contracts that handle lending, borrowing, and trading without banks. NFTs are smart contracts that track ownership of unique digital assets. DAOs use smart contracts for decentralized governance. The composability of smart contracts — their ability to interact with each other — has enabled the rapid innovation often described as "money legos" in DeFi.

Key Facts

  • Nick Szabo conceptualized smart contracts in the 1990s; Ethereum implemented them at scale in 2015.
  • Solidity is the primary programming language for Ethereum smart contracts.
  • Rust is used for smart contracts on Solana and NEAR.
  • Smart contract bugs and vulnerabilities have led to billions in losses from exploits.
  • Smart contracts are immutable once deployed unless they include upgrade mechanisms.

Frequently Asked Questions

How do smart contracts work?

Smart contracts are code deployed on a blockchain that automatically executes when conditions are met. For example, a lending contract automatically liquidates a position if collateral falls below a threshold. The execution is trustless — it happens exactly as coded, verified by all network participants.

Are smart contracts legally binding?

Smart contracts are not inherently legal contracts, though they can implement the terms of legal agreements. The legal enforceability depends on jurisdiction and whether the smart contract satisfies legal requirements for contract formation. Some jurisdictions are developing frameworks to recognize smart contracts.

What are the risks of smart contracts?

Bugs in smart contract code can lead to exploits and loss of funds. Immutability means bugs cannot be easily patched. Upgrade mechanisms introduce centralization risk. Smart contract audits reduce but do not eliminate risk. Users should only interact with well-audited contracts.

Something new is coming

gpu is building a new way to trade crypto. Join the waitlist to be first in line.

Related terms

gpu

Join the waitlist

Sign up to be the first to know when gpu launches.