aboutsummaryrefslogtreecommitdiff
path: root/src/test/miniscript_tests.cpp
AgeCommit message (Collapse)Author
2022-09-17Permit delaying duplicate key check in miniscript::Node constructionPieter Wuille
2022-07-18refactor: remove unused using directivesfanquake
2022-07-14miniscript: add a helper to find the first insane sub with no childAntoine Poinsot
This is helpful for finer grained descriptor parsing error: when there are multiple errors to report in a Miniscript descriptor start with the "smallest" fragments: the ones closer to be a leaf. Co-Authored-By: Pieter Wuille <pieter@wuille.net>
2022-07-14miniscript: don't check for top level validity at parsing timeAntoine Poinsot
Letting the caller perform the checks allows for finer-grained error reporting.
2022-05-30miniscript: mark nodes with duplicate keys as insaneAntoine Poinsot
As stated on the website, duplicate keys make it hard to reason about malleability as a single signature may unlock multiple paths. We use a custom KeyCompare function instead of operator< to be explicit about the requirement.
2022-04-28miniscript: use optional instead of bool/outargAntoine Poinsot
Co-authored-by: Pieter Wuille <pieter.wuille@gmail.com>
2022-04-18miniscript: the 'd:' wrapper must not be 'u'Antoine Poinsot
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-03-17Miniscript: ops limit and stack size computationPieter Wuille
Co-Authored-By: Antoine Poinsot <darosior@protonmail.com>
2022-03-17Miniscript: conversion from scriptPieter Wuille
Co-Authored-By: Antoine Poinsot <darosior@protonmail.com> Co-Authored-By: Samuel Dobson <dobsonsa68@gmail.com>
2022-03-17Miniscript: type system, script creation, text notation, testsPieter Wuille
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>