An application on Ethereum, Solana or other programmable blockchain. Smart contracts mostly govern financial arrangements; for example, they enable new cryptocurrencies to be established, and they certify ownership of non-fungible assets such as art and collectibles (see
fungible token and
NFT). Smart contracts manage swapping one crypto token for another (see
crypto liquidity pool).
Without a bank or middleman involved, a smart contract can issue a loan after it receives collateral and return the collateral when the loan is paid off (see
yield farming). Smart contracts execute functions triggered by transactions from users, and it can initiate its own as required.
Source Code and Data
Containing both source code and internal data, a smart contract can also access data in a database. Smart contracts are written in a programming language such as Solidity, which is the most popular. The source code is converted into an intermediate language (bytecode) and deployed on the blockchain. See
bytecode and
Solidity.
Immutable Software
Unlike applications running on regular servers, the smart contract is irreversible. If a smart contract is updated, an entirely new contract is deployed, and the old one becomes inaccessible. Smart contracts are also traceable and verifiable; all attributes of the blockchain architecture. See
Solidity,
blockchain,
Ethereum and
blockchain oracle.
Bitcoin Smart Contracts
Ethereum was designed from scratch to be a programmable platform whereas Bitcoin was created as a store of digital currency. However, Bitcoin transactions do have some programmability, although very limited in comparison. Nevertheless, they are sometimes called "Bitcoin smart contracts," which Ethereum pundits feel is unjustified (see
Bitcoin smart contract).
Client/Server Architecture
Transactions generated in a desktop application or in a crypto wallet in a smartphone or browser extension activate functions in the contract. This client/server interaction is known as a decentralized app (dApp) because the smart contract resides in multiple nodes (servers) of Ethereum or a similar platform. See
EVM,
bytecode and
client/server.