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

Haskoin.Transaction.Segwit

Contents

Description

Types to represent segregated witness data and auxilliary functions to manipulate it. See BIP 141 and BIP 143 for details.

Synopsis

Segwit

data WitnessProgram Source #

High level represenation of a (v0) witness program

Since: 0.11.0.0

data WitnessProgramPKH Source #

High level representation of a P2WPKH witness

Since: 0.11.0.0

data WitnessProgramSH Source #

High-level representation of a P2WSH witness

Since: 0.11.0.0

isSegwit :: ScriptOutput -> Bool Source #

Test if a ScriptOutput is P2WPKH or P2WSH

Since: 0.11.0.0

viewWitnessProgram :: Network -> ScriptOutput -> WitnessStack -> Either String WitnessProgram Source #

Calculate the witness program from the transaction data

Since: 0.11.0.0

decodeWitnessInput :: Network -> WitnessProgram -> Either String (Maybe ScriptOutput, SimpleInput) Source #

Analyze the witness, trying to match it with standard input structures

Since: 0.11.0.0

calcWitnessProgram :: ScriptOutput -> ScriptInput -> Either String WitnessProgram Source #

Create the witness program for a standard input

Since: 0.11.0.0

simpleInputStack :: SimpleInput -> [ByteString] Source #

Create the witness stack required to spend a standard P2WSH input

Since: 0.11.0.0

toWitnessStack :: WitnessProgram -> WitnessStack Source #

Encode a witness program

Since: 0.11.0.0