plutus-contract-1.2.0.0
Safe HaskellNone
LanguageHaskell2010

Plutus.Contract.Secrets

Synopsis

Documentation

data Secret a Source #

A secret value. A value of type `Secret a` can't leak onto the blockchain in plain-text unless you use an unsafe function. However, a value of type `Secret a` can end up on the blockchain via one of the escape hatches like escape_sha2_256.

Instances

Instances details
Monad Secret Source # 
Instance details

Defined in Plutus.Contract.Secrets

Methods

(>>=) :: Secret a -> (a -> Secret b) -> Secret b Source #

(>>) :: Secret a -> Secret b -> Secret b Source #

return :: a -> Secret a Source #

Functor Secret Source # 
Instance details

Defined in Plutus.Contract.Secrets

Methods

fmap :: (a -> b) -> Secret a -> Secret b Source #

(<$) :: a -> Secret b -> Secret a Source #

Applicative Secret Source # 
Instance details

Defined in Plutus.Contract.Secrets

Methods

pure :: a -> Secret a Source #

(<*>) :: Secret (a -> b) -> Secret a -> Secret b Source #

liftA2 :: (a -> b -> c) -> Secret a -> Secret b -> Secret c Source #

(*>) :: Secret a -> Secret b -> Secret b Source #

(<*) :: Secret a -> Secret b -> Secret a Source #

Applicative Secret Source # 
Instance details

Defined in Plutus.Contract.Secrets

Methods

pure :: a -> Secret a

(<*>) :: Secret (a -> b) -> Secret a -> Secret b

Functor Secret Source # 
Instance details

Defined in Plutus.Contract.Secrets

Methods

fmap :: (a -> b) -> Secret a -> Secret b

Show (Secret a) Source # 
Instance details

Defined in Plutus.Contract.Secrets

IsString s => IsString (Secret s) Source # 
Instance details

Defined in Plutus.Contract.Secrets

data SecretArgument a Source #

Secret argments are provided in the endpoint argument types.

This type guarantees that a `SecretArgument a` that is seen by the endpoint code is a `Secret a` in a way that can not be bypassed by safe code.

Constructors

UserSide a 
EndpointSide (Secret a) 

Instances

Instances details
Show a => Show (SecretArgument a) Source # 
Instance details

Defined in Plutus.Contract.Secrets

IsString s => IsString (SecretArgument s) Source # 
Instance details

Defined in Plutus.Contract.Secrets

FromJSON a => FromJSON (SecretArgument a) Source # 
Instance details

Defined in Plutus.Contract.Secrets

Methods

parseJSON :: Value -> Parser (SecretArgument a)

parseJSONList :: Value -> Parser [SecretArgument a]

ToJSON a => ToJSON (SecretArgument a) Source # 
Instance details

Defined in Plutus.Contract.Secrets

Methods

toJSON :: SecretArgument a -> Value

toEncoding :: SecretArgument a -> Encoding

toJSONList :: [SecretArgument a] -> Value

toEncodingList :: [SecretArgument a] -> Encoding

mkSecret :: a -> Secret a Source #

Turn a public value into a secret value

secretArg :: a -> SecretArgument a Source #

Construct a secret argument

extractSecret :: SecretArgument a -> Secret a Source #

Extract a secret value from a secret argument

escape_sha2_256 :: Secret BuiltinByteString -> BuiltinByteString Source #

Take the sha2_256 hash of a secret value. The result of this function can be used on the blockchain.

unsafe_escape_secret :: Secret a -> a Source #

Warning: [Requires Review] An escape hatch is being created. This should only be used in trusted code.