haskoin-core-1.1.0: Bitcoin & Bitcoin Cash library for Haskell
CopyrightNo rights reserved
LicenseMIT
Maintainerjprupp@protonmail.ch
Stabilityexperimental
PortabilityPOSIX
Safe HaskellSafe-Inferred
LanguageHaskell2010

Haskoin.Transaction.Taproot

Description

This module provides support for reperesenting full taproot outputs and parsing taproot witnesses. For reference see BIPS 340, 341, and 342.

Synopsis

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

Constructors

XOnlyPubKey 

Fields

type TapLeafVersion = Word8 Source #

Since: 0.21.0

data MAST Source #

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

Instances

Instances details
Show MAST Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

Methods

showsPrec :: Int -> MAST -> ShowS #

show :: MAST -> String #

showList :: [MAST] -> ShowS #

mastCommitment :: MAST -> Digest SHA256 Source #

Calculate the root hash for this tree.

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

Constructors

TaprootOutput 

taprootScriptOutput :: Ctx -> 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

Instances details
Eq TaprootWitness Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

data ScriptPathData Source #

Since: 0.21.0

Constructors

ScriptPathData 

Fields

Instances

Instances details
Eq ScriptPathData Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

viewTaprootWitness :: Ctx -> WitnessStack -> Maybe TaprootWitness Source #

Try to interpret a WitnessStack as taproot witness data.

Since: 0.21.0

encodeTaprootWitness :: Ctx -> TaprootWitness -> WitnessStack Source #

Transform the high-level representation of taproot witness data into a witness stack

Since: 0.21.0

verifyScriptPathData Source #

Arguments

:: Ctx 
-> PubKey

Output key

-> ScriptPathData 
-> Bool 

Verify that the script path spend is valid, except for script execution.

Since: 0.21.0