info
To start developing with Plutus, see:
- Plutus Core documentation
- Developer portal Plutus overview
- 'Plutus resources' below for more details.
Plutus is the native smart contract language for Cardano. It is aTuring-complete language written in Haskell, and Plutus smart contracts areeffectively Haskell programs. By using Plutus, you can be confident in thecorrect execution of your smart contracts. It draws from modern languageresearch to provide a safe, full-stack programming environment based on Haskell,the leading purely-functional programming language.
Plutus smart contracts
Plutus smart contracts consist of parts that run on the blockchain (on-chaincode) and parts that run on a user’s machine (off-chain or client code).Off-chain code can be written using the Plutus Application Framework (PAF), andthis code is then compiled by the GHC (Glasgow Haskell Compiler), whereason-chain code is compiled by the Plutus compiler into Plutus Core.
Accounting model used by Plutus
Cardano uses theextended UTXO accounting model (EUTXO)which extends the unspent (U) transaction (TX) output (O) accounting model(UTXO) (used by Bitcoin). In the UTXO model, a transaction has inputsand outputs, where the inputs are unspent outputs from previoustransactions. As soon as an output is used as input in a transaction, it becomesspent and can never be used again. The output is specified by an address(a public key or public key hash) and a value (consisting of an ada amount andoptional, additional native token amounts).
EUTXO extends the UTXO model by allowing output addresses to contain complexlogic to decide which transactions can unlock them, and by adding custom datato all outputs. This model offers unique advantages over other accountingmodels. The success or failure of transaction validation depends only on thetransaction itself and its inputs and not on anything else on the blockchain.Consequently, the validity of a transaction can be checked off-chain beforethe transaction is sent to the blockchain. A transaction can still fail if someother transaction concurrently consumes an input that the transaction isexpecting. However, if all inputs are still present, the transaction isguaranteed to succeed.
Plutus Core
Plutus Core is the scripting language used by Cardano to implement the EUTXOmodel. It is a functional language similar to Haskell, and a largesubset of Haskell can be used to write Plutus Core scripts. As a smart contractauthor, you don’t write any Plutus Core; rather, all Plutus Core scripts aregenerated by a Haskell compiler plugin.
These scripts will be executed by nodes during transaction validation ‘live’ onthe chain. They will either lock EUTXOs in the form of validator scripts or asminting policies, which control the minting and burning of native tokens.
In practice, when developing smart contracts, you will write validator scriptsin Haskell, which will then be automatically compiled into Plutus Core using aGHC plug-in called Plutus Tx.
Plutus and native tokens
Each native token comes with its own minting policy, which determines theconditions under which tokens can be minted and burnt. Users can write mintingpolicies in Haskell and compile them to Plutus Core. During the minting orburning process, the Plutus Core policy script is executed in the context of theminting or burning transaction, and the script will have to approve or forbidthe action. This feature further accelerates the growth of non-fungible tokens(NFTs) on Cardano by enabling the creation of much more complex minting policiesand allowing the creation of NFTs in a trustless manner.
Advantages of Plutus
Plutus provides considerable security advantages. It delivers an easier, morerobust way to show that your smart contracts are correct and will not encounterthe problems found in previous smart contract language design.
Plutus enables a novel integrated approach to smart contract and distributedapplication development that is more convenient and safer than previousalternatives. Both the on-chain and off-chain code are based on the samelanguage. You use a uniform code base, which the Plutus toolchain thenautomatically separates into on-chain and off-chain code and packages fordeployment.
Additionally, in contrast to Ethereum, Plutus supports user-defined tokens (bothfungible and non-fungible) natively which does not require an accompanying smartcontract.
Plutus developer resources
Plutus Core
Plutus Core is the scripting language embedded in the Cardano ledger. It formsthe basis of the Plutus Platform – an application development platform fordeveloping decentralized applications (DApps) on the Cardano blockchain.
Developer resources:
- Plutus Core GitHub repository:includes the implementation, specification, and mechanized metatheory ofPlutus Core as well as Plutus Tx – the compiler from Haskell to Plutus Core.
Associated links:
Official Haskell language server implementation
Haskell language server implementation is an implementation of a server for theLanguage Server Protocol (LSP). A language server talks to a client, who can askthe server to perform various operations, such as reporting errors or providingcode completions.
Developer resources:
Haskell course
Plutus Core is written in Haskell. To use Plutus,it is essential to know the basics of Haskell. To help with the onboardingjourney, IOG's education team created the Haskell course for beginners. You canfind the repository with explainers, links to lectures, and more below.
Plutus user documentation
This section includes references to Plutus user documentation such asexplanations, tutorials, how-to guides, etc.
Documentation:
Plutus Core and Plutus Tx user guide:introduces the Plutus Core programming language and programming with PlutusTx. Documentation includes explanations, tutorials, how-to instructions,troubleshooting, and reference information:
Video presentation on the Plutus Platform:in this session from the 2020 Cardano Summit, Michael Peyton-Jones walks usthrough working with Plutus, while Jann Müller then takes us through thePlutus Application Platform, where assets can be built and launched. He alsodemonstrates how tokens can be transferred using a smart contract.
Plutus Pioneer Program
- Plutus Pioneer Program:includes lectures, examples, and exercises
- Plutus Pioneer Program notes and documentation
- 'plutus-pioneer-program' questions on Cardano Stack Exchange
- Plutus Pioneer Discord
Plutus Pioneer community notes:
- How to prepare for the Plutus Pioneer Program
- Essential Resources and Documentation for the Plutus Pioneer Program
- Plutus Pioneer Program Part 1: Understanding the eUTXO Model and Coding the first Smart Contract
- Plutus Pioneer Program - Part 2: How to “deploy” a Smart Contract in Cardano
- Plutus Pioneer Program - Part 3: How to Mint and Burn Tokens and NFTs in Cardano
- Plutus Pioneer Program - Part 4: State Machine with Plutus (1/2)
- Plutus Pioneer Program - Part 5: State Machine with Plutus (2/2)
Plutus community resources
This section provides links to Plutus community resources.
If you are a community member engaged with Plutus development, please raise apull request to add more relevant links and information.
- Cardano forum for Plutus discussions
- Plutus community docsarticle
- Plutus community docs
Discussions & support:
- IOG Technical Discord
- Cardano Stack Exchange
- Cardano Forum
There are different tools that developers can use to evaluate and deploy smartcontracts on Cardano:
An extended list of community-built developer tools on Cardano:includes NFT creation tools, smart contract platforms, software libraries,APIs, interfaces, SDKs, digital product platforms, data services, blockchainintegration, automation tools, decentralized protocols, enterprise apps, stakepool tooling, and more.
Emurgo
Plutonomicon
OpShin
Harmonic
TxPipe
- Aiken
- Oura
- Scrolls
- Pallas
- Demeter Run - a cloud environment with all the toolsfor building DApps on Cardano
dcSpark
MLabs
dQuadrant
CardanoSolutions
Other tools