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
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).
tweakPubKey :: Ctx -> PubKey -> Hash256 -> Maybe PubKey Source #
Tweak a public key.
tweakSecKey :: Ctx -> SecKey -> Hash256 -> Maybe SecKey Source #
Tweak a private key.