bitcoin-payment-channel-1.2.0.0: Instant, two-party Bitcoin payments

Copyright(c) Rune K. Svendsen 2016
LicensePublicDomain
Maintainerrunesvend@gmail.com
Safe HaskellNone
LanguageHaskell2010

PaymentChannel.Util

Description

Utility functions for PaymentChannel.

Synopsis

Documentation

getFundingAddress :: ChanParams -> Address Source #

Derive a Bitcoin address, for funding a payment channel, from ChanParams. The transaction which pays to this address is the channel funding transaction, and information about this transaction is contained in FundingTxInfo.

getRedeemScript :: ChanParams -> Script Source #

Generate OP_CHECKLOCKTIMEVERIFY redeemScript, which can be redeemed in two ways: 1) by providing a signature from both server and client 2) after the date specified by lockTime: by providing only a client signature

class BtcLockTime a where Source #

Data type representing a Bitcoin LockTime, which specifies a point in time.

Minimal complete definition

parseLockTime, toWord32

Methods

parseLockTime :: Word32 -> Either LockTimeParseError a Source #

toWord32 :: a -> Word32 Source #

Instances

BtcLockTime LockTimeBlockHeight Source # 

Methods

parseLockTime :: Word32 -> Either LockTimeParseError LockTimeBlockHeight Source #

toWord32 :: LockTimeBlockHeight -> Word32 Source #

BtcLockTime LockTimeDate Source # 

Methods

parseLockTime :: Word32 -> Either LockTimeParseError LockTimeDate Source #

toWord32 :: LockTimeDate -> Word32 Source #

parseLockTime :: BtcLockTime a => Word32 -> Either LockTimeParseError a Source #

fromDate :: UTCTime -> Maybe LockTimeDate Source #

Convert a UTCTime to a LockTimeDate. Returns Nothing if the date is later than 2106-02-07 (or earlier than 1985-11-05).