bitcoin-address-0.1: Bitcoin address generation and rendering. Parsing coming soon.
Safe HaskellNone
LanguageHaskell2010

Bitcoin.Address.Hash

Description

This module exports hash constructions used by Bitcoin addresses.

Synopsis

PubHash160

data PubHash160 Source #

The hash160 of a Public key.

Instances

Instances details
Eq PubHash160 Source # 
Instance details

Defined in Bitcoin.Address.Hash

Ord PubHash160 Source # 
Instance details

Defined in Bitcoin.Address.Hash

Show PubHash160 Source #

Base-16 encoded.

Instance details

Defined in Bitcoin.Address.Hash

parsePubHash160 :: ByteString -> Maybe PubHash160 Source #

Create a PubHash160 from its 20 raw bytes.

pubHash160 :: Pub -> PubHash160 Source #

The hash160 of the compressed SEC representation of a Public key.

Usually, this is what you want.

pubUncompressedHash160 :: Pub -> PubHash160 Source #

The hash160 of the uncompressed SEC representation of a Public key.

It's very unlikely that you want this. Except if it's ten years ago or you are dealing with very old addresses.

WARNING do not use this with SegWit addresses P2WPKH, or in P2WSH Scripts.

ScriptHash160

scriptHash160 :: Script -> ScriptHash160 Source #

Hash a Script as required by P2SH.

ScriptSHA256

parseScriptSHA256 :: ByteString -> Maybe ScriptSHA256 Source #

Create a ScriptSHA256 from its 32 raw bytes.

scriptSHA256 :: Script -> ScriptSHA256 Source #

Hash a Script as required by P2WSH.