Credit: © Hurcastock! - https://www.hurcastock.com

The modern smart contract platform for Cardano

A pure functional programming language

  • Small and easy to learn
  • Strong static typing with inference
  • First-class functions and expressions, referential transparency
  • Custom types, recursion, modules, generics...
  • Modules, imports and package manager
validator hello_world {
  spend(datum, redeemer, input, self) {
    expect Some(Datum { owner }) = datum

    let must_say_hello =
      redeemer == "Hello, World!"

    let must_be_signed =
      list.has(self.extra_signatories, owner)

    must_say_hello? && must_be_signed?
  }
}

A modern development environment

  • Zero configuration, one single capable tool
  • Quick and friendly feedback with helpful error diagnotics
  • Language-Server Protocol (LSP) with auto-formatting
  • Easy-to-produce and beautiful libraries documentation
  • Editors integration (VSCode, NeoVim, Emacs, Zed...)
  • Tree-sitter support
Error: err::aiken::check::unknown_record_field

× While trying to make sense of your code...
╰─▶ I looked for the field 'extra_signatures' in a record
    of type 'Transaction' but didn't find it.

   ╭─[examples/hello_world/validators/hello_world.ak:18:1]
18 │   let must_be_signed =
19 │     list.has(
20 │       context.transaction.extra_signatures,
   ·       ────────────────────────────────────
21 │       datum.owner
22 │     )
   ╰─────────────────────────────────────────────────────

help: Did you mean 'extra_signatories'?

A toolkit for working with Plutus

  • Baked-in unit test framework
  • Property test framework with integrated shrinking
  • UPLC type reification into Aiken types
  • Full-blown Plutus interpreter & disassembler
  • Execution cost evaluation with trace reporting
  • Low-level scripts arguments injection
Compiling aiken-lang/stdlib 2.0.0
  Testing ...

    ┍━ aiken/option ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    │ PASS [mem:   5099, cpu:   1884852] or_else_1PASS [mem:   5963, cpu:   3091855] map_1PASS [mem:  11985, cpu:   5076974] map_2PASS [mem:   6863, cpu:   3298855] and_then_1PASS [mem:  14187, cpu:   5872937] and_then_2PASS [mem:  11657, cpu:   4918544] and_then_3
    ┕━━━━━━━━━━━━━━ 13 tests | 13 passed | 0 failed

  Summary 0 error, 0 warning(s)

Trusted by builders at

MinSwapjpg.storeSundae LabsCardano FoundationTxPipeInput Output HKLenfiButaneBook.io

Roadmap

Recently deliveredsee the full CHANGELOG

  • Plutus V3 support (language & virtual machine), and Plutus V3 transaction evaluation
  • New standard library v2 ― see aiken-lang/stdlib
  • Conditional environment and configuration modules
  • Softcasting (a.k.a if/is syntax)
  • Supercharged constants
  • Variadic traces with baked-in CBOR diagnostics

FAQ

What is Aiken?

Aiken is a modern programming language and toolkit for developing smart contracts on the Cardano blockchain. It is geared towards robustness and developer experience.


Aiken takes inspiration from many modern languages such as Gleam, Rust, and Elm, which are known for friendly error messages and an overall excellent developer experience. We believe Cardano deserves a dedicated language with these kinds of features, developed in the open with the community.

Why build another smart contract platform?

We love functional programming. Yet, we couldn't help to think that the current Haskell framework wasn't quite right in terms of developer experience and felt we could do something about it. So we came up with a set of shared goals we kept in mind while building Aiken:

  • Writing smart contracts should be easy and safe. You should be able to get started in minutes, not days, and rapidly build confidence that your on-chain code is doing what is intended.
  • We want a complete and delightful experience. A modern blockchain deserves a modern smart contract toolkit. You should be and feel productive when writing contracts. This includes editor integrations such as LSP and tree-sitter, beautiful error messages, rapid and intuitive test feedback loop and easy-to-produce documentation.
  • We want there to be as little configuration as possible. It should work out of the box and establish reasonable opinionated conventions with the community.
  • We want to have a modular design such that components can be picked and chosen as needed. Like the Unix philosophy. Aiken is only one part of a much bigger picture; While we firmly believe it is a great tool, we want to encourage other approaches and favour interoperability as much as possible.

I thought Cardano smart contracts had to be written in Haskell?

This is a common misconception. The current Cardano node implementation does indeed happen to be written in Haskell. The virtual machine for executing smart contracts that comes baked into the node is also implemented in Haskell. But that does not mean that it is Haskell which is executed by the smart contract virtual machine.


The virtual machine is a language interpreter which executes a smart contract language called 'Untyped Plutus Core' (abbrev. UPLC) often referred to simply as 'Plutus'.


Yet UPLC isn't something developers are expected to write by hand. Instead, it is a compilation target (like WebAssembly for the world wide web). Oddly enough, until recently, the only established framework that produced UPLC from a high-level syntax was called 'Plutus-Tx' and happened to be a Haskell framework.


Aiken changes the game by providing a modern framework that compiles straight to UPLC.

Can I write off-chain/backend code with Aiken?

Our main goal is to improve the smart contract development experience for the Cardano blockchain. By developing Aiken as a bespoke language, we can better align its features with what is truly needed for on-chain development.


We want to keep the language simple and manageable. In a decentralized architecture, smart contracts present a significant challenge where a single flaw can escalate into a multi-million financial exploit. More so, on-chain code typically represents a small fraction of an entire DApp source code. While writing contracts should be as straightforward as possible, smart contracts ought to be optimized for review, audit, and static analysis.


Hence, Aiken is not intended as a general-purpose language. Rather, it focuses on Cardano and aims for a high-quality toolkit for developing reliable smart contracts with confidence.

Are there any projects using Aiken? Where can I find them?

We keep an Awesome List of projects and resources built with and on Aiken. The list contains resources that we are aware of.


If you have a cool project not listed but want to see it up there, do not hesitate to make a pull request and introduce yourself!