https://github.com/aiken-lang/stdlib
The Aiken Standard Library
https://github.com/aiken-lang/stdlib
aiken cardano plutus smart-contract
Last synced: 3 months ago
JSON representation
The Aiken Standard Library
- Host: GitHub
- URL: https://github.com/aiken-lang/stdlib
- Owner: aiken-lang
- License: apache-2.0
- Created: 2022-12-07T03:06:47.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2025-03-08T22:11:43.000Z (3 months ago)
- Last Synced: 2025-03-08T23:18:48.610Z (3 months ago)
- Topics: aiken, cardano, plutus, smart-contract
- Language: Gleam
- Homepage: https://aiken-lang.github.io/stdlib
- Size: 900 KB
- Stars: 52
- Watchers: 6
- Forks: 32
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
- awesome-aiken - aiken-lang/stdlib - The official standard library (Libraries)
README
Aiken Standard Library
[](https://github.com/aiken-lang/stdlib/blob/main/LICENSE)
[](https://github.com/aiken-lang/stdlib/actions/workflows/continuous-integration.yml)
## Getting started
```
aiken add aiken-lang/stdlib --version v2
```## Compatibility
aiken's version | stdlib's version(s)
--- | ---
`v1.1.3`
`v1.1.4`
`v1.1.5`
`v1.1.6`
`v1.1.7`
`v1.1.9`
`v1.1.10`
`v1.1.11` | `>= 2.1.0`
`v1.1.1`
`v1.1.2` | `>= 2.0.0` && `< 2.1.0`
`v1.0.29-alpha`
`v1.0.28-alpha` | `>= 1.9.0` && `< 2.0.0`
`v1.0.26-alpha` | `<= 1.8.0` && `< 1.9.0`## Overview
The official standard library for the [Aiken](https://aiken-lang.org) Cardano
smart-contract language.It extends the language builtins with useful data-types, functions, constants
and aliases that make using Aiken a bliss.```aiken
use aiken/collection/list
use aiken/crypto.{VerificationKeyHash}
use cardano/transaction.{OutputReference, Transaction}pub type Datum {
owner: VerificationKeyHash,
}pub type Redeemer {
msg: ByteArray,
}/// A simple validator which replicates a basic public/private signature lock.
///
/// - The key (hash) is set as datum when the funds are sent to the script address.
/// - The spender is expected to provide a signature, and the string 'Hello, World!' as message
/// - The signature is implicitly verified by the ledger, and included as 'extra_signatories'
///
validator hello_world {
spend(datum: Option, redeemer: Redeemer, _, self: Transaction) {
expect Some(Datum { owner }) = datumlet must_say_hello = redeemer.msg == "Hello, World!"
let must_be_signed = list.has(self.extra_signatories, owner)
and {
must_say_hello,
must_be_signed,
}
}
}
```## Stats
