Safe Haskell | None |
---|---|
Language | Haskell2010 |
- decode :: HexString -> Transaction
- encode :: Transaction -> HexString
- transactionId :: Transaction -> TransactionId
- data Transaction = Transaction {
- txVersion :: Word32
- txIn :: [TransactionIn]
- txOut :: [TransactionOut]
- txLockTime :: Word32
- data TransactionIn = TransactionIn {
- prevOutput :: OutPoint
- scriptInput :: Script
- txInSequence :: Word32
- data TransactionOut = TransactionOut {
- outValue :: Word64
- scriptOutput :: Script
- data Coinbase
Documentation
:: HexString | The hexadecimal representation of the transaction |
-> Transaction | The decoded |
Decodes a hex representation of a transaction into a Transaction
object.
:: Transaction | The |
-> HexString | The hexadecimal representation of the transaction |
Encodes a Transaction
object into a hex representation.
transactionId :: Transaction -> TransactionId Source
Calculates the transaction id of a Transaction
as a TransactionId
so it
can be used in RPC interfaces.
data Transaction Source
Data type representing a bitcoin transaction
Transaction | |
|
data TransactionIn Source
Data type representing a transaction input.
TransactionIn | |
|
data TransactionOut Source
Data type representing a transaction output.
TransactionOut | |
|
Data type representing the coinbase transaction of a Block
. Coinbase
transactions are special types of transactions which are created by miners
when they find a new block. Coinbase transactions have no inputs. They have
outputs sending the newly generated bitcoins together with all the block's
fees to a bitcoin address (usually the miners address). Data can be embedded
in a Coinbase transaction which can be chosen by the miner of a block. This
data also typically contains some randomness which is used, together with
the nonce, to find a partial hash collision on the block's hash.