Copyright | No rights reserved |
---|---|
License | MIT |
Maintainer | [email protected] |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Haskoin.Crypto.Keys.Common
Description
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
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.
Constructors
PrivateKey | |
Instances
Serial PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common | |||||
NFData PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common Methods rnf :: PrivateKey -> () # | |||||
Generic PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common Associated Types
| |||||
Read PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common Methods readsPrec :: Int -> ReadS PrivateKey # readList :: ReadS [PrivateKey] # readPrec :: ReadPrec PrivateKey # readListPrec :: ReadPrec [PrivateKey] # | |||||
Show PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common Methods showsPrec :: Int -> PrivateKey -> ShowS # show :: PrivateKey -> String # showList :: [PrivateKey] -> ShowS # | |||||
Eq PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common | |||||
MarshalJSON Network PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common Methods marshalValue :: Network -> PrivateKey -> Value Source # marshalEncoding :: Network -> PrivateKey -> Encoding Source # unmarshalValue :: Network -> Value -> Parser PrivateKey Source # | |||||
type Rep PrivateKey Source # | |||||
Defined in Haskoin.Crypto.Keys.Common type Rep PrivateKey = D1 ('MetaData "PrivateKey" "Haskoin.Crypto.Keys.Common" "haskoin-core-1.2.2-7BgSuBjmW70D9Dx36RFkXY" 'False) (C1 ('MetaCons "PrivateKey" 'PrefixI 'True) (S1 ('MetaSel ('Just "key") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 SecKey) :*: S1 ('MetaSel ('Just "compress") 'NoSourceUnpackedness 'SourceStrict 'DecidedStrict) (Rec0 Bool))) |
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).