Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data KeyPair = KeyPair {}
- generate :: IO KeyPair
- newtype Signature = Signature {}
- newtype PublicKey = PublicKey {}
- newtype PrivateKey = PrivateKey {}
- sign :: PrivateKey -> ByteString -> IO Signature
- verify :: PublicKey -> Signature -> ByteString -> Bool
- data Hash a
- class ToHash a where
- hashToHex :: Hash a -> Hex256
- fromByteString :: ByteString -> Maybe (Hash a)
- unsafeFromByteString :: ByteString -> Hash a
- data HashTreeRoot a
- unHashTreeRoot :: HashTreeRoot a -> Hash a
- hashTreeRoot :: forall a. ToHash a => [a] -> HashTreeRoot a
Documentation
KeyPairs are used to store and sign transactions.
The PublicKey
piece is used as the public address on the blockchain where funds can be sent to and from.
The PrivateKey
is used to sign transactions, which provides a guarantee that
the transaction was initiated by the owner of the address.
generate :: IO KeyPair Source #
Generates a new KeyPair
. The PublicKey
can be shared openly, while the PrivateKey
should be kept secret.
newtype PrivateKey Source #
sign :: PrivateKey -> ByteString -> IO Signature Source #
fromByteString :: ByteString -> Maybe (Hash a) Source #
unsafeFromByteString :: ByteString -> Hash a Source #
data HashTreeRoot a Source #
Eq (HashTreeRoot a) Source # | |
Ord (HashTreeRoot a) Source # | |
Show (HashTreeRoot a) Source # | |
ToJSON (HashTreeRoot a) Source # | |
FromJSON (HashTreeRoot a) Source # | |
unHashTreeRoot :: HashTreeRoot a -> Hash a Source #
hashTreeRoot :: forall a. ToHash a => [a] -> HashTreeRoot a Source #