Cardano uses blake2b as a hashing algorithm throughout the chain. There was previously use of SHA-256 in some parts of the Byron era. Hash length Hashes are generally 32 bytes long on Cardano / 256 bits Credentials (e.g. keys and scripts) are 28 bytes long / 224 bits.
All posts by
.Functions general
Functions always have a return type. There is no return keyword, instead, they implicitly return whatever they evaluate to (the result of the last expression is returned). Calling functions Using argument names You can call functions and use the functions argument names if you wish, in any order, e.g.
Constants
Specifying type with a constant Optional, if you want to do it:
Variables
let expect You can also introduce new bindings through the expect keyword.
.Strings general
The use case for strings is extremely narrow in Aiken and on-chain code, they are only used for tracing, a bit like labels attached to specific execution paths of your program. Most of the time, you probably want to use a ByteArray instead and only resort to String for debugging. Creating strings Unicode Under the […]
Literals
integer literals Literals can be written with _ as separators if desired to enhance readability, e.g. 1_000_000 Binary: 0b00001111 Hexadecimal: 0xF Octal: 0o17
Operators
Boolean && //Logical ‘AND’|| //Logical ‘OR’== //Equality! //Logical ‘NOT’? //Trace if false Integer + //Arithmetic sum- //Arithmetic difference/ //Whole division* //Arithmetic multiplication% //Remainder by whole division
Comments
Types
Primitive types boolean True or False integer Arbitrary sized integer (there is no underflow or overflow). string UTF8 encoded binariesThe use case for strings is extremely narrow in Aiken and on-chain code, they are only used for tracing, a bit like labels attached to specific execution paths of your program. Most of the time, you […]
Addresses
Addresses documentation by Aiken Tools bech32 command-line tool A great command-line tool for converting back-and-forth between bech32-encoded strings and hex-encoded strings. Very useful