Builtins
You can find the Aiken equivalents of those builtins in aiken-lang/prelude (opens in a new tab).
Builtins | Type Args | Term Args | Result |
---|---|---|---|
ifThenElse 1 | (α) | (Bool, (α), (α)) | α |
addInteger | - | (Integer, Integer) | Integer |
subtractInteger | - | (Integer, Integer) | Integer |
multiplyInteger | - | (Integer, Integer) | Integer |
divideInteger | - | (Integer, Integer) | Integer |
modInteger | - | (Integer, Integer) | Integer |
quotientInteger | - | (Integer, Integer) | Integer |
remainderInteger | - | (Integer, Integer) | Integer |
equalsInteger | - | (Integer, Integer) | Bool |
lessThanInteger | - | (Integer, Integer) | Bool |
lessThanEqualsInteger | - | (Integer, Integer) | Bool |
integerToByteString | - | (Bool, Integer, Integer) | Integer |
appendString | - | (String, String) | String |
equalsString | - | (String, String) | Bool |
encodeUtf8 | - | (String) | Bytestring |
appendByteString | - | (Bytestring, Bytestring) | Bytestring |
consByteString | - | (Integer, Bytestring) | Bytestring |
indexByteString | - | (Bytestring, Integer) | Integer |
sliceByteString | - | (Integer, Integer, Bytestring) | Bytestring |
lengthOfByteString | - | (Bytestring) | Integer |
equalsByteString | - | (Bytestring, Bytestring) | Bool |
lessThanByteString | - | (Bytestring, Bytestring) | Bool |
lessThanEqualsByteString | - | (Bytestring, Bytestring) | Bool |
decodeUtf8 | - | (Bytestring) | String |
byteStringToInteger | - | (Bool, Bytestring) | Integer |
chooseData 2 | (α) | (Data, (α), (α), (α), (α), (α)) | α |
constrData | - | (Integer, List Data) | Data |
unConstrData | - | Data | (Integer, List Data) |
iData | - | (Integer) | Data |
unIData | - | (Data) | Integer |
bData | - | (Bytestring) | Data |
unBData | - | (Data) | Bytestring |
mapData | - | (List (Pair Data Data)) | Data |
unMapData | - | (Data) | List (Pair Data Data) |
listData | - | (List Data) | Data |
unListData | - | (Data) | List Data |
equalsData | - | (Data, Data) | Bool |
serialiseData | - | (Data) | Bytestring |
chooseList 3 | (α, β) | (List (α), (β), (β)) | β |
mkNilData | - | (Unit) | List (Data) |
mkNilPairData | - | (Unit) | List (Pair Data Data) |
mkCons | (α) | ((α), List (α)) | List (α) |
headList | (α) | (List (α)) | α |
tailList | (α) | (List (α)) | List (α) |
nullList | (α) | (List (α)) | Bool |
mkPairData | - | (Data, Data) | Pair (Data) (Data) |
fstPair | (α, β) | Pair (α) (β) | α |
sndPair | (α, β) | Pair (α) (β) | β |
blake2b_224 | - | (Bytestring) | Bytestring |
blake2b_256 | - | (Bytestring) | Bytestring |
keccak_256 | - | (Bytestring) | Bytestring |
sha2_256 | - | (Bytestring) | Bytestring |
sha3_256 | - | (Bytestring) | Bytestring |
verifyEd25519Signature 4 | - | (Bytestring, Bytestring, Bytestring) | Bool |
verifyEcdsaSecp256k1Signature 4 | - | (Bytestring, Bytestring, Bytestring) | Bool |
verifySchnorrSecp256k1Signature 4 | - | (Bytestring, Bytestring, Bytestring) | Bool |
bls12_381_G1_add | - | (G1Element, G1Element) | G1Element |
bls12_381_G1_scalarMul | - | (Integer, G1Element) | G1Element |
bls12_381_G1_neg | - | G1Element | G1Element |
bls12_381_G1_equal | - | (G1Element, G1Element) | Bool |
bls12_381_G1_compress | - | G1Element | bytestring |
bls12_381_G1_uncompress | - | bytestring | G1Element |
bls12_381_G1_hashToGroup | - | (Bytestring, Bytestring) | G1Element |
bls12_381_G2_add | - | (G2Element, G2Element) | G2Element |
bls12_381_G2_scalarMul | - | (Integer, G2Element) | G2Element |
bls12_381_G2_neg | - | G2Element | G2Element |
bls12_381_G2_equal | - | (G2Element, G2Element) | Bool |
bls12_381_G2_compress | - | G2Element | bytestring |
bls12_381_G2_uncompress | - | Bytestring | G2Element |
bls12_381_G2_hashToGroup | - | (Bytestring, Bytestring) | G2Element |
bls12_381_millerLoop | - | (G1Element, G2Element) | MillerLoopResult |
bls12_381_mulMlResult | - | (MillerLoopResult, MillerLoopResult) | MillerLoopResult |
bls12_381_finalVerify | - | (MillerLoopResult, MillerLoopResult) | Bool |
trace | (α) | (string, (α)) | α |
Footnotes
-
Returns the second argument when the predicate is
True
, and the third argument whenFalse
. ↩ -
Each argument corresponds to each of the constructors of a builtin data (in this order): constr, map, list, integer and bytestring. The evaluation will continue with whatever branch actually corresponds to the given term value. ↩
-
Returns the second argument when the list is empty, and the third argument otherwise. ↩
-
Arguments are respectively: the public key, the message and the signature ↩ ↩2 ↩3