plutus-tx
Safe HaskellNone
LanguageHaskell2010

PlutusTx.Builtins.Internal

Description

This module contains the special Haskell names that are used to map to builtin types or functions in Plutus Core.

Most users should not use this module directly, but rather use Builtins.

Please note that the documentation for each function will only include operational invariants if there are any. This documentation assumes that the type system correctly enforces and prevents any structural errors on the generated UPLC. See Note [Structural vs operational errors within builtins].

Also note that all builtin functions will fail if the CEK machine exceeds its evaluation budget. Builtin functions with dynamic costing are particularly prone to budget overruns: for example, addInteger and appendByteString differ cost based on input size, so supplying very large integers or byte strings will cause these functions to abort when the budget limit is reached and fail. See Note [Budgeting].

Synopsis

Documentation

ifThenElse :: Bool -> a -> a -> a Source #

data BuiltinUnit Source #

Constructors

BuiltinUnit ~() 

Instances

Instances details
Data BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinUnit -> c BuiltinUnit Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinUnit Source #

toConstr :: BuiltinUnit -> Constr Source #

dataTypeOf :: BuiltinUnit -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinUnit) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinUnit) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinUnit -> BuiltinUnit Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinUnit -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinUnit -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinUnit -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinUnit -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinUnit -> m BuiltinUnit Source #

HasBlueprintDefinition BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinUnit 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

HasFromBuiltin BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinUnit 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

HasBlueprintSchema BuiltinUnit referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinUnit () Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Methods

fromOpaque :: BuiltinUnit -> () Source #

HasToOpaque () BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Methods

toOpaque :: () -> BuiltinUnit Source #

HasTermLevel uni () => Lift uni BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinUnit -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni () => Typeable uni BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinUnit -> RTCompile uni fun (Type TyName uni ()) Source #

type Unroll BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinUnit Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

addInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Adds two integers and never fails.

subtractInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Subtracts two integers and never fails.

multiplyInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Multiplies two integers and never fails.

divideInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Finds the quotient of two integers and fails when the second argument, the divisor, is zero. See Note [Integer division operations] for explanation on divideInteger, modInteger, quotientInteger, and remainderInteger.

modInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Finds the remainder of two integers and fails when the second argument, the divisor, is zero.

quotientInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Finds the quotient of two integers and fails when the second argument, the divisor, is zero.

remainderInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Finds the remainder of two integers and fails when the second argument, the divisor, is zero.

lessThanInteger :: BuiltinInteger -> BuiltinInteger -> Bool Source #

Compares two integers and returns true when the first argument is less than the second | argument.

lessThanEqualsInteger :: BuiltinInteger -> BuiltinInteger -> Bool Source #

Compares two integers and returns true when the first argument is less or equal to than the | second argument.

equalsInteger :: BuiltinInteger -> BuiltinInteger -> Bool Source #

Checks equality of two integers and never fails.

data BuiltinByteString Source #

An opaque type representing Plutus Core ByteStrings.

Instances

Instances details
Data BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinByteString -> c BuiltinByteString Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinByteString Source #

toConstr :: BuiltinByteString -> Constr Source #

dataTypeOf :: BuiltinByteString -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinByteString) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinByteString) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinByteString -> BuiltinByteString Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinByteString -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinByteString -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinByteString -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinByteString -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinByteString -> m BuiltinByteString Source #

IsString BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Monoid BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Semigroup BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Show BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

rnf :: BuiltinByteString -> () Source #

Eq BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Hashable BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

ByteArray BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

allocRet :: Int -> (Ptr p -> IO a) -> IO (a, BuiltinByteString)

ByteArrayAccess BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasBlueprintDefinition BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

HasFromBuiltin BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

MkNil BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Eq BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Eq.Class

FromData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinByteString Source # 
Instance details

Defined in PlutusTx.IsData.Class

Monoid BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Monoid

Ord BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Ord.Class

Semigroup BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Semigroup

Show BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Show

Pretty BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

pretty :: BuiltinByteString -> Doc ann

prettyList :: [BuiltinByteString] -> Doc ann

Serialise BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

encode :: BuiltinByteString -> Encoding

decode :: Decoder s BuiltinByteString

encodeList :: [BuiltinByteString] -> Encoding

decodeList :: Decoder s [BuiltinByteString]

HasBlueprintSchema BuiltinByteString referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinByteString BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinByteString BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni ByteString => Lift uni BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinByteString -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni ByteString => Typeable uni BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinByteString -> RTCompile uni fun (Type TyName uni ()) Source #

type Unroll BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinByteString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

appendByteString :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #

Appends a bytestring to another and never fails.

consByteString :: BuiltinInteger -> BuiltinByteString -> BuiltinByteString Source #

Appends a byte to the given bytestring. The semantics of this function differ based on [Builtin semantics variants]. - For builtin semantics variant A and B, that is for PlutusV1 and PlutusV2, this reduces the first argument modulo 256 and will never fail. - For builtin semantics variant C, that is for PlutusV3, this will expect first argument to be in range [0..255] and fail otherwise.

sliceByteString :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString -> BuiltinByteString Source #

Slices the given bytestring and never fails. The first integer marks the beginning index and the second marks the end. Indices are expected to be 0-indexed, and when the first integer is greater than the second, it returns an empty bytestring.

lengthOfByteString :: BuiltinByteString -> BuiltinInteger Source #

Returns the length of the provided bytestring.

indexByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinInteger Source #

Returns the n-th byte from the bytestring. Fails if the given index is not in the range [0..j), where j is the length of the bytestring.

emptyByteString :: BuiltinByteString Source #

An empty bytestring.

sha2_256 :: BuiltinByteString -> BuiltinByteString Source #

Computes the SHA2-256 hash of the given bytestring.

sha3_256 :: BuiltinByteString -> BuiltinByteString Source #

Computes the SHA3-256 hash of the given bytestring.

blake2b_224 :: BuiltinByteString -> BuiltinByteString Source #

Computes the Blake2b-224 hash of the given bytestring.

blake2b_256 :: BuiltinByteString -> BuiltinByteString Source #

Computes the Blake2b-256 hash of the given bytestring.

keccak_256 :: BuiltinByteString -> BuiltinByteString Source #

Computes the Keccak-256 hash of the given bytestring.

ripemd_160 :: BuiltinByteString -> BuiltinByteString Source #

Computes the RIPEMD-160 hash of the given bytestring.

verifyEd25519Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool Source #

Ed25519 signature verification. The first bytestring is the public key (32 bytes), followed by an arbitrary-size message and the signature (64 bytes). The sizes of the public key and signature are enforced, and it fails when given bytestrings of incorrect size.

verifyEcdsaSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool Source #

ECDSA signature verification on the SECP256k1 curve. The first bytestring is the public key (33 bytes), followed by the message hash (32 bytes) and the signature (64 bytes). The sizes of the public key and signature are enforced, and it fails when given bytestrings of incorrect size.

verifySchnorrSecp256k1Signature :: BuiltinByteString -> BuiltinByteString -> BuiltinByteString -> Bool Source #

Schnorr signature verification on the SECP256k1 curve. The first bytestring is the public key (32 bytes), followed by an arbitrary-length message and the signature (64 bytes). The sizes of the public key and signature are enforced, and it fails when given bytestrings of incorrect size.

traceAll :: forall a f. Foldable f => f Text -> a -> a Source #

Runs trace for each element in a foldable structure.

equalsByteString :: BuiltinByteString -> BuiltinByteString -> Bool Source #

Checks the equality of two bytestrings and never fails

lessThanByteString :: BuiltinByteString -> BuiltinByteString -> Bool Source #

Checks if the first bytestring is less than the second bytestring and never fails. Comparison of the bytestrings will behave identically to the compare implementation in Ord. It will compare two bytestrings byte by byte—lexicographical ordering.

lessThanEqualsByteString :: BuiltinByteString -> BuiltinByteString -> Bool Source #

Checks if the first bytestring is less than or equal to the second bytestring and never fails.

decodeUtf8 :: BuiltinByteString -> BuiltinString Source #

Decodes the given bytestring to a string and fails when the given bytestring is not a valid UTF-8 bytestring.

data BuiltinString Source #

Constructors

BuiltinString ~Text 

Instances

Instances details
Data BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinString -> c BuiltinString Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinString Source #

toConstr :: BuiltinString -> Constr Source #

dataTypeOf :: BuiltinString -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinString) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinString) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinString -> BuiltinString Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinString -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinString -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinString -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinString -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinString -> m BuiltinString Source #

IsString BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Show BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasBlueprintDefinition BuiltinString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinString 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

HasFromBuiltin BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinString 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Eq BuiltinString Source # 
Instance details

Defined in PlutusTx.Eq.Class

Monoid BuiltinString Source # 
Instance details

Defined in PlutusTx.Monoid

Semigroup BuiltinString Source # 
Instance details

Defined in PlutusTx.Semigroup

Show BuiltinString Source # 
Instance details

Defined in PlutusTx.Show

HasBlueprintSchema BuiltinString referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinString BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinString BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Text => Lift uni BuiltinString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinString -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Text => Typeable uni BuiltinString Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinString -> RTCompile uni fun (Type TyName uni ()) Source #

type Unroll BuiltinString Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinString Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

appendString :: BuiltinString -> BuiltinString -> BuiltinString Source #

Appends a string to another and never fails.

emptyString :: BuiltinString Source #

An empty string.

equalsString :: BuiltinString -> BuiltinString -> Bool Source #

Checks the equality of two strings and never fails.

trace :: BuiltinString -> a -> a Source #

Emits a trace message and never fails.

encodeUtf8 :: BuiltinString -> BuiltinByteString Source #

Encodes a string into a bytestring and never fails.

data BuiltinPair a b Source #

Constructors

BuiltinPair ~(a, b) 

Instances

Instances details
(HasFromBuiltin arep, HasFromBuiltin brep, HasTermLevel uni (FromBuiltin arep, FromBuiltin brep)) => Lift uni (BuiltinPair arep brep) Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinPair arep brep -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

(Data a, Data b) => Data (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b0. Data d => c (d -> b0) -> d -> c b0) -> (forall g. g -> c g) -> BuiltinPair a b -> c (BuiltinPair a b) Source #

gunfold :: (forall b0 r. Data b0 => c (b0 -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinPair a b) Source #

toConstr :: BuiltinPair a b -> Constr Source #

dataTypeOf :: BuiltinPair a b -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinPair a b)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinPair a b)) Source #

gmapT :: (forall b0. Data b0 => b0 -> b0) -> BuiltinPair a b -> BuiltinPair a b Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinPair a b -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinPair a b -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinPair a b -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinPair a b -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinPair a b -> m (BuiltinPair a b) Source #

(Show a, Show b) => Show (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

(Eq a, Eq b) => Eq (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

(==) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source #

(/=) :: BuiltinPair a b -> BuiltinPair a b -> Bool Source #

(Ord a, Ord b) => Ord (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

(HasBlueprintDefinition a, HasBlueprintDefinition b) => HasBlueprintDefinition (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll (BuiltinPair a b) 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

(HasFromBuiltin a, HasFromBuiltin b) => HasFromBuiltin (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin (BuiltinPair a b) 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

(MkNil a, MkNil b) => MkNil (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

(HasBlueprintSchema a referencedTypes, HasBlueprintSchema b referencedTypes) => HasBlueprintSchema (BuiltinPair a b) referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasTypeLevel uni (,) => Typeable uni BuiltinPair Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinPair -> RTCompile uni fun (Type TyName uni ()) Source #

(HasFromOpaque arep a, HasFromOpaque brep b) => HasFromOpaque (BuiltinPair arep brep) (a, b) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Methods

fromOpaque :: BuiltinPair arep brep -> (a, b) Source #

HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

type Unroll (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin (BuiltinPair a b) Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

fst :: BuiltinPair a b -> a Source #

Takes first value from the tuple and never fails.

snd :: BuiltinPair a b -> b Source #

Takes second value from the tuple and never fails.

mkPairData :: BuiltinData -> BuiltinData -> BuiltinPair BuiltinData BuiltinData Source #

Constructs tuple from two builtin data.

data BuiltinList a Source #

Constructors

BuiltinList ~[a] 

Instances

Instances details
(HasFromBuiltin arep, HasTermLevel uni [FromBuiltin arep]) => Lift uni (BuiltinList arep) Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinList arep -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

Data a => Data (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinList a -> c (BuiltinList a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinList a) Source #

toConstr :: BuiltinList a -> Constr Source #

dataTypeOf :: BuiltinList a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinList a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinList a)) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinList a -> BuiltinList a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinList a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinList a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinList a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinList a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinList a -> m (BuiltinList a) Source #

Show a => Show (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq a => Eq (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord a => Ord (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasBlueprintDefinition a => HasBlueprintDefinition (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll (BuiltinList a) 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

HasFromBuiltin a => HasFromBuiltin (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin (BuiltinList a) 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

MkNil a => MkNil (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasBlueprintSchema a referencedTypes => HasBlueprintSchema (BuiltinList a) referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque arep a => HasFromOpaque (BuiltinList arep) [a] Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Methods

fromOpaque :: BuiltinList arep -> [a] Source #

(HasToOpaque a arep, MkNil arep) => HasToOpaque [a] (BuiltinList arep) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Methods

toOpaque :: [a] -> BuiltinList arep Source #

HasTypeLevel uni [] => Typeable uni BuiltinList Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinList -> RTCompile uni fun (Type TyName uni ()) Source #

type Unroll (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin (BuiltinList a) Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

null :: BuiltinList a -> Bool Source #

Checks if the given list is empty.

head :: BuiltinList a -> a Source #

Takes the first element of the list and fails if given list is empty.

tail :: BuiltinList a -> BuiltinList a Source #

Takes the last element of the list and fails if given list is empty.

chooseList :: BuiltinList a -> b -> b -> b Source #

Branches out depending on the structure of given list and never fails. If given list is empty, it will take the first branch and if not it will take the second branch.

caseList' :: forall a r. r -> (a -> BuiltinList a -> r) -> BuiltinList a -> r Source #

Similar to chooseList but deconstructs the list in case provided list is not empty.

unsafeCaseList :: (a -> BuiltinList a -> r) -> BuiltinList a -> r Source #

Similar to caseList', but empty list case is omitted so passing empty list will raise error

drop :: Integer -> BuiltinList a -> BuiltinList a Source #

Drops first n elements from the given list and never fails.

mkNilData :: BuiltinUnit -> BuiltinList BuiltinData Source #

Creates an empty data list and never fails. Prefer using constant. See Note [Constants vs built-in functions]

mkNilPairData :: BuiltinUnit -> BuiltinList (BuiltinPair BuiltinData BuiltinData) Source #

Creates an empty data pair list and never fails. Prefer using constant. See Note [Constants vs built-in functions]

mkCons :: a -> BuiltinList a -> BuiltinList a Source #

Appends a new element to the given list and never fails.

data BuiltinData Source #

A type corresponding to the Plutus Core builtin equivalent of Data.

The point of this type is to be an opaque equivalent of Data, so as to ensure that it is only used in ways that the compiler can handle.

As such, you should use this type in your on-chain code, and in any data structures that you want to be representable on-chain.

For off-chain usage, there are conversion functions builtinDataToData and dataToBuiltinData, but note that these will not work on-chain.

Constructors

BuiltinData ~Data 

Instances

Instances details
Data BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinData -> c BuiltinData Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c BuiltinData Source #

toConstr :: BuiltinData -> Constr Source #

dataTypeOf :: BuiltinData -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c BuiltinData) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c BuiltinData) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinData -> BuiltinData Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinData -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinData -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinData -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinData -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinData -> m BuiltinData Source #

Generic BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Associated Types

type Rep BuiltinData 
Instance details

Defined in PlutusTx.Builtins.Internal

type Rep BuiltinData = D1 ('MetaData "BuiltinData" "PlutusTx.Builtins.Internal" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" 'False) (C1 ('MetaCons "BuiltinData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Data)))
Show BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

rnf :: BuiltinData -> () Source #

Eq BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasBlueprintDefinition BuiltinData Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

Associated Types

type Unroll BuiltinData 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

HasFromBuiltin BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinData 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

MkNil BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Eq BuiltinData Source # 
Instance details

Defined in PlutusTx.Eq.Class

FromData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinData Source # 
Instance details

Defined in PlutusTx.IsData.Class

Show BuiltinData Source # 
Instance details

Defined in PlutusTx.Show

Pretty BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

pretty :: BuiltinData -> Doc ann

prettyList :: [BuiltinData] -> Doc ann

HasBlueprintSchema BuiltinData referencedTypes Source # 
Instance details

Defined in PlutusTx.Blueprint.Class

Methods

schema :: Schema referencedTypes Source #

HasFromOpaque BuiltinData BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinData BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Data => Lift uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinData -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Data => Typeable uni BuiltinData Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinData -> RTCompile uni fun (Type TyName uni ()) Source #

HasToOpaque (BuiltinData, BuiltinData) (BuiltinPair BuiltinData BuiltinData) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

type Rep BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

type Rep BuiltinData = D1 ('MetaData "BuiltinData" "PlutusTx.Builtins.Internal" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" 'False) (C1 ('MetaCons "BuiltinData" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Data)))
type Unroll BuiltinData Source # 
Instance details

Defined in PlutusTx.Blueprint.Definition.Unroll

type FromBuiltin BuiltinData Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

builtinDataToData :: BuiltinData -> Data Source #

NOT a builtin. Converts a BuiltinData into a Data. Only works off-chain.

dataToBuiltinData :: Data -> BuiltinData Source #

NOT a builtin. Converts a Data into a BuiltinData. Only works off-chain.

chooseData :: BuiltinData -> a -> a -> a -> a -> a -> a Source #

Branches out depending on the structure of given data and never fails.

mkConstr :: BuiltinInteger -> BuiltinList BuiltinData -> BuiltinData Source #

Creates Constr data value with the given index and elements; never fails.

mkMap :: BuiltinList (BuiltinPair BuiltinData BuiltinData) -> BuiltinData Source #

Creates Map data value with the given list of pairs and never fails.

mkList :: BuiltinList BuiltinData -> BuiltinData Source #

Creates List data value with the given list and never fails.

mkI :: BuiltinInteger -> BuiltinData Source #

Creates I data value with the given integer and never fails.

mkB :: BuiltinByteString -> BuiltinData Source #

Creates B data value with the given bytestring and never fails.

unsafeDataAsConstr :: BuiltinData -> BuiltinPair BuiltinInteger (BuiltinList BuiltinData) Source #

Deconstructs the given data as a Constr, failing if it is not a Constr.

unsafeDataAsMap :: BuiltinData -> BuiltinList (BuiltinPair BuiltinData BuiltinData) Source #

Deconstructs the given data as a Map, failing if it is not a Map.

unsafeDataAsList :: BuiltinData -> BuiltinList BuiltinData Source #

Deconstructs the given data as a List, failing if it is not a List.

unsafeDataAsI :: BuiltinData -> BuiltinInteger Source #

Deconstructs the given data as a I, failing if it is not a I.

unsafeDataAsB :: BuiltinData -> BuiltinByteString Source #

Deconstructs the given data as a B, failing if it is not a B.

equalsData :: BuiltinData -> BuiltinData -> Bool Source #

Checks equality of two data and never fails.

serialiseData :: BuiltinData -> BuiltinByteString Source #

Serialize the given data into CBOR bytestring. See Data for exact encoder as Data does not uses Generic version.

data BuiltinValue Source #

Constructors

BuiltinValue ~Value 

Instances

Instances details
Generic BuiltinValue Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Associated Types

type Rep BuiltinValue 
Instance details

Defined in PlutusTx.Builtins.Internal

type Rep BuiltinValue = D1 ('MetaData "BuiltinValue" "PlutusTx.Builtins.Internal" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" 'False) (C1 ('MetaCons "BuiltinValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Value)))
HasFromBuiltin BuiltinValue Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinValue 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

MkNil BuiltinValue Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasFromOpaque BuiltinValue BuiltinValue Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinValue BuiltinValue Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Value => Lift uni BuiltinValue Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinValue -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Value => Typeable uni BuiltinValue Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinValue -> RTCompile uni fun (Type TyName uni ()) Source #

type Rep BuiltinValue Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

type Rep BuiltinValue = D1 ('MetaData "BuiltinValue" "PlutusTx.Builtins.Internal" "plutus-tx-1.60.0.0-2VI8qZOpowK2Zo3DTnqORk" 'False) (C1 ('MetaCons "BuiltinValue" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'SourceLazy 'DecidedLazy) (Rec0 Value)))
type FromBuiltin BuiltinValue Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

data BuiltinArray a Source #

Constructors

BuiltinArray ~(Vector a) 

Instances

Instances details
(HasFromBuiltin arep, HasTermLevel uni (Vector (FromBuiltin arep))) => Lift uni (BuiltinArray arep) Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinArray arep -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

Data a => Data (BuiltinArray a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Methods

gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b) -> (forall g. g -> c g) -> BuiltinArray a -> c (BuiltinArray a) Source #

gunfold :: (forall b r. Data b => c (b -> r) -> c r) -> (forall r. r -> c r) -> Constr -> c (BuiltinArray a) Source #

toConstr :: BuiltinArray a -> Constr Source #

dataTypeOf :: BuiltinArray a -> DataType Source #

dataCast1 :: Typeable t => (forall d. Data d => c (t d)) -> Maybe (c (BuiltinArray a)) Source #

dataCast2 :: Typeable t => (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c (BuiltinArray a)) Source #

gmapT :: (forall b. Data b => b -> b) -> BuiltinArray a -> BuiltinArray a Source #

gmapQl :: (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinArray a -> r Source #

gmapQr :: forall r r'. (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> BuiltinArray a -> r Source #

gmapQ :: (forall d. Data d => d -> u) -> BuiltinArray a -> [u] Source #

gmapQi :: Int -> (forall d. Data d => d -> u) -> BuiltinArray a -> u Source #

gmapM :: Monad m => (forall d. Data d => d -> m d) -> BuiltinArray a -> m (BuiltinArray a) Source #

gmapMp :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinArray a -> m (BuiltinArray a) Source #

gmapMo :: MonadPlus m => (forall d. Data d => d -> m d) -> BuiltinArray a -> m (BuiltinArray a) Source #

Show a => Show (BuiltinArray a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq a => Eq (BuiltinArray a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Ord a => Ord (BuiltinArray a) Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin a => HasFromBuiltin (BuiltinArray a) Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin (BuiltinArray a) 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

type FromBuiltin (BuiltinArray a) = Vector (FromBuiltin a)
MkNil a => MkNil (BuiltinArray a) Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTypeLevel uni Vector => Typeable uni BuiltinArray Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinArray -> RTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin (BuiltinArray a) Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

type FromBuiltin (BuiltinArray a) = Vector (FromBuiltin a)

lengthOfArray :: BuiltinArray a -> BuiltinInteger Source #

Returns the length of the provided array and never fails

listToArray :: BuiltinList a -> BuiltinArray a Source #

Converts given list into array and never fails.

indexArray :: BuiltinArray a -> BuiltinInteger -> a Source #

Returns the n-th element from the array. Fails if the given index is not in the range [0..j), where j is the length of the array.

data BuiltinBLS12_381_G1_Element Source #

Constructors

BuiltinBLS12_381_G1_Element ~Element 

Instances

Instances details
Show BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

MkNil BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Eq BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Eq.Class

FromData BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinBLS12_381_G1_Element Source #

For the BLS12-381 G1 and G2 types we use the compress functions to convert to a ByteString and then encode that as Data as usual. We have to be more careful going the other way because we decode a Data object to (possibly) get a BuiltinByteString and then uncompress the underlying ByteString to get a group element. However uncompression can fail so we have to check what happens: we don't use bls12_381_G?_uncompress because that invokes error if something goes wrong (but we do use it for unsafeFromData).

Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

Pretty BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinBLS12_381_G1_Element BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinBLS12_381_G1_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinBLS12_381_G1_Element -> RTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin BuiltinBLS12_381_G1_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

bls12_381_G1_equals :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element -> Bool Source #

Checks equality of two G1 elements and never fails.

bls12_381_G1_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G1_Element Source #

Multiplies a G1 element by a scalar and never fails.

bls12_381_G1_compress :: BuiltinBLS12_381_G1_Element -> BuiltinByteString Source #

Compresses a G1 element to a bytestring and never fails.

bls12_381_G1_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G1_Element Source #

Uncompresses a bytestring to a G1 element, failing if the bytestring is not a valid compressed G1 element.

bls12_381_G1_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G1_Element Source #

Hashes an arbitrary bytestring message to a G1 element using the given domain separation tag (DST), failing if length of the DST is bigger than 255 bytes.

bls12_381_G1_compressed_zero :: BuiltinByteString Source #

The compressed form of the G1 identity element.

bls12_381_G1_compressed_generator :: BuiltinByteString Source #

The compressed form of the G1 generator element.

data BuiltinBLS12_381_G2_Element Source #

Constructors

BuiltinBLS12_381_G2_Element ~Element 

Instances

Instances details
Show BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

MkNil BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

Eq BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Eq.Class

FromData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

ToData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

UnsafeFromData BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.IsData.Class

Pretty BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinBLS12_381_G2_Element BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni Element => Lift uni BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinBLS12_381_G2_Element -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni Element => Typeable uni BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinBLS12_381_G2_Element -> RTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin BuiltinBLS12_381_G2_Element Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

bls12_381_G2_equals :: BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element -> Bool Source #

Checks equality of two G2 elements and never fails.

bls12_381_G2_scalarMul :: BuiltinInteger -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_G2_Element Source #

Multiplies a G2 element by a scalar and never fails.

bls12_381_G2_compress :: BuiltinBLS12_381_G2_Element -> BuiltinByteString Source #

Compresses a G2 element to a bytestring and never fails.

bls12_381_G2_uncompress :: BuiltinByteString -> BuiltinBLS12_381_G2_Element Source #

Uncompresses a bytestring to a G2 element, failing if the bytestring is not a valid compressed G2 element.

bls12_381_G2_hashToGroup :: BuiltinByteString -> BuiltinByteString -> BuiltinBLS12_381_G2_Element Source #

Hashes an arbitrary bytestring message to a G2 element using the given domain separation tag (DST), failing if length of the DST is bigger than 255 bytes.

bls12_381_G2_compressed_zero :: BuiltinByteString Source #

The compressed form of the G2 identity element (also known as zero or point at infinity).

bls12_381_G2_compressed_generator :: BuiltinByteString Source #

The compressed form of the G2 generator element.

data BuiltinBLS12_381_MlResult Source #

Constructors

BuiltinBLS12_381_MlResult ~MlResult 

Instances

Instances details
Show BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

NFData BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

Eq BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromBuiltin BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

Associated Types

type FromBuiltin BuiltinBLS12_381_MlResult 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

(TypeError ('Text "fromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => FromData BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "toBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => ToData BuiltinBLS12_381_MlResult Source #

We do not provide instances of any of these classes for BuiltinBLS12_381_MlResult since there is no serialisation format: we expect that values of that type will only occur as the result of on-chain computations.

Instance details

Defined in PlutusTx.IsData.Class

(TypeError ('Text "unsafeFromBuiltinData is not supported for BuiltinBLS12_381_MlResult") :: Constraint) => UnsafeFromData BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.IsData.Class

Pretty BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.Internal

HasFromOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasToOpaque BuiltinBLS12_381_MlResult BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasOpaque

HasTermLevel uni MlResult => Lift uni BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

lift :: BuiltinBLS12_381_MlResult -> RTCompile uni fun (Term TyName Name uni fun ()) Source #

HasTypeLevel uni MlResult => Typeable uni BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Lift.Class

Methods

typeRep :: Proxy BuiltinBLS12_381_MlResult -> RTCompile uni fun (Type TyName uni ()) Source #

type FromBuiltin BuiltinBLS12_381_MlResult Source # 
Instance details

Defined in PlutusTx.Builtins.HasBuiltin

bls12_381_millerLoop :: BuiltinBLS12_381_G1_Element -> BuiltinBLS12_381_G2_Element -> BuiltinBLS12_381_MlResult Source #

Computes the Miller loop between a G1 element and a G2 element and never fails.

bls12_381_finalVerify :: BuiltinBLS12_381_MlResult -> BuiltinBLS12_381_MlResult -> Bool Source #

Performs the final verification step of a pairing check. Returns true if e(P,Q) == e(R,S) for the given Miller loop results, and never fails.

integerToByteString :: Bool -> BuiltinInteger -> BuiltinInteger -> BuiltinByteString Source #

Converts the given integer to a bytestring. The first argument specifies endianness (True for big-endian), followed by the target length of the resulting bytestring and the integer itself. Fails if the target length is greater than 8192 or if the length argument is 0 and the result won't fit into 8192 bytes. See integerToByteString for its invariants in detail.

byteStringToInteger :: Bool -> BuiltinByteString -> BuiltinInteger Source #

Converts the given bytestring to the integer and never fails. The first argument specifies endianness (True for big-endian), followed by the bytestring.

shiftByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString Source #

Shifts the bytestring to the left if the second argument is positive, and to the right otherwise. Right-shifts fill with 0s from the left (logical shift); left-shifts fill with 0s from the right. Never fails.

rotateByteString :: BuiltinByteString -> BuiltinInteger -> BuiltinByteString Source #

Rotates the bytestring to the left if the second argument is positive, and to the right otherwise. Never fails.

countSetBits :: BuiltinByteString -> BuiltinInteger Source #

Counts the number of bits set to 1 in the bytestring and never fails.

findFirstSetBit :: BuiltinByteString -> BuiltinInteger Source #

Finds the index of the first bit set to 1 in the bytestring. If the bytestring consists only of 0s, it returns the length of the bytestring in bits. Never fails.

andByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #

Performs a bitwise AND on two bytestrings. The first boolean argument indicates whether to use padding (True) or truncation (False) if the bytestrings have different lengths. Never fails.

orByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #

Performs a bitwise OR on two bytestrings. The first boolean argument indicates whether to use padding (True) or truncation (False) if the bytestrings have different lengths. Never fails.

xorByteString :: Bool -> BuiltinByteString -> BuiltinByteString -> BuiltinByteString Source #

Performs a bitwise XOR on two bytestrings. The first boolean argument indicates whether to use padding (True) or truncation (False) if the bytestrings have different lengths. Never fails.

complementByteString :: BuiltinByteString -> BuiltinByteString Source #

Performs a bitwise complement on the bytestring and never fails.

readBit :: BuiltinByteString -> BuiltinInteger -> Bool Source #

Reads the bit at the given index in the bytestring. Fails if the index is out of bounds.

writeBits :: BuiltinByteString -> BuiltinList BuiltinInteger -> Bool -> BuiltinByteString Source #

Writes the given bit (third argument, True for 1, False for 0) at the specified indices (second argument) in the bytestring. Fails if any index is out of bounds.

replicateByte :: BuiltinInteger -> BuiltinInteger -> BuiltinByteString Source #

Creates a bytestring of a given length by repeating the given byte. Fails if the byte, second argument, is not in range [0,255], the length is negative, or when the length is greater than 8192.

expModInteger :: BuiltinInteger -> BuiltinInteger -> BuiltinInteger -> BuiltinInteger Source #

Computes modular exponentiation (base^exponent mod modulus). Fails if the modulus is zero or negative, or if the exponent is negative and the modular inverse does not exist.

caseInteger :: Integer -> [a] -> a Source #

casePair :: BuiltinPair a b -> (a -> b -> r) -> r Source #

Case matching on a builtin pair. Continuation is needed here to make it more efficient on builtin-casing implementation.