Safe Haskell | None |
---|---|
Language | Haskell98 |
Transaction data structures
- newtype RawTx = RawTx {}
- data LockTime
- parseLockTime :: Word32 -> LockTime
- marshalLockTime :: LockTime -> Word32
- data Tx inscript outscript = Tx {
- _txVersion :: !Word32
- _txInputs :: [TxInput inscript]
- _txOutputs :: [TxOutput outscript]
- _txLockTime :: !LockTime
- _txHash :: Hash256
- data TxInput inscript = TxInput {
- _txInPrevOutHash :: !Hash256
- _txInPrevOutIdx :: !Word32
- _txInScript :: !inscript
- _txInSeqNo :: !Word32
- data TxOutput outscript = TxOutput {
- _txOutValue :: !Int64
- _txOutScript :: !outscript
- txFee :: Tx (Tx a b) c -> Integer
- isCoinBaseTx :: Tx a b -> Bool
- isCoinBaseTx' :: Tx a b -> Maybe a
Documentation
"Raw" transaction (basically a ByteString)
Lock time
LockImmed | immediate (0x00000000) |
LockBlock !Int | not until block # |
LockTime !UnixTimeStamp | not before |
parseLockTime :: Word32 -> LockTime Source #
marshalLockTime :: LockTime -> Word32 Source #
data Tx inscript outscript Source #
Transactions, parametrized by the script types
Tx | |
|
data TxInput inscript Source #
TxInput | |
|
data TxOutput outscript Source #
TxOutput | |
|
txFee :: Tx (Tx a b) c -> Integer Source #
Computes the transaction fee, in satoshis.
We return an Integer
so that
this can be used to check the validity of a transaction. See CVE-2010-5139 vulnerability:
https://en.bitcoin.it/wiki/Common_Vulnerabilities_and_Exposures#CVE-2010-5139
isCoinBaseTx :: Tx a b -> Bool Source #
We recognize coinbase transactions.
isCoinBaseTx' :: Tx a b -> Maybe a Source #
We recognize coinbase transactions, and return the coinbase data.