Copyright | No rights reserved |
---|---|
License | MIT |
Maintainer | matt@bitnomial.com |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
Code related to PSBT parsing and serialization.
Synopsis
- data PartiallySignedTransaction = PartiallySignedTransaction {
- unsignedTransaction :: Tx
- globalUnknown :: UnknownMap
- inputs :: [Input]
- outputs :: [Output]
- data Input = Input {
- nonWitnessUtxo :: Maybe Tx
- witnessUtxo :: Maybe TxOut
- partialSigs :: HashMap PubKeyI ByteString
- sigHashType :: Maybe SigHash
- inputRedeemScript :: Maybe Script
- inputWitnessScript :: Maybe Script
- inputHDKeypaths :: HashMap PubKeyI (Fingerprint, [KeyIndex])
- finalScriptSig :: Maybe Script
- finalScriptWitness :: Maybe WitnessStack
- inputUnknown :: UnknownMap
- data Output = Output {}
- newtype UnknownMap = UnknownMap {}
- data Key = Key {
- keyType :: Word8
- key :: ByteString
- merge :: PartiallySignedTransaction -> PartiallySignedTransaction -> Maybe PartiallySignedTransaction
- mergeInput :: Input -> Input -> Input
- mergeOutput :: Output -> Output -> Output
- complete :: PartiallySignedTransaction -> PartiallySignedTransaction
- finalTransaction :: PartiallySignedTransaction -> Tx
- emptyPSBT :: Tx -> PartiallySignedTransaction
- emptyInput :: Input
- emptyOutput :: Output
Partially-Signed Transactions
data PartiallySignedTransaction Source #
PSBT data type as specified in
BIP-174.
This contains an unsigned transaction, inputs and outputs, and unspecified
extra data. There is one input per input in the unsigned transaction, and one
output per output in the unsigned transaction. The inputs and outputs in the
PartiallySignedTransaction
line up by index with the inputs and outputs in
the unsigned transaction.
PartiallySignedTransaction | |
|
Instances
Inputs contain all of the data needed to sign a transaction and all of the resulting signature data after signing.
Instances
Outputs can contain information needed to spend the output at a later date.
Instances
Eq Output Source # | |
Show Output Source # | |
Generic Output Source # | |
Serialize Output Source # | |
NFData Output Source # | |
Defined in Haskoin.Transaction.Partial | |
type Rep Output Source # | |
Defined in Haskoin.Transaction.Partial type Rep Output = D1 ('MetaData "Output" "Haskoin.Transaction.Partial" "haskoin-core-0.20.5-inplace" 'False) (C1 ('MetaCons "Output" 'PrefixI 'True) ((S1 ('MetaSel ('Just "outputRedeemScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Script)) :*: S1 ('MetaSel ('Just "outputWitnessScript") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Script))) :*: (S1 ('MetaSel ('Just "outputHDKeypaths") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (HashMap PubKeyI (Fingerprint, [KeyIndex]))) :*: S1 ('MetaSel ('Just "outputUnknown") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 UnknownMap)))) |
newtype UnknownMap Source #
A map of raw PSBT keys to byte strings for extra data. The keyType
field
cannot overlap with any of the reserved keyType
fields specified in the
PSBT specification.
Instances
Raw keys for the map type used in PSBTs.
Key | |
|
Instances
Eq Key Source # | |
Show Key Source # | |
Generic Key Source # | |
Hashable Key Source # | |
Defined in Haskoin.Transaction.Partial | |
Serialize Key Source # | |
NFData Key Source # | |
Defined in Haskoin.Transaction.Partial | |
type Rep Key Source # | |
Defined in Haskoin.Transaction.Partial type Rep Key = D1 ('MetaData "Key" "Haskoin.Transaction.Partial" "haskoin-core-0.20.5-inplace" 'False) (C1 ('MetaCons "Key" 'PrefixI 'True) (S1 ('MetaSel ('Just "keyType") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Word8) :*: S1 ('MetaSel ('Just "key") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ByteString))) |
merge :: PartiallySignedTransaction -> PartiallySignedTransaction -> Maybe PartiallySignedTransaction Source #
Take two PartiallySignedTransaction
s and merge them. The
unsignedTransaction
field in both must be the same.
complete :: PartiallySignedTransaction -> PartiallySignedTransaction Source #
Take partial signatures from all of the Input
s and finalize the signature.
finalTransaction :: PartiallySignedTransaction -> Tx Source #
Take a finalized PartiallySignedTransaction
and produce the signed final
transaction. You may need to call complete
on the
PartiallySignedTransaction
before producing the final transaction.
emptyPSBT :: Tx -> PartiallySignedTransaction Source #
Take an unsigned transaction and produce an empty
PartiallySignedTransaction
emptyInput :: Input Source #
emptyOutput :: Output Source #