When you swap one token for another on a decentralized exchange, no human approves the trade. No bank holds your funds in between. The whole transaction happens inside a smart contract: code that lives on a blockchain and runs itself when its conditions are met.
Smart contracts are programs stored on a blockchain that automatically execute a set of instructions when predefined conditions are met. They power most of what people actually do with crypto today, from lending billions of dollars on protocols like Aave, to swapping tokens on Uniswap, to minting NFTs on Ethereum and Solana.
This guide covers what smart contracts are, how they work step by step, where they run (including on Bitcoin), and what they get used for.

Use the multichain Bitcoin.com Wallet app, trusted by millions to safely and easily send, receive, buy, sell, trade, use, and manage Bitcoin (BTC), Bitcoin Cash (BCH), Ether (ETH), and the most popular cryptocurrencies. The app enables you to interact with smart contracts on a variety of public blockchain networks.
What Is a Smart Contract?
A smart contract is a program stored on a blockchain that automatically executes a set of instructions when predefined conditions are met.
That sounds abstract until you compare it with a regular contract. A regular contract is a written agreement. If one party fails to hold up their end, the other party has to sue them and convince a court to enforce it. The paper itself does nothing.
A smart contract is different because the rules are written as code, and the code runs on a network of computers that no single party controls. Once the conditions in the code are satisfied, the contract acts. There is no enforcement step that someone can refuse. If the code says “if X happens, send 1 ETH to Alice,” and X happens, Alice gets 1 ETH. No counterparty can block it.
The term goes back to computer scientist Nick Szabo, who proposed it in the mid-1990s. The idea stayed mostly theoretical until Ethereum launched in 2015 with a virtual machine designed specifically to run this kind of code at scale. That is when smart contracts went from concept to category.
People sometimes ask whether smart contracts are “real” contracts in the legal sense. Sometimes yes, sometimes no. A self-executing contract stored on a blockchain can satisfy the legal requirements of an agreement, but most smart contracts in the wild are better understood as automated mechanisms inside a larger arrangement than as standalone legal documents. More on that in the FAQ below.
How Do Smart Contracts Work?
Smart contracts move through four stages: a developer writes the code, the code gets deployed to a blockchain, someone triggers it with a transaction, and the network executes the result.
1. The code gets written
Smart contracts are written in a programming language designed for the purpose. The most common is Solidity, which runs on Ethereum and most chains compatible with it. Others include Rust (used on Solana and Near), Move (Aptos and Sui), and Vyper. The code spells out exactly what the contract holds, what conditions trigger which actions, and who is allowed to call which functions.
You do not have to read code to follow what is happening. Here is a five-line snippet in Solidity:
function withdraw() public {
require(block.timestamp >= unlockTime, “Funds locked”);
require(msg.sender == owner, “Not the owner”);
payable(owner).transfer(address(this).balance);
}
In plain English: anyone can call this function, but it only releases funds if two conditions are both true. First, the unlock time has passed. Second, the caller is the owner. If either condition fails, the function aborts and nothing moves. This is the entire core of what a smart contract is: a set of if-this-then-that rules with no room for human override.
2. The contract gets deployed
When the developer is done writing, they send a special transaction to the blockchain that contains the compiled code. Validators (or miners, on chains that still use them) include the transaction in a block. The contract is now stored at a unique address on the chain, sitting alongside every other contract and user account. Anyone in the world can read its code and interact with it.
3. Someone triggers it
Smart contracts do not do anything on their own. They wait. When a user sends a transaction to the contract’s address, usually through a wallet like MetaMask, every node in the network runs the contract’s code with that transaction as input. On Ethereum, this runs inside the Ethereum Virtual Machine (EVM), a runtime every node uses to produce the same answer for the same input. The EVM is what makes the result trustworthy without anyone being in charge.
4. The result is recorded
Once the code finishes running, the resulting changes (balances updated, ownership transferred, a record written) become part of the next block. Every node independently verifies the same result. After a few more blocks build on top, the change is final and effectively unchangeable.
Where Smart Contracts Run: Platforms Compared
Ethereum is where smart contracts went mainstream, and it still hosts the largest ecosystem. It is no longer the only option. Notably, Bitcoin now supports smart contracts in several ways too.
PlatformLanguageTypical useNotesEthereumSolidity, VyperDeFi, NFTs, DAOsLargest ecosystem, highest mainnet feesSolanaRustHigh-throughput DeFi, NFTsCheaper, faster, less battle-testedBitcoin (Taproot)Bitcoin ScriptMultisig, time-locked paymentsLimited expressiveness, maximum securityStacksClarityBitcoin-secured smart contractsSettles to BitcoinRootstock (RSK)SolidityEthereum-style contractsEVM-compatible sidechain secured by BitcoinBitVM(research)Arbitrary computation on BitcoinExperimental as of 2026PlatformEthereumLanguageSolidity, VyperTypical useDeFi, NFTs, DAOsNotesLargest ecosystem, highest mainnet feesPlatformSolanaLanguageRustTypical useHigh-throughput DeFi, NFTsNotesCheaper, faster, less battle-testedPlatformBitcoin (Taproot)LanguageBitcoin ScriptTypical useMultisig, time-locked paymentsNotesLimited expressiveness, maximum securityPlatformStacksLanguageClarityTypical useBitcoin-secured smart contractsNotesSettles to BitcoinPlatformRootstock (RSK)LanguageSolidityTypical useEthereum-style contractsNotesEVM-compatible sidechain secured by BitcoinPlatformBitVMLanguage(research)Typical useArbitrary computation on BitcoinNotesExperimental as of 2026
Ethereum hosts the largest smart contract ecosystem. As of April 2026, DefiLlama reports total DeFi value locked in the range of $95 to $160 billion depending on how restaking and liquid staking tokens are counted, with Ethereum and its layer-2 networks accounting for the majority. The trade-off is cost: mainnet transaction fees rise during congestion, which has pushed activity toward cheaper layer-2 networks built on top.
Solana is the largest non-EVM competitor. It uses Rust, processes transactions in parallel, and keeps fees in the fraction-of-a-cent range. As of mid-May 2026, Solana’s TVL sits near $5.5 billion, around 6.8% of global DeFi, with a high volume-to-TVL ratio that reflects the chain’s throughput.
Bitcoin’s situation is more interesting than most explainers let on. Bitcoin has always supported a limited form of smart contracts through Bitcoin Script, used for things like multisig wallets and time-locked payments. The Taproot upgrade in November 2021 made these more efficient and private. Several other projects extend Bitcoin’s smart contract capability further: Stacks runs Clarity contracts that settle to Bitcoin, Rootstock is a Bitcoin-secured sidechain that runs Solidity contracts, and BitVM (proposed in 2023) is a research framework for verifying arbitrary computation on Bitcoin.
What Smart Contracts Are Used For
The most active categories of smart contract use in 2026 are decentralized finance, digital ownership, on-chain governance, and a growing list of non-crypto-native applications.
Decentralized finance (DeFi). Lending, borrowing, swapping, and earning yield without a centralized intermediary. The leading example is Uniswap, a decentralized exchange whose smart contracts have processed over $3.45 trillion in cumulative trading volume as of January 2026. Aave is the equivalent reference protocol for lending.
NFTs and digital ownership. Smart contracts that follow standards like ERC-721 and ERC-1155 on Ethereum define ownership of unique digital assets, from art to in-game items to tokenized real-world assets. Every NFT marketplace is a layer of user interface sitting on top of these contracts.
DAOs and governance. Decentralized autonomous organizations (DAOs) use smart contracts to manage shared treasuries, run votes on proposals, and execute outcomes automatically when a vote passes. Some DAOs hold treasuries worth hundreds of millions of dollars.
Beyond crypto. Outside the strictly crypto-native categories, smart contracts have found traction in supply chain tracking, tokenized real-world assets (such as Treasury bills and real estate), and parametric insurance, where payouts happen automatically based on a verifiable event like a flight delay.
Limits and Risks
Smart contracts come with real trade-offs that any honest description has to include.
Immutability cuts both ways. Once deployed, a smart contract is hard to change. That is the design. It also means bugs are permanent unless the developers built in an upgrade pathway. The 2016 DAO hack, which drained roughly $60 million worth of ETH at the time through a reentrancy bug, is the canonical example. The 2017 Parity multisig wallet freeze permanently locked over $150 million in user funds because a different bug let one user accidentally turn the library contract into a personal one and then destroy it. The funds are still inaccessible today.
The oracle problem. Smart contracts can only act on data that already exists on the blockchain. To respond to anything in the outside world (a stock price, a flight delay, the result of a football match), they need an oracle service to bring that data on-chain. Chainlink is the dominant one. Oracles introduce a trust dependency that the rest of the system was designed to avoid.
Audits help. They do not guarantee safety. Most major protocols are audited, sometimes by multiple firms. Audited contracts still get exploited. Treat “audited” as one positive signal among many, not as a green light to send funds you cannot afford to lose.
Conclusion
A smart contract is a program stored on a blockchain that runs itself when its conditions are met. In 2026, that simple idea is mature infrastructure on Ethereum, expanding on Bitcoin, and the foundation under most of what people actually do in crypto. The shift from “an agreement someone enforces” to “code that enforces itself” remains the single biggest thing blockchains made possible, and the range of what smart contracts can do keeps growing as the underlying networks mature.






