| Safe Haskell | None |
|---|---|
| Language | Haskell2010 |
Bitcoin.Address
Description
Bitcoin address generation and rendering. Parsing is comming soon.
Most of what you'll normally need for safely dealing with Bitcoin addresses is exported from this module.
Synopsis
- btc :: Settings
- btcTestnet :: Settings
- data Address
- renderAddress :: Address -> ByteString
- addressScript :: Address -> Script
- p2pkh :: Settings -> Pub -> Address
- p2sh :: Settings -> Script -> Address
- p2sh_multiSig :: Settings -> [Pub] -> Int -> Maybe Address
- p2sh_p2wpkh :: Settings -> Pub -> Address
- p2sh_p2wsh :: Settings -> Script -> Address
- p2sh_p2wsh_multiSig :: Settings -> [Pub] -> Int -> Maybe Address
- p2wpkh :: Settings -> Pub -> Address
- p2wsh :: Settings -> Script -> Address
- p2wsh_multiSig :: Settings -> [Pub] -> Int -> Maybe Address
Network settings
Addresses
A Bitcoin compatible address.
These constructors are safe to use. However, you may find the similarly named helper functions in Bitcoin.Address more practical.
Constructors
| P2PKH PrefixP2PKH PubHash160 | A “pay to public-key hash” address. See |
| P2SH PrefixP2SH ScriptHash160 | A “pay to script hash” address. See |
| SegWit PrefixSegWit Program | A native SegWit address. See |
renderAddress :: Address -> ByteString Source #
Render and Address to its human readable form.
addressScript :: Address -> Script Source #
P2PKH
P2SH
p2sh :: Settings -> Script -> Address Source #
See p2sh_p2wpkh, p2sh_p2wpkh or p2sh_p2wsh_multiSig for some of
the typical constructions using p2sh. It's unlikely that you'll need to use
p2sh directly unless you are deploying a non-standard Script.
p2sh_p2wsh :: Settings -> Script -> Address Source #
P2SH “P2WSH-in-P2SH” Address for a Script.
WARNING SegWit does not support uncompressed SEC Public addresses
(i.e., pubUncompressed and pubUncompressedHash160), so be
sure to only mention compressed SEC Public addresses in your Scripts
(i.e., pubCompressed and pubHash160).
SegWit P2WPKH
SegWit P2WSH
p2wsh :: Settings -> Script -> Address Source #
SegWit “P2WSH” Address for a Script.
Please see p2wsh_multiSig for some of the typical constructions using
p2wsh. It's unlikely that you'll need to use p2wsh directly unless you
are deploying a non-standard Script.
WARNING SegWit does not support uncompressed SEC Public addresses
(i.e., pubUncompressed and pubUncompressedHash160), so be
sure to only mention compressed SEC Public addresses in your Scripts
(i.e., pubCompressed and pubHash160).