Skip to content

Neal-C/exploring_aiken_cardano

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

exploring_aiken_cardano

Tried v2.2.0

Resources

Notes

  • The native coin is called ADA, in tribute to Ada Lovelace, the first programmer.

  • The blockchain's name is from the italian mathematician : Cardano

  • A typical Cardano address is made of 2 or 3 parts: Header, Payment credentials and optionally Delegation credentials. It can be represented as a bech32 encoded string or base16 hex-encoded string.

  • Cardano allows locking funds using a script representing the validation logic that must be satisfied to spend funds guarded by the address. it calls such addresses "script addresses". Think Smart contract

  • Datums are outputs that contain a value, an address and a payload. The datum is, a free payload that developers can use to attach data to script execution. When a script is executed in a spending scenario, it receives not only the transaction as context but also the datum associated with the output being spent.

  • The redeemer, is another piece of data that is also provided with the transaction for any script execution.

  • Scripts are often referred to as validators. Cardano claims that they're fully deterministic. Their execution only depends on the transaction they're involved with, and evaluating the transaction's outcome is possible before sending it to the network. Datums act as local states, and redeemers are user inputs provided in the transaction itself.

  • What a script is used for is referred to as its purpose. There is 6 kind of Purpose : spend, publish, withdraw, mint, vote, and propose.

  • Scripts are akin to parameterized predicate functions, returning either true or false.

  • Datums take the role of function parameters, whereas redeemers the one of argument.

  • Aiken builds are a CIP-0057 Plutus blueprint

  • The ? operator is called : trace-if-false . This operator will trace the expression it is attached to only if it evaluates to False.

  • Aiken has built-in test support

  • Tests can also serve as benchmarks since they display the exact memory and steps execution units required to run them

  • Never type : in some rare cases, it is needed to refer to an Option that can only ever be None. This is the case in some parts of the standard library and mainly due to unforeseen bugs in the ledger and backward compatibility concerns. It is identical in all points to None and serialises down to the same binary structure.

  • Aiken has an integrated property-based testing framework. Yes, you read that right. Property-based test is a first-class citizen here.

  • Aiken has the pipe operator |>

Instructions

With Docker

git clone https://github.com/Neal-C/exploring_aiken_cardano.git
cd exploring_aiken_cardano
docker build -t neal-c-aiken-cardano:latest .
docker run --name neal-c-aiken-cardano neal-c-aiken-cardano:latest

With local installation

See https://aiken-lang.org/installation-instructions for most up-to-date instructions.

curl --proto '=https' --tlsv1.2 -LsSf https://install.aiken-lang.org | sh
aikup
aiken build
aiken check

About

intimate notes on Cardano Smart contracts with Aiken lang

Topics

Resources

Stars

Watchers

Forks

Contributors