bitcoin-scripting-0.1.0: Resources for working with miniscript, and script descriptors
Safe HaskellNone
LanguageHaskell2010

Language.Bitcoin.Script.Descriptors

Description

A library for working with bitcoin script descriptors. Documentation taken from https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md.

Synopsis

Documentation

data ScriptDescriptor Source #

Constructors

Sh ScriptDescriptor

P2SH embed the argument.

Wsh ScriptDescriptor

P2WSH embed the argument.

Pk KeyDescriptor

P2PK output for the given public key.

Pkh KeyDescriptor

P2PKH output for the given public key (use Addr if you only know the pubkey hash).

Wpkh KeyDescriptor

P2WPKH output for the given compressed pubkey.

Combo KeyDescriptor

An alias for the collection of pk(KEY) and pkh(KEY). If the key is compressed, it also includes wpkh(KEY) and sh(wpkh(KEY)).

Multi Int [KeyDescriptor]

k-of-n multisig script.

SortedMulti Int [KeyDescriptor]

k-of-n multisig script with keys sorted lexicographically in the resulting script.

Addr Address

the script which ADDR expands to.

Raw ByteString

the script whose hex encoding is HEX.

data Origin Source #

Constructors

Origin 

Instances

Instances details
Eq Origin Source # 
Instance details

Defined in Language.Bitcoin.Script.Descriptors.Syntax

Methods

(==) :: Origin -> Origin -> Bool #

(/=) :: Origin -> Origin -> Bool #

Ord Origin Source # 
Instance details

Defined in Language.Bitcoin.Script.Descriptors.Syntax

Show Origin Source # 
Instance details

Defined in Language.Bitcoin.Script.Descriptors.Syntax

data Key Source #

Constructors

Pubkey PubKeyI

DER-hex encoded secp256k1 public key

SecretKey SecKeyI

(de)serialized as WIF

XPub XPubKey DerivPath KeyCollection 

Instances

Instances details
Eq Key Source # 
Instance details

Defined in Language.Bitcoin.Script.Descriptors.Syntax

Methods

(==) :: Key -> Key -> Bool #

(/=) :: Key -> Key -> Bool #

Show Key Source # 
Instance details

Defined in Language.Bitcoin.Script.Descriptors.Syntax

Methods

showsPrec :: Int -> Key -> ShowS #

show :: Key -> String #

showList :: [Key] -> ShowS #

data KeyCollection Source #

Represent whether the key corresponds to a collection (and how) or a single key.

Constructors

Single 
HardKeys

immediate hardened children

SoftKeys

immediate non-hardened children

pubKey :: PubKeyI -> KeyDescriptor Source #

Simple explicit public key with no origin information

secKey :: SecKeyI -> KeyDescriptor Source #

Simple explicit secret key with no origin information

keyDescPubKey :: KeyDescriptor -> Maybe PubKeyI Source #

Produce a pubkey if possible

keyBytes :: KeyDescriptor -> Maybe ByteString Source #

Produce a key literal if possible

Text representation

Parsing