What is a Smart Contract? And What It Can't Enforce
What is a smart contract, and what it can't enforce
A smart contract is a program stored on a blockchain that executes automatically when its conditions are met. The most common examples live on Ethereum: Uniswap's automated market maker, Aave's lending pool, the ERC-20 tokens that make up most of DeFi.
The "contract" part is metaphorical. There's no judge, no arbitration, no recourse to a court. The code is the rule, and the network enforces it.
The misnomer matters. A smart contract enforces what it can see and act on inside its own environment. Anything outside that environment, a price quote from an exchange, a shipment crossing a border, a borrower's intent to repay rather than default, requires a separate mechanism to bring that information back on-chain. Most of the famous DeFi failures come from confusing these two layers.
How it actually works
On Ethereum and EVM-compatible chains, smart contracts are written in Solidity (or Vyper), compiled to bytecode, and deployed to an address. Once deployed, the code is fixed.
A user, or another contract, calls a function on that address, pays a gas fee in the chain's native token, and every node in the network executes the code deterministically across thousands of machines. Every node arrives at the same result, computed identically from the same starting state. The result is recorded in a block.
A simple example: Uniswap's swap function. You send token A and a minimum acceptable amount of token B. The contract reads the pool's current reserves, calculates how much B you get based on the constant-product formula, transfers B to your wallet, and updates the pool.
The whole thing happens in one transaction. If the calculation gives you less B than your minimum, the transaction reverts and nothing moves. No counterparty has to agree, sign, or trust anything beyond the code itself.
That's the core property: deterministic execution against on-chain state. Aave's liquidation function works the same way. If your loan-to-value exceeds the threshold (measured against an oracle-fed price), any keeper can call liquidationCall, the contract checks the math, seizes the collateral, repays the debt, and pays the keeper a bonus. No one needs to ask permission.
What they can't enforce
Smart contracts run on what the blockchain already knows. They can't look up the spot price of bitcoin on Binance, can't confirm a shipping container reached Rotterdam, can't read a borrower's bank balance, and can't seize gold sitting in a vault in Zurich.
To act on any of those facts, the contract needs a feed (an oracle) that publishes the relevant data on-chain in a format the contract can read. Whoever runs that feed becomes the trust assumption.
This is where DeFi history piles up its scars. The Mango Markets exploit in October 2022 worked by pumping a thin-volume oracle price for 30 minutes and borrowing against the inflated mark; about $114 million walked out the door. The bZx flash-loan attacks ran the same playbook earlier. In both cases the contract behaved exactly as written. The dishonesty came from outside the chain, where the contract couldn't see.
The second gap is anything custodial. If your crypto sits in an MPC wallet at a qualified custodian, no Solidity function can move it. The contract doesn't hold the keys.
Enforcement against off-chain collateral runs through legal agreements, control procedures, and the custodian's policy engine. The chain can record a claim. It can't physically seize the asset.
Where this matters for institutional crypto-backed lending
For an institutional lender working in crypto, the smart contract is one tool in the stack, sitting alongside custody, legal documentation, and off-chain monitoring. On-chain logic handles deterministic position math, transparent state, and programmatic liquidation against tokenized collateral. Off-chain infrastructure handles custody, KYC, legal recourse, and fiat settlement.
Rekord's architecture splits work across that boundary deliberately, with the chain enforcing what it can see and legal-grade infrastructure handling what it can't. For the three-party model that connects them, see What is a lending protocol. For how off-chain data gets brought in safely, see Price oracles for institutional lending.