What is the difference between semantic policy and concrete policy in a Miniscript context?
The difference between Policy and Miniscript is defined here.
What is the difference between semantic policy and concrete policy in a Miniscript context?
The difference between Policy and Miniscript is defined here.
Andrew Poelstra discussed semantic policy and concrete policy at this Miniscript workshop at Advancing Bitcoin 2020.
There are two types of Policies in rust-miniscript. There are semantic Policies which are the ones you get where you start with a Miniscript and throw away all the extra information. Those are what you use to do analysis and stuff. Then there are concrete Policies and those have weights on the branches. You can always get to a semantic Policy by throwing away information. We have a function called
Liftthat I think we use later on. We’ve imported theLiftabletrait. We create this concrete Policy, we parse it and you can see it looks kind of like Miniscript. We parse it in the usual way using thefrom_strtrait. Then we call this functionhtlc_policy.compile. The compile turns a concrete Policy into a Miniscript.