Smart contracts and the law: does code replace a contract, and who answers when it fails?
Developers sometimes say code is law. Regulators and courts have answered that code sits inside the law, and the answer depends on what the program does and who controls it.

The short answer
A smart contract is a program that runs exactly as written, but being code does not put it outside the law. The SEC treated The DAO's tokens as securities, US agencies apply financial rules to DeFi by function, and a 2024 appeals ruling limited sanctions on immutable code.
Key takeaways
- A smart contract is code and data at a blockchain address; by default it cannot be deleted and interactions with it are final.
- In 2017 the SEC concluded that tokens sold by The DAO, an organisation run by code, were securities.
- The Treasury says a DeFi service that functions as a financial institution must meet anti-money-laundering rules whatever its structure.
- In 2024 a federal appeals court held that Tornado Cash's immutable smart contracts were not property that sanctions could block.
- Whether a program creates obligations a court will enforce depends on the governing law; the US sources used here do not declare code automatically binding.
What is a smart contract, in legal terms?
Technically, a smart contract is a set of functions and stored data sitting at an address on a blockchain1. It holds balances and runs as programmed; by default it cannot be deleted and interactions with it cannot be reversed1. The idea is older than Ethereum: a CFTC primer quotes Nick Szabo's 1996 description of a smart contract as a set of promises, specified in digital form, with protocols within which the parties perform5.
That description borrows the language of contract law, but a program is not automatically a legal contract. Whether particular code creates obligations a court will enforce depends on the law governing the people involved, and none of the US agency sources on this page declares smart contracts binding in themselves. What regulators have done is decide how existing laws apply to activities carried out through code.
Legal questions smart contracts raise, and US answers so far
| Question | US answer so far | Source |
|---|---|---|
| Can tokens issued by code be securities? | Yes: the SEC found The DAO's tokens were securities | SEC report, 20173 |
| Do money-laundering rules reach DeFi? | Yes, where a service functions as a financial institution | Treasury risk assessment11 |
| Is DeFi run without people? | Often not: responsible persons may control or influence it | IOSCO, 202310 |
| Can immutable code be sanctioned as property? | No, per one federal appeals court | Fifth Circuit, 20247 |
What did The DAO teach regulators about code?
The DAO was an organisation embodied in computer code and run on a blockchain3. In 2016 it sold roughly 1.15 billion DAO tokens for about 12 million ETH3. In June an unknown attacker began draining funds and moved about 3.6 million ETH, a third of the total raised, to an address under their control3. The Ethereum community changed the network's rules with a hard fork that took effect on 20 July 2016 and sent the funds to a recovery address34.
The SEC's July 2017 report then concluded that DAO tokens were securities3. Automation did not change the legal character of what investors bought. Our Howey test explainer covers how US law decides whether something is an investment contract.
Can a smart contract be sanctioned?
The Tornado Cash case tested that question. Treasury sanctioned the Ethereum mixer in August 20226. On 26 November 2024 the Fifth Circuit held in Van Loon v. Department of the Treasury that Tornado Cash's immutable smart contracts are not property under the sanctions statute and so cannot be blocked7. The court did not decide whether Tornado Cash is an entity, and it did not rule on contracts that can be changed7.
Treasury removed Tornado Cash from the sanctions list on 21 March 2025, citing the novel legal and policy issues of sanctioning evolving technology, while stressing continued concern about North Korean laundering8. Separately, on 6 August 2025 a federal jury convicted a co-founder of conspiracy to operate an unlicensed money transmitting business9. Code may escape one statute and the people around it still face another. See sanctions and crypto for the wider rules.
Figure · Tornado Cash in the courts and at Treasury
- Aug 2022Sanctioned
- Nov 2024Appeals ruling
- Mar 2025Removed from list
- Aug 2025Conviction
Who is responsible when a DeFi contract is involved?
Regulators look past the word "decentralised". IOSCO's 2023 policy recommendations note that DeFi arrangements often still have people who control or strongly influence them10. The US Treasury says a DeFi service that functions as a financial institution under the Bank Secrecy Act must meet anti-money-laundering obligations whatever it calls itself11.
For a user, that means the legal question is rarely about the contract alone. It is about who wrote it, who can upgrade or pause it, and who earns from it. Contracts designed with upgrade or pause functions give someone power over them2, and that power is exactly what supervisors try to locate.
What happens to your money when code fails?
Because interactions are final by default1, a bug or exploit usually cannot be undone by the contract itself. ethereum.org estimates that value stolen or lost through smart contract flaws is easily over $1 billion, and says audits will not catch every bug2. Legal remedies, if any, run against people and firms, not against the code.
Risk warning
No regulator stands behind the code
Before sending funds to a contract, find out who can change it, who runs the service around it and what recourse, if any, exists if it fails. Assume a loss may be permanent.
What mistakes do people make about smart contracts and the law?
Common beginner mistakes
Believing code is beyond regulation
The SEC's DAO report and Treasury's DeFi assessment both apply existing law to code-based activity311.
Reading the Tornado Cash ruling broadly
The court addressed immutable contracts under one sanctions statute; it did not decide mutable contracts7.
Assuming nobody is in charge
IOSCO found that DeFi often has responsible persons behind it10.
Expecting a reversal after a loss
Contract interactions are irreversible by default1.
For how contracts are written, deployed and executed on-chain, go deeper on Protocol Insights: what is a smart contract.
Frequently asked questions
Is a smart contract legally binding?
Can a token created by a smart contract be a security?
Yes. The SEC concluded in 2017 that The DAO's tokens were securities3; see our token standards page for how tokens are built.
Did the Tornado Cash ruling legalise mixers?
Who can I pursue if a DeFi contract loses my funds?
Remedies run against people or firms, and IOSCO notes DeFi often has responsible persons10. Recovery is never guaranteed.
The bottom line
Smart contracts execute without asking permission, but they do not execute outside the law. The SEC treated code-issued tokens as securities, Treasury applies anti-money-laundering rules to DeFi by function, and a federal appeals court drew a narrow line around immutable code. Before relying on a contract, ask who controls it and which legal rules still reach the people behind it. For a related scaling topic, see who controls a layer 2 rollup.
Sources
- Introduction to smart contracts — ethereum.org developer documentation Primary source
- Smart contract security — ethereum.org developer documentation Primary source
- Report of Investigation Pursuant to Section 21(a) of the Securities Exchange Act of 1934: The DAO (Release No. 81207) — U.S. Securities and Exchange Commission, 2017 Primary source
- The history of Ethereum (network upgrades) — ethereum.org Primary source
- A Primer on Smart Contracts — LabCFTC, U.S. Commodity Futures Trading Commission, 2018 Primary source
- U.S. Treasury Sanctions Notorious Virtual Currency Mixer Tornado Cash (jy0916) — U.S. Department of the Treasury, 2022 Primary source
- Van Loon v. Department of the Treasury, No. 23-50669 (5th Cir. 2024) — U.S. Court of Appeals for the Fifth Circuit, 2024 Primary source
- Tornado Cash Delisting (sb0057) — U.S. Department of the Treasury, 2025 Primary source
- Press release on the jury verdict against Tornado Cash co-founder Roman Storm (6 August 2025) — U.S. Attorney's Office, Southern District of New York, 2025 Primary source
- Final Report with Policy Recommendations for Decentralized Finance (DeFi) — International Organization of Securities Commissions (IOSCO), 2023 Primary source
- Illicit Finance Risk Assessment of Decentralized Finance — U.S. Department of the Treasury, 2023 Primary source
How we checked this page: every figure above links to the numbered source it came from. Spotted an error? Tell the desk — see our editorial policy.




