Copyright | No rights reserved |
---|---|
License | MIT |
Maintainer | jprupp@protonmail.ch |
Stability | experimental |
Portability | POSIX |
Safe Haskell | None |
Language | Haskell2010 |
This module provides support for reperesenting full taproot outputs and parsing taproot witnesses. For reference see BIPS 340, 341, and 342.
Synopsis
- newtype XOnlyPubKey = XOnlyPubKey {}
- type TapLeafVersion = Word8
- data MAST
- mastCommitment :: MAST -> Digest SHA256
- getMerkleProofs :: MAST -> [(TapLeafVersion, Script, [Digest SHA256])]
- data TaprootOutput = TaprootOutput {}
- taprootOutputKey :: TaprootOutput -> PubKey
- taprootScriptOutput :: TaprootOutput -> ScriptOutput
- data TaprootWitness
- data ScriptPathData = ScriptPathData {}
- viewTaprootWitness :: WitnessStack -> Maybe TaprootWitness
- encodeTaprootWitness :: TaprootWitness -> WitnessStack
- verifyScriptPathData :: PubKey -> ScriptPathData -> Bool
Documentation
newtype XOnlyPubKey Source #
An x-only pubkey corresponds to the keys (x,y)
and (x, -y)
. The
equality test only checks the x-coordinate. An x-only pubkey serializes to 32
bytes.
Since: 0.21.0
Instances
type TapLeafVersion = Word8 Source #
Since: 0.21.0
Merklized Abstract Syntax Tree. This type can represent trees where only a subset of the leaves are known. Note that the tree is invariant under swapping branches at an internal node.
Since: 0.21.0
getMerkleProofs :: MAST -> [(TapLeafVersion, Script, [Digest SHA256])] Source #
Get the inclusion proofs for the leaves in the tree. The proof is ordered leaf-to-root.
Since: 0.21.0
data TaprootOutput Source #
Representation of a full taproot output.
Since: 0.21.0
Instances
Show TaprootOutput Source # | |
Defined in Haskoin.Transaction.Taproot showsPrec :: Int -> TaprootOutput -> ShowS # show :: TaprootOutput -> String # showList :: [TaprootOutput] -> ShowS # |
taprootOutputKey :: TaprootOutput -> PubKey Source #
Since: 0.21.0
taprootScriptOutput :: TaprootOutput -> ScriptOutput Source #
Generate the output script for a taproot output
Since: 0.21.0
data TaprootWitness Source #
Comprehension of taproot witness data
Since: 0.21.0
Instances
Eq TaprootWitness Source # | |
Defined in Haskoin.Transaction.Taproot (==) :: TaprootWitness -> TaprootWitness -> Bool # (/=) :: TaprootWitness -> TaprootWitness -> Bool # | |
Show TaprootWitness Source # | |
Defined in Haskoin.Transaction.Taproot showsPrec :: Int -> TaprootWitness -> ShowS # show :: TaprootWitness -> String # showList :: [TaprootWitness] -> ShowS # |
data ScriptPathData Source #
Since: 0.21.0
ScriptPathData | |
|
Instances
Eq ScriptPathData Source # | |
Defined in Haskoin.Transaction.Taproot (==) :: ScriptPathData -> ScriptPathData -> Bool # (/=) :: ScriptPathData -> ScriptPathData -> Bool # | |
Show ScriptPathData Source # | |
Defined in Haskoin.Transaction.Taproot showsPrec :: Int -> ScriptPathData -> ShowS # show :: ScriptPathData -> String # showList :: [ScriptPathData] -> ShowS # |
viewTaprootWitness :: WitnessStack -> Maybe TaprootWitness Source #
Try to interpret a WitnessStack
as taproot witness data.
Since: 0.21.0
encodeTaprootWitness :: TaprootWitness -> WitnessStack Source #
Transform the high-level representation of taproot witness data into a witness stack
Since: 0.21.0
:: PubKey | Output key |
-> ScriptPathData | |
-> Bool |
Verify that the script path spend is valid, except for script execution.
Since: 0.21.0