haskoin-core-0.22.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

Instances

Instances details
FromJSON XOnlyPubKey Source #

Hex encoding

Instance details

Defined in Haskoin.Transaction.Taproot

Methods

parseJSON :: Value -> Parser XOnlyPubKey

parseJSONList :: Value -> Parser [XOnlyPubKey]

omittedField :: Maybe XOnlyPubKey

ToJSON XOnlyPubKey Source #

Hex encoding

Instance details

Defined in Haskoin.Transaction.Taproot

Methods

toJSON :: XOnlyPubKey -> Value

toEncoding :: XOnlyPubKey -> Encoding

toJSONList :: [XOnlyPubKey] -> Value

toEncodingList :: [XOnlyPubKey] -> Encoding

omitField :: XOnlyPubKey -> Bool

Show XOnlyPubKey Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

Binary XOnlyPubKey Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

Serial XOnlyPubKey Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

Methods

serialize :: MonadPut m => XOnlyPubKey -> m ()

deserialize :: MonadGet m => m XOnlyPubKey

Serialize XOnlyPubKey Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

Methods

put :: Putter XOnlyPubKey

get :: Get XOnlyPubKey

Eq XOnlyPubKey Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

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 

Instances

Instances details
Show TaprootOutput Source # 
Instance details

Defined in Haskoin.Transaction.Taproot

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

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

verifyScriptPathData Source #

Arguments

:: PubKey

Output key

-> ScriptPathData 
-> Bool 

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

Since: 0.21.0