aiken/builtin
This modules contains all the Plutus builtins recognized by Aiken.
It’s important to note that many of those functions are partial and will halt the execution of the Plutus virtual machine on failure. They also all rely on call-by-value, which means that function arguments are eagerly evaluated.
Functions
Integer
Minimum Plutus Version 1
Integer division truncated towards negative infinity (/).
Minimum Plutus Version 1
Integer division truncated towards zero.
Minimum Plutus Version 1
Integer remainder, satisfying
quotient_integer(x, y) * y + remainder_integer(x, y) == x
Minimum Plutus Version 1
Integer modulus (%), satisfying
divide_integer(x, y) * y + mod_integer(x, y) == x
Minimum Plutus Version 3
Convert an integer value into a ByteArray.
-
The first arguments / specifies the endianness:
boolean value endianness
True Big endian
False Little endian
-
The second argument indicates the target size
(in bytes) of the final ByteArray. This allows to allocate a specific number of bytes in advance. The function fails if the given value cannot fit in the requested size or if the value
is negative. However, a size of 0 will yield a ByteArray that is precisely as large as necessary to fit the value
.
Bytearray
Constructing
Minimum Plutus Version 1
Concatenate two bytearrays together.
Minimum Plutus Version 1
Push a byte in front of a bytearray.
Minimum Plutus Version 2
Construct a ByteArray
from the repetition of the same byte a specific number of times. Fails if the byte is out-of-bound or if the length is negative.
Inspecting
Minimum Plutus Version 2
Count the number of bits set in the given ByteArray
.
Minimum Plutus Version 2
Find the index of the first bit set. Note that bits are indexed from the end (see also read_bit
for more details).
Minimum Plutus Version 1
Access the byte at the given index in the bytearray.
Minimum Plutus Version 1
Number of bytes in a bytearray.
Minimum Plutus Version 2
Read a particular bit (True
if set) at the given index. Fails if the
index is out-of-bounds. Note that the index reads from the end. For
example, consider the byte 0xF4
and an index i
:
i=7 i=6 i=5 i=4 i=3 i=2 i=1 i=0
1 1 1 1 0 1 0 0
So, we have:
read_bit(#[0xF4], 0) == False
read_bit(#[0xF4], 1) == False
read_bit(#[0xF4], 2) == True
read_bit(#[0xF4], 3) == False
read_bit(#[0xF4], 4) == True
read_bit(#[0xF4], 5) == True
read_bit(#[0xF4], 6) == True
read_bit(#[0xF4], 7) == True
read_bit(#[0xF4, 0xF4], 8) == False
Minimum Plutus Version 1
Extract a sub-array from a bytearray given starting and length of the sub-array.
Comparing
Minimum Plutus Version 1
Bytearray equality.
Minimum Plutus Version 1
Bytearray strict inequality.
Minimum Plutus Version 1
Bytearray inequality.
Bitwise
Minimum Plutus Version 2
Logical AND applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical OR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical XOR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical bitwise complement of the bytearray (set becomes unset, and unset becomes set).
Shifting
Minimum Plutus Version 2
Like shift_bytearray
but instead of introducing zeroes in holes, use the bits that are dropped from either ends.
rotate_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x9D]
rotate_bytearray(#[0xEB, 0xFC], -8) == #[0xFC, 0xEB]
rotate_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0xEB]
Minimum Plutus Version 2
Shift bits in a ByteArray
by the given offset, replacing holes with zeroes. The offset can be positive (left-shift) or negative (right-shift).
shift_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x80]
shift_bytearray(#[0xEB, 0xFC], -8) == #[0x00, 0xEB]
shift_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0x00]
Transforming
Minimum Plutus Version 3
Convert a ByteArray to an integer value. The first argument
specifies the endianness:
boolean value endianness
True Big endian
False Little endian
String
Minimum Plutus Version 1
Concatenate two strings.
Minimum Plutus Version 1
Convert a string into a UTF-8 encoded array of bytes.
Minimum Plutus Version 1
Interpret a UTF-8 encoded array of bytes as a String. Fails if the bytes aren’t UTF-8 encoded.
List
Minimum Plutus Version 1
Push an element in front of a list.
Minimum Plutus Version 1
Select a branch to continue with depending on whether the list is empty or not.
Data
Minimum Plutus Version 1
Construct a Data
from a constructor index and a list of fields.
Minimum Plutus Version 1
Interpret a Data
as a constructor. Fails if it’s not a constructor.
Minimum Plutus Version 1
Interpret a Data
as a constructor and extract its fields. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version 1
Interpret a Data
as a constructor and extract its index. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version 1
Construct a Data
from a list of pairs.
Minimum Plutus Version 1
Interpret a Data
as a map. Fails if it’s not a map.
Minimum Plutus Version 1
Construct a Data
from a list of elements.
Minimum Plutus Version 1
Interpret a Data
as a list. Fails if it’s not a list.
Minimum Plutus Version 1
Interpret a Data
as a integer. Fails if it’s not an integer.
Minimum Plutus Version 1
Interpret a Data
as a bytearray. Fails if it’s not a bytearray.
Minimum Plutus Version 2
Serialise a Data to bytes, using CBOR.
choose_data(
data: Data,
when_constr: a,
when_map: a,
when_list: a,
when_int: a,
when_bytearray: a,
) -> a
Minimum Plutus Version 1
Select a branch to continue with based on what the Data actually is.
Pair
Minimum Plutus Version 1
Construct a Data from a pair of elements.
Crypto
Hashing
Minimum Plutus Version 1
Calculate the blake2b-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version 3
Calculate the blake2b-224 hash digest value of a given bytearray. Output is always 28-byte long.
Minimum Plutus Version 3
Calculate the keccak-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version 2
Calculate the ripemd-160 hash digest value of a given bytearray. Output is always 20-byte long.
Minimum Plutus Version 1
Calculate the SHA2-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version 1
Calculate the SHA3-256 hash digest value of a given bytearray. Output is always 32-byte long.
ECDSA
verify_ed25519_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 1
Verify an Ed25519 signature from a associated verification key.
verify_ecdsa_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 2
Verify an ECDSA-SECP256k1 signature from a associated verification key.
verify_schnorr_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 2
Verify a SCHNORR-SECP256k1 signature from a associated verification key.
Pairing
Minimum Plutus Version 3
Minimum Plutus Version 3
Minimum Plutus Version 3
Miscellaneous
Minimum Plutus Version 1
Continue with the continuation when the given term is Void.
Minimum Plutus Version 1
Trace the provided message, and continue with the continuation.
Minimum Plutus Version | 1 |
---|
Integer division truncated towards negative infinity (/).
Minimum Plutus Version | 1 |
---|
Integer division truncated towards zero.
Minimum Plutus Version | 1 |
---|
Integer remainder, satisfying
quotient_integer(x, y) * y + remainder_integer(x, y) == x
Minimum Plutus Version | 1 |
---|
Integer modulus (%), satisfying
divide_integer(x, y) * y + mod_integer(x, y) == x
Minimum Plutus Version | 3 |
---|
Convert an integer value into a ByteArray.
-
The first arguments / specifies the endianness:
boolean value endianness True Big endian False Little endian -
The second argument indicates the target
size
(in bytes) of the final ByteArray. This allows to allocate a specific number of bytes in advance. The function fails if the given value cannot fit in the requested size or if thevalue
is negative. However, a size of 0 will yield a ByteArray that is precisely as large as necessary to fit thevalue
.
Constructing
Minimum Plutus Version 1
Concatenate two bytearrays together.
Minimum Plutus Version 1
Push a byte in front of a bytearray.
Minimum Plutus Version 2
Construct a ByteArray
from the repetition of the same byte a specific number of times. Fails if the byte is out-of-bound or if the length is negative.
Inspecting
Minimum Plutus Version 2
Count the number of bits set in the given ByteArray
.
Minimum Plutus Version 2
Find the index of the first bit set. Note that bits are indexed from the end (see also read_bit
for more details).
Minimum Plutus Version 1
Access the byte at the given index in the bytearray.
Minimum Plutus Version 1
Number of bytes in a bytearray.
Minimum Plutus Version 2
Read a particular bit (True
if set) at the given index. Fails if the
index is out-of-bounds. Note that the index reads from the end. For
example, consider the byte 0xF4
and an index i
:
i=7 i=6 i=5 i=4 i=3 i=2 i=1 i=0
1 1 1 1 0 1 0 0
So, we have:
read_bit(#[0xF4], 0) == False
read_bit(#[0xF4], 1) == False
read_bit(#[0xF4], 2) == True
read_bit(#[0xF4], 3) == False
read_bit(#[0xF4], 4) == True
read_bit(#[0xF4], 5) == True
read_bit(#[0xF4], 6) == True
read_bit(#[0xF4], 7) == True
read_bit(#[0xF4, 0xF4], 8) == False
Minimum Plutus Version 1
Extract a sub-array from a bytearray given starting and length of the sub-array.
Comparing
Minimum Plutus Version 1
Bytearray equality.
Minimum Plutus Version 1
Bytearray strict inequality.
Minimum Plutus Version 1
Bytearray inequality.
Bitwise
Minimum Plutus Version 2
Logical AND applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical OR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical XOR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical bitwise complement of the bytearray (set becomes unset, and unset becomes set).
Shifting
Minimum Plutus Version 2
Like shift_bytearray
but instead of introducing zeroes in holes, use the bits that are dropped from either ends.
rotate_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x9D]
rotate_bytearray(#[0xEB, 0xFC], -8) == #[0xFC, 0xEB]
rotate_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0xEB]
Minimum Plutus Version 2
Shift bits in a ByteArray
by the given offset, replacing holes with zeroes. The offset can be positive (left-shift) or negative (right-shift).
shift_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x80]
shift_bytearray(#[0xEB, 0xFC], -8) == #[0x00, 0xEB]
shift_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0x00]
Transforming
Minimum Plutus Version 3
Convert a ByteArray to an integer value. The first argument
specifies the endianness:
boolean value endianness
True Big endian
False Little endian
String
Minimum Plutus Version 1
Concatenate two strings.
Minimum Plutus Version 1
Convert a string into a UTF-8 encoded array of bytes.
Minimum Plutus Version 1
Interpret a UTF-8 encoded array of bytes as a String. Fails if the bytes aren’t UTF-8 encoded.
List
Minimum Plutus Version 1
Push an element in front of a list.
Minimum Plutus Version 1
Select a branch to continue with depending on whether the list is empty or not.
Data
Minimum Plutus Version 1
Construct a Data
from a constructor index and a list of fields.
Minimum Plutus Version 1
Interpret a Data
as a constructor. Fails if it’s not a constructor.
Minimum Plutus Version 1
Interpret a Data
as a constructor and extract its fields. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version 1
Interpret a Data
as a constructor and extract its index. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version 1
Construct a Data
from a list of pairs.
Minimum Plutus Version 1
Interpret a Data
as a map. Fails if it’s not a map.
Minimum Plutus Version 1
Construct a Data
from a list of elements.
Minimum Plutus Version 1
Interpret a Data
as a list. Fails if it’s not a list.
Minimum Plutus Version 1
Interpret a Data
as a integer. Fails if it’s not an integer.
Minimum Plutus Version 1
Interpret a Data
as a bytearray. Fails if it’s not a bytearray.
Minimum Plutus Version 2
Serialise a Data to bytes, using CBOR.
choose_data(
data: Data,
when_constr: a,
when_map: a,
when_list: a,
when_int: a,
when_bytearray: a,
) -> a
Minimum Plutus Version 1
Select a branch to continue with based on what the Data actually is.
Pair
Minimum Plutus Version 1
Construct a Data from a pair of elements.
Crypto
Hashing
Minimum Plutus Version 1
Calculate the blake2b-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version 3
Calculate the blake2b-224 hash digest value of a given bytearray. Output is always 28-byte long.
Minimum Plutus Version 3
Calculate the keccak-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version 2
Calculate the ripemd-160 hash digest value of a given bytearray. Output is always 20-byte long.
Minimum Plutus Version 1
Calculate the SHA2-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version 1
Calculate the SHA3-256 hash digest value of a given bytearray. Output is always 32-byte long.
ECDSA
verify_ed25519_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 1
Verify an Ed25519 signature from a associated verification key.
verify_ecdsa_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 2
Verify an ECDSA-SECP256k1 signature from a associated verification key.
verify_schnorr_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 2
Verify a SCHNORR-SECP256k1 signature from a associated verification key.
Pairing
Minimum Plutus Version 3
Minimum Plutus Version 3
Minimum Plutus Version 3
Miscellaneous
Minimum Plutus Version 1
Continue with the continuation when the given term is Void.
Minimum Plutus Version 1
Trace the provided message, and continue with the continuation.
Minimum Plutus Version | 1 |
---|
Concatenate two bytearrays together.
Minimum Plutus Version | 1 |
---|
Push a byte in front of a bytearray.
Minimum Plutus Version | 2 |
---|
Construct a ByteArray
from the repetition of the same byte a specific number of times. Fails if the byte is out-of-bound or if the length is negative.
Minimum Plutus Version | 2 |
---|
Count the number of bits set in the given ByteArray
.
Minimum Plutus Version | 2 |
---|
Find the index of the first bit set. Note that bits are indexed from the end (see also read_bit
for more details).
Minimum Plutus Version | 1 |
---|
Access the byte at the given index in the bytearray.
Minimum Plutus Version | 1 |
---|
Number of bytes in a bytearray.
Minimum Plutus Version | 2 |
---|
Read a particular bit (True
if set) at the given index. Fails if the
index is out-of-bounds. Note that the index reads from the end. For
example, consider the byte 0xF4
and an index i
:
i=7 | i=6 | i=5 | i=4 | i=3 | i=2 | i=1 | i=0 |
---|---|---|---|---|---|---|---|
1 | 1 | 1 | 1 | 0 | 1 | 0 | 0 |
So, we have:
read_bit(#[0xF4], 0) == False
read_bit(#[0xF4], 1) == False
read_bit(#[0xF4], 2) == True
read_bit(#[0xF4], 3) == False
read_bit(#[0xF4], 4) == True
read_bit(#[0xF4], 5) == True
read_bit(#[0xF4], 6) == True
read_bit(#[0xF4], 7) == True
read_bit(#[0xF4, 0xF4], 8) == False
Minimum Plutus Version | 1 |
---|
Extract a sub-array from a bytearray given starting and length of the sub-array.
Comparing
Minimum Plutus Version 1
Bytearray equality.
Minimum Plutus Version 1
Bytearray strict inequality.
Minimum Plutus Version 1
Bytearray inequality.
Bitwise
Minimum Plutus Version 2
Logical AND applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical OR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical XOR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version 2
Logical bitwise complement of the bytearray (set becomes unset, and unset becomes set).
Shifting
Minimum Plutus Version 2
Like shift_bytearray
but instead of introducing zeroes in holes, use the bits that are dropped from either ends.
rotate_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x9D]
rotate_bytearray(#[0xEB, 0xFC], -8) == #[0xFC, 0xEB]
rotate_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0xEB]
Minimum Plutus Version 2
Shift bits in a ByteArray
by the given offset, replacing holes with zeroes. The offset can be positive (left-shift) or negative (right-shift).
shift_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x80]
shift_bytearray(#[0xEB, 0xFC], -8) == #[0x00, 0xEB]
shift_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0x00]
Transforming
Minimum Plutus Version 3
Convert a ByteArray to an integer value. The first argument
specifies the endianness:
boolean value endianness
True Big endian
False Little endian
String
Minimum Plutus Version 1
Concatenate two strings.
Minimum Plutus Version 1
Convert a string into a UTF-8 encoded array of bytes.
Minimum Plutus Version 1
Interpret a UTF-8 encoded array of bytes as a String. Fails if the bytes aren’t UTF-8 encoded.
List
Minimum Plutus Version 1
Push an element in front of a list.
Minimum Plutus Version 1
Select a branch to continue with depending on whether the list is empty or not.
Data
Minimum Plutus Version 1
Construct a Data
from a constructor index and a list of fields.
Minimum Plutus Version 1
Interpret a Data
as a constructor. Fails if it’s not a constructor.
Minimum Plutus Version 1
Interpret a Data
as a constructor and extract its fields. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version 1
Interpret a Data
as a constructor and extract its index. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version 1
Construct a Data
from a list of pairs.
Minimum Plutus Version 1
Interpret a Data
as a map. Fails if it’s not a map.
Minimum Plutus Version 1
Construct a Data
from a list of elements.
Minimum Plutus Version 1
Interpret a Data
as a list. Fails if it’s not a list.
Minimum Plutus Version 1
Interpret a Data
as a integer. Fails if it’s not an integer.
Minimum Plutus Version 1
Interpret a Data
as a bytearray. Fails if it’s not a bytearray.
Minimum Plutus Version 2
Serialise a Data to bytes, using CBOR.
choose_data(
data: Data,
when_constr: a,
when_map: a,
when_list: a,
when_int: a,
when_bytearray: a,
) -> a
Minimum Plutus Version 1
Select a branch to continue with based on what the Data actually is.
Pair
Minimum Plutus Version | 1 |
---|
Bytearray equality.
Minimum Plutus Version | 1 |
---|
Bytearray strict inequality.
Minimum Plutus Version | 1 |
---|
Bytearray inequality.
Minimum Plutus Version | 2 |
---|
Logical AND applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version | 2 |
---|
Logical OR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version | 2 |
---|
Logical XOR applied to two bytearrays. The first argument indicates whether padding semantics should be used. If this argument is False
, truncation semantics are used instead.
Minimum Plutus Version | 2 |
---|
Logical bitwise complement of the bytearray (set becomes unset, and unset becomes set).
Shifting
Minimum Plutus Version 2
Like shift_bytearray
but instead of introducing zeroes in holes, use the bits that are dropped from either ends.
rotate_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x9D]
rotate_bytearray(#[0xEB, 0xFC], -8) == #[0xFC, 0xEB]
rotate_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0xEB]
Minimum Plutus Version 2
Shift bits in a ByteArray
by the given offset, replacing holes with zeroes. The offset can be positive (left-shift) or negative (right-shift).
shift_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x80]
shift_bytearray(#[0xEB, 0xFC], -8) == #[0x00, 0xEB]
shift_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0x00]
Transforming
Minimum Plutus Version 3
Convert a ByteArray to an integer value. The first argument
specifies the endianness:
boolean value endianness
True Big endian
False Little endian
String
Minimum Plutus Version 1
Concatenate two strings.
Minimum Plutus Version 1
Convert a string into a UTF-8 encoded array of bytes.
Minimum Plutus Version 1
Interpret a UTF-8 encoded array of bytes as a String. Fails if the bytes aren’t UTF-8 encoded.
List
Minimum Plutus Version | 2 |
---|
Like shift_bytearray
but instead of introducing zeroes in holes, use the bits that are dropped from either ends.
rotate_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x9D]
rotate_bytearray(#[0xEB, 0xFC], -8) == #[0xFC, 0xEB]
rotate_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0xEB]
Minimum Plutus Version | 2 |
---|
Shift bits in a ByteArray
by the given offset, replacing holes with zeroes. The offset can be positive (left-shift) or negative (right-shift).
shift_bytearray(#[0xEB, 0xFC], 5) == #[0x7F, 0x80]
shift_bytearray(#[0xEB, 0xFC], -8) == #[0x00, 0xEB]
shift_bytearray(#[0xEB, 0xFC], 8) == #[0xFC, 0x00]
Minimum Plutus Version | 3 |
---|
Convert a ByteArray to an integer value. The first argument specifies the endianness:
boolean value | endianness |
---|---|
True | Big endian |
False | Little endian |
String
Minimum Plutus Version | 1 |
---|
Concatenate two strings.
Minimum Plutus Version | 1 |
---|
Convert a string into a UTF-8 encoded array of bytes.
Minimum Plutus Version | 1 |
---|
Interpret a UTF-8 encoded array of bytes as a String. Fails if the bytes aren’t UTF-8 encoded.
Minimum Plutus Version | 1 |
---|
Push an element in front of a list.
Minimum Plutus Version | 1 |
---|
Select a branch to continue with depending on whether the list is empty or not.
Data
Minimum Plutus Version | 1 |
---|
Construct a Data
from a constructor index and a list of fields.
Minimum Plutus Version | 1 |
---|
Interpret a Data
as a constructor. Fails if it’s not a constructor.
Minimum Plutus Version | 1 |
---|
Interpret a Data
as a constructor and extract its fields. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version | 1 |
---|
Interpret a Data
as a constructor and extract its index. Slightly more efficient than using un_constr_data
.
Minimum Plutus Version | 1 |
---|
Construct a Data
from a list of pairs.
Minimum Plutus Version | 1 |
---|
Interpret a Data
as a map. Fails if it’s not a map.
Minimum Plutus Version | 1 |
---|
Construct a Data
from a list of elements.
Minimum Plutus Version | 1 |
---|
Interpret a Data
as a list. Fails if it’s not a list.
Minimum Plutus Version | 1 |
---|
Interpret a Data
as a integer. Fails if it’s not an integer.
Minimum Plutus Version | 1 |
---|
Interpret a Data
as a bytearray. Fails if it’s not a bytearray.
Minimum Plutus Version | 2 |
---|
Serialise a Data to bytes, using CBOR.
choose_data(
data: Data,
when_constr: a,
when_map: a,
when_list: a,
when_int: a,
when_bytearray: a,
) -> a
Minimum Plutus Version | 1 |
---|
Select a branch to continue with based on what the Data actually is.
Minimum Plutus Version | 1 |
---|
Construct a Data from a pair of elements.
Crypto
Minimum Plutus Version | 1 |
---|
Calculate the blake2b-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version | 3 |
---|
Calculate the blake2b-224 hash digest value of a given bytearray. Output is always 28-byte long.
Minimum Plutus Version | 3 |
---|
Calculate the keccak-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version | 2 |
---|
Calculate the ripemd-160 hash digest value of a given bytearray. Output is always 20-byte long.
Minimum Plutus Version | 1 |
---|
Calculate the SHA2-256 hash digest value of a given bytearray. Output is always 32-byte long.
Minimum Plutus Version | 1 |
---|
Calculate the SHA3-256 hash digest value of a given bytearray. Output is always 32-byte long.
ECDSA
verify_ed25519_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 1
Verify an Ed25519 signature from a associated verification key.
verify_ecdsa_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 2
Verify an ECDSA-SECP256k1 signature from a associated verification key.
verify_schnorr_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version 2
Verify a SCHNORR-SECP256k1 signature from a associated verification key.
Pairing
Minimum Plutus Version 3
Minimum Plutus Version 3
Minimum Plutus Version 3
Miscellaneous
Minimum Plutus Version 1
Continue with the continuation when the given term is Void.
Minimum Plutus Version 1
Trace the provided message, and continue with the continuation.
verify_ed25519_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version | 1 |
---|
Verify an Ed25519 signature from a associated verification key.
verify_ecdsa_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version | 2 |
---|
Verify an ECDSA-SECP256k1 signature from a associated verification key.
verify_schnorr_secp256k1_signature(
verification_key: ByteArray,
message: ByteArray,
signature: ByteArray,
) -> ByteArray
Minimum Plutus Version | 2 |
---|
Verify a SCHNORR-SECP256k1 signature from a associated verification key.
Minimum Plutus Version | 3 |
---|
Minimum Plutus Version | 3 |
---|
Minimum Plutus Version | 3 |
---|
Miscellaneous
Minimum Plutus Version | 1 |
---|
Continue with the continuation when the given term is Void.
Minimum Plutus Version | 1 |
---|
Trace the provided message, and continue with the continuation.