Copyright | No rights reserved |
---|---|
License | MIT |
Maintainer | jprupp@protonmail.ch |
Stability | experimental |
Portability | POSIX |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
ECDSA private and public key functions.
Synopsis
- data PubKeyI = PubKeyI {
- pubKeyPoint :: !PubKey
- pubKeyCompressed :: !Bool
- data SecKeyI = SecKeyI {
- secKeyData :: !SecKey
- secKeyCompressed :: !Bool
- exportPubKey :: Bool -> PubKey -> ByteString
- importPubKey :: ByteString -> Maybe PubKey
- wrapPubKey :: Bool -> PubKey -> PubKeyI
- derivePubKeyI :: SecKeyI -> PubKeyI
- wrapSecKey :: Bool -> SecKey -> SecKeyI
- fromMiniKey :: ByteString -> Maybe SecKeyI
- tweakPubKey :: PubKey -> Hash256 -> Maybe PubKey
- tweakSecKey :: SecKey -> Hash256 -> Maybe SecKey
- getSecKey :: SecKey -> ByteString
- secKey :: ByteString -> Maybe SecKey
- fromWif :: Network -> Base58 -> Maybe SecKeyI
- toWif :: Network -> SecKeyI -> Base58
Public & Private Keys
Elliptic curve public key type with expected serialized compression flag.
PubKeyI | |
|
Instances
Elliptic curve private key type with expected public key compression information. Compression information is stored in private key WIF formats and needs to be preserved to generate the correct address from the corresponding public key.
SecKeyI | |
|
Instances
Generic SecKeyI Source # | |
Read SecKeyI Source # | |
Show SecKeyI Source # | |
NFData SecKeyI Source # | |
Defined in Haskoin.Keys.Common | |
Eq SecKeyI Source # | |
type Rep SecKeyI Source # | |
Defined in Haskoin.Keys.Common type Rep SecKeyI = D1 ('MetaData "SecKeyI" "Haskoin.Keys.Common" "haskoin-core-0.22.0-inplace" 'False) (C1 ('MetaCons "SecKeyI" 'PrefixI 'True) (S1 ('MetaSel ('Just "secKeyData") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SecKey) :*: S1 ('MetaSel ('Just "secKeyCompressed") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) |
exportPubKey :: Bool -> PubKey -> ByteString #
importPubKey :: ByteString -> Maybe PubKey #
wrapPubKey :: Bool -> PubKey -> PubKeyI Source #
Wrap a public key from secp256k1 library adding information about compression.
derivePubKeyI :: SecKeyI -> PubKeyI Source #
Derives a public key from a private key. This function will preserve compression flag.
wrapSecKey :: Bool -> SecKey -> SecKeyI Source #
Wrap private key with corresponding public key compression flag.
fromMiniKey :: ByteString -> Maybe SecKeyI Source #
Decode Casascius mini private keys (22 or 30 characters).
tweakPubKey :: PubKey -> Hash256 -> Maybe PubKey Source #
Tweak a public key.
tweakSecKey :: SecKey -> Hash256 -> Maybe SecKey Source #
Tweak a private key.
getSecKey :: SecKey -> ByteString #
secKey :: ByteString -> Maybe SecKey #