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 PublicKey = PublicKey {}
- data PrivateKey = PrivateKey {}
- wrapPubKey :: Bool -> PubKey -> PublicKey
- derivePublicKey :: Ctx -> PrivateKey -> PublicKey
- wrapSecKey :: Bool -> SecKey -> PrivateKey
- fromMiniKey :: ByteString -> Maybe PrivateKey
- tweakPubKey :: Ctx -> PubKey -> Hash256 -> Maybe PubKey
- tweakSecKey :: Ctx -> SecKey -> Hash256 -> Maybe SecKey
- fromWif :: Network -> Base58 -> Maybe PrivateKey
- toWif :: Network -> PrivateKey -> Base58
Bitcoin Public & Private Keys
Elliptic curve public key type with expected serialized compression flag.
Instances
Generic PublicKey Source # | |
Read PublicKey Source # | |
Show PublicKey Source # | |
NFData PublicKey Source # | |
Defined in Haskoin.Crypto.Keys.Common | |
Eq PublicKey Source # | |
Hashable PublicKey Source # | |
Defined in Haskoin.Crypto.Keys.Common | |
Marshal Ctx PublicKey Source # | |
Defined in Haskoin.Crypto.Keys.Common | |
MarshalJSON Ctx PublicKey Source # | |
Defined in Haskoin.Crypto.Keys.Common | |
type Rep PublicKey Source # | |
Defined in Haskoin.Crypto.Keys.Common type Rep PublicKey = D1 ('MetaData "PublicKey" "Haskoin.Crypto.Keys.Common" "haskoin-core-1.0.0-inplace" 'False) (C1 ('MetaCons "PublicKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "point") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 PubKey) :*: S1 ('MetaSel ('Just "compress") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) |
data PrivateKey Source #
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.
Instances
wrapPubKey :: Bool -> PubKey -> PublicKey Source #
Wrap a public key from secp256k1 library adding information about compression.
derivePublicKey :: Ctx -> PrivateKey -> PublicKey Source #
Derives a public key from a private key. This function will preserve compression flag.
wrapSecKey :: Bool -> SecKey -> PrivateKey Source #
Wrap private key with corresponding public key compression flag.
fromMiniKey :: ByteString -> Maybe PrivateKey Source #
Decode Casascius mini private keys (22 or 30 characters).