bitcoin-block-0.13.1: Utility functions for manipulating bitcoin blocks

Safe HaskellNone
LanguageHaskell2010

Data.Bitcoin.Block

Synopsis

Documentation

decode #

Arguments

:: HexString

The hexadecimal representation of the transaction

-> Block

The decoded Transaction object

Decodes a hex representation of a transaction into a Block object.

encode #

Arguments

:: Block

The Transaction we would like to encode to hex

-> HexString

The hexadecimal representation of the transaction

Encodes a Block object into a hex representation.

headerHash :: Block -> HexString #

Calculates the transaction id of a Transaction as a HexString so it can be used in RPC interfaces.

data BlockHeader #

Data type recording information on a Block. The hash of a block is defined as the hash of this data structure. The block mining process involves finding a partial hash collision by varying the nonce in the BlockHeader and/or additional randomness in the Coinbase of this Block. Variations in the Coinbase will result in different merkle roots in the BlockHeader.

Constructors

BlockHeader 

Fields

  • _blockVersion :: Word32

    Block version information, based on the version of the software creating this block.

  • _prevBlock :: BlockHash

    Hash of the previous block (parent) referenced by this block.

  • _merkleRoot :: Word256

    Root of the merkle tree of all transactions pertaining to this block.

  • _blockTimestamp :: Word32

    Unix timestamp recording when this block was created

  • _blockBits :: Word32

    The difficulty target being used for this block

  • _bhNonce :: Word32

    A random nonce used to generate this block. Additional randomness is included in the coinbase transaction of this block.

data Block #

Data type describing a block in the bitcoin protocol.

Constructors

Block 

Fields

Instances

Eq Block # 

Methods

(==) :: Block -> Block -> Bool #

(/=) :: Block -> Block -> Bool #

Show Block # 

Methods

showsPrec :: Int -> Block -> ShowS #

show :: Block -> String #

showList :: [Block] -> ShowS #

Binary Block # 

Methods

put :: Block -> Put #

get :: Get Block #

putList :: [Block] -> Put #