| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Cardano.Address.Crypto.Wallet
Description
Vendored from cardano-crypto (Apache-2.0).
Original: Cardano.Crypto.Wallet
HD Wallet routines using Ed25519 arithmetic.
Synopsis
- newtype ChainCode = ChainCode ByteString
- data DerivationScheme
- type DerivationIndex = Word32
- pattern LatestScheme :: DerivationScheme
- data XPrv
- data XPub = XPub {}
- data XSignature
- generate :: (ByteArrayAccess passPhrase, ByteArrayAccess seed) => seed -> passPhrase -> XPrv
- generateNew :: (ByteArrayAccess keyPassPhrase, ByteArrayAccess generationPassPhrase, ByteArrayAccess seed) => seed -> generationPassPhrase -> keyPassPhrase -> XPrv
- xprv :: ByteArrayAccess bin => bin -> Either String XPrv
- xpub :: ByteString -> Either String XPub
- xsignature :: ByteString -> Either String XSignature
- unXPrv :: XPrv -> ByteString
- unXPub :: XPub -> ByteString
- unXSignature :: XSignature -> ByteString
- toXPub :: XPrv -> XPub
- xPubGetPublicKey :: XPub -> PublicKey
- xPrvChangePass :: (ByteArrayAccess oldPassPhrase, ByteArrayAccess newPassPhrase) => oldPassPhrase -> newPassPhrase -> XPrv -> XPrv
- deriveXPrv :: ByteArrayAccess passPhrase => DerivationScheme -> passPhrase -> XPrv -> Word32 -> XPrv
- deriveXPub :: DerivationScheme -> XPub -> Word32 -> Maybe XPub
- sign :: (ByteArrayAccess passPhrase, ByteArrayAccess msg) => passPhrase -> XPrv -> msg -> XSignature
- verify :: ByteArrayAccess msg => XPub -> msg -> XSignature -> Bool
Documentation
Constructors
| ChainCode ByteString |
Instances
| NFData ChainCode # | |
Defined in Cardano.Address.Crypto.Wallet.Types | |
| Show ChainCode # | |
| Eq ChainCode # | |
| Ord ChainCode # | |
Defined in Cardano.Address.Crypto.Wallet.Types | |
| Hashable ChainCode # | |
Defined in Cardano.Address.Crypto.Wallet.Types | |
| ByteArrayAccess ChainCode # | |
data DerivationScheme #
Constructors
| DerivationScheme1 | |
| DerivationScheme2 |
Instances
type DerivationIndex = Word32 #
pattern LatestScheme :: DerivationScheme #
Extended Private & Public types
Constructors
| XPub | |
Fields | |
Instances
| NFData XPub # | |||||
Defined in Cardano.Address.Crypto.Wallet | |||||
| Generic XPub # | |||||
Defined in Cardano.Address.Crypto.Wallet Associated Types
| |||||
| Show XPub # | |||||
| Eq XPub # | |||||
| Ord XPub # | |||||
| Hashable XPub # | |||||
Defined in Cardano.Address.Crypto.Wallet | |||||
| type Rep XPub # | |||||
Defined in Cardano.Address.Crypto.Wallet type Rep XPub = D1 ('MetaData "XPub" "Cardano.Address.Crypto.Wallet" "cardano-addresses-4.0.2-inplace" 'False) (C1 ('MetaCons "XPub" 'PrefixI 'True) (S1 ('MetaSel ('Just "xpubPublicKey") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ByteString) :*: S1 ('MetaSel ('Just "xpubChaincode") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 ChainCode))) | |||||
data XSignature #
Instances
| NFData XSignature # | |
Defined in Cardano.Address.Crypto.Wallet Methods rnf :: XSignature -> () # | |
| Show XSignature # | |
Defined in Cardano.Address.Crypto.Wallet Methods showsPrec :: Int -> XSignature -> ShowS # show :: XSignature -> String # showList :: [XSignature] -> ShowS # | |
| Eq XSignature # | |
Defined in Cardano.Address.Crypto.Wallet | |
| Ord XSignature # | |
Defined in Cardano.Address.Crypto.Wallet Methods compare :: XSignature -> XSignature -> Ordering # (<) :: XSignature -> XSignature -> Bool # (<=) :: XSignature -> XSignature -> Bool # (>) :: XSignature -> XSignature -> Bool # (>=) :: XSignature -> XSignature -> Bool # max :: XSignature -> XSignature -> XSignature # min :: XSignature -> XSignature -> XSignature # | |
| Hashable XSignature # | |
Defined in Cardano.Address.Crypto.Wallet | |
| ByteArrayAccess XSignature # | |
Defined in Cardano.Address.Crypto.Wallet Methods length :: XSignature -> Int # withByteArray :: XSignature -> (Ptr p -> IO a) -> IO a # copyByteArrayToPtr :: XSignature -> Ptr p -> IO () # | |
generate :: (ByteArrayAccess passPhrase, ByteArrayAccess seed) => seed -> passPhrase -> XPrv #
Generate a new XPrv (legacy Byron method).
The seed needs to be >= 32 bytes.
generateNew :: (ByteArrayAccess keyPassPhrase, ByteArrayAccess generationPassPhrase, ByteArrayAccess seed) => seed -> generationPassPhrase -> keyPassPhrase -> XPrv #
Generate a new XPrv from entropy (Icarus method).
The seed should be at least 16 bytes.
xsignature :: ByteString -> Either String XSignature #
unXPrv :: XPrv -> ByteString #
unXPub :: XPub -> ByteString #
unXSignature :: XSignature -> ByteString #
xPubGetPublicKey :: XPub -> PublicKey #
xPrvChangePass :: (ByteArrayAccess oldPassPhrase, ByteArrayAccess newPassPhrase) => oldPassPhrase -> newPassPhrase -> XPrv -> XPrv #
Derivation function
deriveXPrv :: ByteArrayAccess passPhrase => DerivationScheme -> passPhrase -> XPrv -> Word32 -> XPrv #
deriveXPub :: DerivationScheme -> XPub -> Word32 -> Maybe XPub #
Signature & Verification from extended types
sign :: (ByteArrayAccess passPhrase, ByteArrayAccess msg) => passPhrase -> XPrv -> msg -> XSignature #
verify :: ByteArrayAccess msg => XPub -> msg -> XSignature -> Bool #