From 4bec86db789b00ab8d716bda4c0f09a9f8b231e3 Mon Sep 17 00:00:00 2001 From: Oliver Gugger Date: Thu, 7 Sep 2023 08:50:20 +0200 Subject: [PATCH] wip --- txscript/miniscript/miniscript.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/txscript/miniscript/miniscript.go b/txscript/miniscript/miniscript.go index cd9e7c3cce..a6359f9263 100644 --- a/txscript/miniscript/miniscript.go +++ b/txscript/miniscript/miniscript.go @@ -13,6 +13,15 @@ import ( "github.com/btcsuite/btcd/wire" ) +// 1. argCheck: checks that the nodes have the correct number of arguments +// 2. expandWrappers: dewraps the numbers before the colon : E.g. dv:older(144) is d(v(older(144))) +// 3. deSugar: Miniscript defines six instances of syntactic sugar. We replace these with fixed equations +// 4. typecheck: Not all fragments compose with each other to produce a valid Bitcoin Script and valid witness. This function checks that and sets the types of the Miniscript fragments. Only if the toplevel basic type is of type B the miniscript is valid. +// 5. canCollapseVerify If the rightmost scriptbyte of a node is OP_EQUAL, OP_CHECKSIG or OP_CHECKMULTISIG. We can convert it to the VERIFY version of the opcode, e.g. OP_EQUALVERIFY +// 6. malleabilityCheck checks each not if it is malleable (checking that the transaction hash can not be changes without altering the content) +// 7. computeScriptLen simply computes the script length. +// 8. computeOpCount counts the amount of opcodes the script contains (edited) + const ( // pubKeyLen is the length of a public key inside P2WSH, which are 33 // byte compressed public keys.