bitcoin-hs-0.0.1: Partial implementation of the Bitcoin protocol (as of 2013)

Safe HaskellNone
LanguageHaskell98

Bitcoin.Protocol.MerkleTree

Description

Synopsis

Documentation

data MerkleTree hash Source #

Constructors

MerkleNode hash (MerkleTree hash) (MerkleTree hash) 
MerkleSingle hash (MerkleTree hash) 
MerkleLeaf hash 

Instances

Show hash => Show (MerkleTree hash) Source # 

Methods

showsPrec :: Int -> MerkleTree hash -> ShowS #

show :: MerkleTree hash -> String #

showList :: [MerkleTree hash] -> ShowS #

merkleRoot :: MerkleTree hash -> hash Source #

The root of the tree

createMerkleTree :: OctetStream a => [a] -> MerkleTree Hash256 Source #

Creates a Merkle tree from data

buildMerkleTree :: [MerkleTree Hash256] -> MerkleTree Hash256 Source #

Builds a Merkle tree from data from a list of smaller Merkle trees

merklePairs :: [a] -> [Either a (a, a)] Source #

merklePyramid :: MerkleTree hash -> [[hash]] Source #

Converts the tree into a format easier to visualize for humans

viewMerkleTree :: Show hash => MerkleTree hash -> IO () Source #

For debugging (similar output to blockexporer)