Commit graph

5 commits

Author SHA1 Message Date
Antoine Poinsot
5922c662c0
scripted-diff: miniscript: rename 'nodetype' variables to 'fragment'
The 'Fragment' type was previously named 'Nodetype'. For clarity, name
the variables the same.

-BEGIN VERIFY SCRIPT-
sed -i 's/nodetype/fragment/g' src/script/miniscript.*
-END VERIFY SCRIPT-

Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
2022-04-28 16:44:39 +02:00
Antoine Poinsot
c5f65db0f0
miniscript: remove a workaround for a GCC 4.8 bug
Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
2022-04-28 16:44:39 +02:00
Antoine Poinsot
7417594187
miniscript: the 'd:' wrapper must not be 'u'
The value it leaves on the stack depends on the last element on the
stack. However, we can't make sure this element is OP_1 (which would
give us the 'u' property) without the MINIMALIF rule.
MINIMALIF is only policy for P2WSH, therefore giving 'd:' the 'u'
property breaks consensus soundness: it makes it possible (by consensus
but not policy) for instance to satisfy a thresh() without satisfying
at least k of its subs.

This bug was found and reported by Andrew Poelstra.
2022-04-18 16:03:29 +02:00
Pieter Wuille
2e55e88f86
Miniscript: conversion from script
Co-Authored-By: Antoine Poinsot <darosior@protonmail.com>
Co-Authored-By: Samuel Dobson <dobsonsa68@gmail.com>
2022-03-17 14:09:08 +01:00
Pieter Wuille
1ddaa66eae
Miniscript: type system, script creation, text notation, tests
More information about Miniscript can be found at https://bitcoin.sipa.be/miniscript/ (the
website source is hosted at https://github.com/sipa/miniscript/).
This commit defines all fragments, their composition, parsing from
string representation and conversion to Script.

Co-Authored-By: Antoine Poinsot <darosior@protonmail.com>
Co-Authored-By: Sanket Kanjalkar <sanket1729@gmail.com>
Co-Authored-By: Samuel Dobson <dobsonsa68@gmail.com>
2022-03-17 14:09:07 +01:00