Skip to content

Commit

Permalink
Merge pull request #540 from OlofBlomqvist/master
Browse files Browse the repository at this point in the history
Smart contract documentation updates
  • Loading branch information
olgahryniuk authored Oct 31, 2023
2 parents fcf18a4 + bd0744c commit a254e50
Show file tree
Hide file tree
Showing 33 changed files with 60 additions and 25 deletions.
35 changes: 13 additions & 22 deletions content/02-new-to-cardano/10-what-is-a-smart-contract.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,24 +3,14 @@ title: What is a smart contract?
metaTitle: What is a smart contract?
---

A _smart contract_ is an automated digital agreement, written in code, that
tracks, verifies, and executes the binding transactions of a contract between
various parties. The transactions of the contract are automatically executed by
the smart contract code when predetermined conditions are met. Essentially, a
smart contract is a short program whose inputs and outputs are transactions on a
blockchain.
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.

Smart contracts are self executing and reliable and do not require the actions
or presence of third parties. The smart contract code is stored on, and
distributed across, a decentralised blockchain network, making it transparent
and irreversible.
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.

In summary, smart contracts are immutable as a contract cannot be changed, they
are distributable and tamper-proof, fast and cost effective, as there is no
middle man which saves money and time, and is safe due to encryption.
## Tooling and languages

Cardano introduced smart contract support in 2021. As a multi-functional
environment, Cardano supports the development and deployment of smart
environment, Cardano now supports the development and deployment of smart
contracts using such programming languages as:

- **Plutus** — a purpose-built smart contract development and execution
Expand All @@ -33,15 +23,16 @@ contracts using such programming languages as:
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 both JavaScript and Haskell offering a
choice of editors depending on developers’ preference and skillset.

Currently, there are more smart contract languages and tools to build on Cardano. For more details, see:
language itself is now embedded in JavaScript, TypeScript, and Haskell offering a
choice of editors depending on developers’ preferences and skills.
- - **[Aiken](https://aiken-lang.org/)** - a language and toolchain favoring developer experience. Aiken is used for on-chain validator scripts only.
- - **[OpShin](https://github.com/OpShin)** - a programming language based on Python for generic smart contracts for Cardano.
- **[plu-ts](https://github.com/HarmonicLabs/plu-ts)** - TypeScript-embedded smart contract programming language and a transaction creation library.

- [Plutus tooling](https://docs.cardano.org/plutus/plutus-resources/#plutustooling)
- [A list of community-built developer tools on Cardano](https://www.essentialcardano.io/article/a-list-of-community-built-developer-tools-on-cardano)

#### Related Topics
### Further reading and related topics

- [Developer Portal - smart contracts overview](https://developers.cardano.org/docs/smart-contracts/)
- [A list of community-built developer tools on Cardano](https://www.essentialcardano.io/article/a-list-of-community-built-developer-tools-on-cardano)
- [Plutus tooling](https://docs.cardano.org/plutus/plutus-resources/#plutustooling)
- [Marlowe explainer](/marlowe/learn-about-marlowe)
- [Plutus explainer](/plutus/learn-about-plutus)
6 changes: 6 additions & 0 deletions content/12-smart-contracts.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Smart Contracts
metaTitle: Smart Contracts
---

<!-- heading no content -->
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -33,3 +33,11 @@ To get started with Marlowe, find the various resources on the updated [document
- [Videos](https://docs.marlowe.iohk.io/tutorials/videos)
- [Contract gallery](https://docs.marlowe.iohk.io/docs/examples/examples-contract-gallery)
- [Developer tools](https://docs.marlowe.iohk.io/docs/developer-tools/overview).

## Technical specifications and documentation

|Link|Description|
|----|-----------|
| [Marlowe](https://github.com/input-output-hk/marlowe) | Chain-agnostic Marlowe specification and reference implementation
| [Marlowe Cardano](https://github.com/input-output-hk/marlowe-cardano/) | The Cardano specific implementation of Marlowe
| [Developer Portal](https://developers.cardano.org/docs/smart-contracts/marlowe) | Documentation for introducing Marlowe to developers |
6 changes: 6 additions & 0 deletions content/12-smart-contracts/03-aiken.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
title: Aiken
metaTitle: Aiken
---

<!-- heading no content -->
24 changes: 24 additions & 0 deletions content/12-smart-contracts/03-aiken/01-learn-about-aiken.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
title: Learn about Aiken
metaTitle: Learn about Aiken
---

> ⚠️ Please note that Aiken is still in development and is not yet recommended for use in production environments.
Aiken is a new programming language and toolchain for developing smart contracts on the Cardano blockchain. It draws inspiration from various modern languages, like Gleam, Rust, and Elm, renowned for their friendly error messages and an overall excellent developer experience.

The language is exclusively used for creating on-chain validator scripts. Users will need to write their off-chain code for generating transactions in another language, such as Rust, Haskell, JavaScript, Python, etc.

As a language, Aiken is purely functional with static typing and type inference. This means most of the time, the compiler is smart enough to determine the type of something without requiring user annotation. It also allows the creation of custom types resembling records and enums. Aiken does not include higher-kinded types or type classes because it aims for simplicity.

On-chain scripts are typically small in size and scope compared to other kinds of applications being developed today. Consequently, they do not necessitate as many features as general-purpose languages that must tackle far more complex issues.

Aiken is easier than Plutus to get started with for those who are less familiar with functional languages like Haskell. Similar to Plutus, Aiken scripts are compiled down to the untyped Plutus Core (UPLC).

## Resources

- [Aiken website](https://aiken-lang.org)
- [GitHub repository](https://github.com/aiken-lang/aiken)



File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes
6 changes: 3 additions & 3 deletions netlify.toml
Original file line number Diff line number Diff line change
Expand Up @@ -659,17 +659,17 @@ status = 301

[[redirects]]
from = "https://testnets.cardano.org/programming-languages/plutus/overview/"
to = "/plutus/learn-about-plutus"
to = "/smart-contracts/plutus/learn-about-plutus"
status = 301

[[redirects]]
from = "https://testnets.cardano.org/programming-languages/plutus/getting-started/"
to = "/plutus/Plutus-PG-setup"
to = "/smart-contracts/plutus/Plutus-PG-setup"
status = 301

[[redirects]]
from = "https://testnets.cardano.org/programming-languages/plutus/resources/"
to = "/plutus/plutus-resources"
to = "/smart-contracts/plutus/plutus-resources"
status = 301

[[redirects]]
Expand Down

0 comments on commit a254e50

Please sign in to comment.