plutus-ledger-1.2.0.0: Wallet API
Safe HaskellNone
LanguageHaskell2010

Ledger.Crypto

Synopsis

Documentation

newtype PubKey Source #

Constructors

PubKey 

Fields

Instances

Instances details
Eq PubKey Source # 
Instance details

Defined in Ledger.Crypto

Ord PubKey Source # 
Instance details

Defined in Ledger.Crypto

Show PubKey Source # 
Instance details

Defined in Ledger.Crypto

IsString PubKey Source # 
Instance details

Defined in Ledger.Crypto

Generic PubKey Source # 
Instance details

Defined in Ledger.Crypto

Associated Types

type Rep PubKey :: Type -> Type Source #

Serialise PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

encode :: PubKey -> Encoding

decode :: Decoder s PubKey

encodeList :: [PubKey] -> Encoding

decodeList :: Decoder s [PubKey]

FromJSON PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

parseJSON :: Value -> Parser PubKey

parseJSONList :: Value -> Parser [PubKey]

FromJSONKey PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

fromJSONKey :: FromJSONKeyFunction PubKey

fromJSONKeyList :: FromJSONKeyFunction [PubKey]

ToJSON PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

toJSON :: PubKey -> Value

toEncoding :: PubKey -> Encoding

toJSONList :: [PubKey] -> Value

toEncodingList :: [PubKey] -> Encoding

ToJSONKey PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

toJSONKey :: ToJSONKeyFunction PubKey

toJSONKeyList :: ToJSONKeyFunction [PubKey]

Eq PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

(==) :: PubKey -> PubKey -> Bool

Ord PubKey Source # 
Instance details

Defined in Ledger.Crypto

Pretty PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

pretty :: PubKey -> Doc ann #

prettyList :: [PubKey] -> Doc ann #

FromData PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

fromBuiltinData :: BuiltinData -> Maybe PubKey

ToData PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

toBuiltinData :: PubKey -> BuiltinData

UnsafeFromData PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

unsafeFromBuiltinData :: BuiltinData -> PubKey

Newtype PubKey Source # 
Instance details

Defined in Ledger.Crypto

Associated Types

type O PubKey

Methods

pack :: O PubKey -> PubKey

unpack :: PubKey -> O PubKey

Lift DefaultUni PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

lift :: PubKey -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni PubKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

typeRep :: Proxy PubKey -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep PubKey Source # 
Instance details

Defined in Ledger.Crypto

type Rep PubKey = D1 ('MetaData "PubKey" "Ledger.Crypto" "plutus-ledger-1.2.0.0-8dOSOspdVv7Hd909lHBnfn" 'True) (C1 ('MetaCons "PubKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "getPubKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LedgerBytes)))
type O PubKey Source # 
Instance details

Defined in Ledger.Crypto

type O PubKey = GO (Rep PubKey)

newtype PrivateKey Source #

A cryptographic private key.

Constructors

PrivateKey 

Fields

Instances

Instances details
Eq PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Ord PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Show PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Generic PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Associated Types

type Rep PrivateKey :: Type -> Type Source #

Serialise PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

encode :: PrivateKey -> Encoding

decode :: Decoder s PrivateKey

encodeList :: [PrivateKey] -> Encoding

decodeList :: Decoder s [PrivateKey]

Hashable PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

FromJSON PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

parseJSON :: Value -> Parser PrivateKey

parseJSONList :: Value -> Parser [PrivateKey]

FromJSONKey PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

fromJSONKey :: FromJSONKeyFunction PrivateKey

fromJSONKeyList :: FromJSONKeyFunction [PrivateKey]

ToJSON PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

toJSON :: PrivateKey -> Value

toEncoding :: PrivateKey -> Encoding

toJSONList :: [PrivateKey] -> Value

toEncodingList :: [PrivateKey] -> Encoding

ToJSONKey PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

toJSONKey :: ToJSONKeyFunction PrivateKey

toJSONKeyList :: ToJSONKeyFunction [PrivateKey]

Eq PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

(==) :: PrivateKey -> PrivateKey -> Bool

Ord PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Pretty PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

pretty :: PrivateKey -> Doc ann #

prettyList :: [PrivateKey] -> Doc ann #

FromData PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

fromBuiltinData :: BuiltinData -> Maybe PrivateKey

ToData PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

toBuiltinData :: PrivateKey -> BuiltinData

UnsafeFromData PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

unsafeFromBuiltinData :: BuiltinData -> PrivateKey

Newtype PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Associated Types

type O PrivateKey

FromHttpApiData PrivateKey 
Instance details

Defined in Ledger.Orphans

Methods

parseUrlPiece :: Text -> Either Text PrivateKey

parseHeader :: ByteString -> Either Text PrivateKey

parseQueryParam :: Text -> Either Text PrivateKey

ToHttpApiData PrivateKey 
Instance details

Defined in Ledger.Orphans

Methods

toUrlPiece :: PrivateKey -> Text

toEncodedUrlPiece :: PrivateKey -> Builder

toHeader :: PrivateKey -> ByteString

toQueryParam :: PrivateKey -> Text

Lift DefaultUni PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

lift :: PrivateKey -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

Methods

typeRep :: Proxy PrivateKey -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

type Rep PrivateKey = D1 ('MetaData "PrivateKey" "Ledger.Crypto" "plutus-ledger-1.2.0.0-8dOSOspdVv7Hd909lHBnfn" 'True) (C1 ('MetaCons "PrivateKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "getPrivateKey") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 LedgerBytes)))
type O PrivateKey Source # 
Instance details

Defined in Ledger.Crypto

type O PrivateKey = GO (Rep PrivateKey)

newtype Signature Source #

A message with a cryptographic signature.

Constructors

Signature 

Fields

Instances

Instances details
Eq Signature Source # 
Instance details

Defined in Ledger.Crypto

Ord Signature Source # 
Instance details

Defined in Ledger.Crypto

Show Signature Source # 
Instance details

Defined in Ledger.Crypto

Generic Signature Source # 
Instance details

Defined in Ledger.Crypto

Associated Types

type Rep Signature :: Type -> Type Source #

Serialise Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

encode :: Signature -> Encoding

decode :: Decoder s Signature

encodeList :: [Signature] -> Encoding

decodeList :: Decoder s [Signature]

FromJSON Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

parseJSON :: Value -> Parser Signature

parseJSONList :: Value -> Parser [Signature]

ToJSON Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

toJSON :: Signature -> Value

toEncoding :: Signature -> Encoding

toJSONList :: [Signature] -> Value

toEncodingList :: [Signature] -> Encoding

Eq Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

(==) :: Signature -> Signature -> Bool

Ord Signature Source # 
Instance details

Defined in Ledger.Crypto

Pretty Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

pretty :: Signature -> Doc ann #

prettyList :: [Signature] -> Doc ann #

FromData Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

fromBuiltinData :: BuiltinData -> Maybe Signature

ToData Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

toBuiltinData :: Signature -> BuiltinData

UnsafeFromData Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

unsafeFromBuiltinData :: BuiltinData -> Signature

Lift DefaultUni Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

lift :: Signature -> RTCompile DefaultUni fun (Term TyName Name DefaultUni fun ())

Typeable DefaultUni Signature Source # 
Instance details

Defined in Ledger.Crypto

Methods

typeRep :: Proxy Signature -> RTCompile DefaultUni fun (Type TyName DefaultUni ())

type Rep Signature Source # 
Instance details

Defined in Ledger.Crypto

type Rep Signature = D1 ('MetaData "Signature" "Ledger.Crypto" "plutus-ledger-1.2.0.0-8dOSOspdVv7Hd909lHBnfn" 'True) (C1 ('MetaCons "Signature" 'PrefixI 'True) (S1 ('MetaSel ('Just "getSignature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 BuiltinByteString)))

newtype Passphrase Source #

Passphrase newtype to mark intent

Constructors

Passphrase 

Fields

Instances

Instances details
Show Passphrase Source # 
Instance details

Defined in Ledger.Crypto

IsString Passphrase Source # 
Instance details

Defined in Ledger.Crypto

pubKeyHash :: PubKey -> PubKeyHash Source #

Compute the hash of a public key.

signedBy :: ByteArrayAccess a => Signature -> PubKey -> a -> Bool Source #

Check whether the given Signature was signed by the private key corresponding to the given public key.

sign :: ByteArrayAccess a => a -> XPrv -> Passphrase -> Signature Source #

Sign a message using a private key and passphrase.

signTx :: TxId -> XPrv -> Passphrase -> Signature Source #

Sign the hash of a transaction using a private key and passphrase.

generateFromSeed :: ByteString -> Passphrase -> XPrv Source #

Generate a private key from a seed phrase and passphrase

Signing and generation with no passphrase

sign' :: ByteArrayAccess a => a -> XPrv -> Signature Source #

Sign a message using a private key with no passphrase.

signTx' :: TxId -> XPrv -> Signature Source #

Sign the hash of a transaction using a private key that has no passphrase.

generateFromSeed' :: ByteString -> XPrv Source #

Generate a private key from a seed phrase without a passphrase.