Skip to main content

What is a smart contract?

Smart contracts on Cardano are simple programs often referred to as validator scripts in which users define custom logic. They are automatically executed by each Cardano node validating the transaction when the transaction attempts to move funds from the script's address. The address of each script is derived from the hash-sum of the compiled script.

Once deployed, smart contracts become immutable, which means they cannot be changed. They are distributable and tamper-proof, fast, and cost-effective, as there is no intermediary, which saves both money and time.

Tooling and languages

Cardano introduced smart contract support in 2021. As a multi-functional environment, Cardano now supports the development and deployment of smart contracts using different programming languages. Here are some examples:

  • Plutus — a purpose-built smart contract development and execution platform. Plutus contracts consist of parts that run on the blockchain (on-chain code) and parts that run on a user’s machine (off-chain or client code). Plutus draws from modern language research to provide a safe, full-stack programming environment based on Haskell, the leading functional programming language.
  • Marlowe — a domain-specific language (DSL) for writing and executing financial contracts that allows building contracts visually as well as in more traditional code. Financial institutions can use it to develop and deploy custom instruments for their customers and clients, for example. The Marlowe language itself is now embedded in JavaScript, TypeScript, and Haskell offering a choice of editors depending on developers’ preferences and skills.
  • Aiken - a language and toolchain favoring developer experience. Aiken is used for on-chain validator scripts only.
  • OpShin - a programming language based on Python for generic smart contracts for Cardano.
  • plu-ts - TypeScript-embedded smart contract programming language and a transaction creation library.