Skip to content

Commit 977a367

Browse files
authored
Merge pull request #193 from sanket1729/release
Update doc for sane/insane miniscripts
2 parents 06cbebb + 91aa2d5 commit 977a367

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

doc/resource_limitations.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
11
TODO: Rust-miniscript behaviour for resource limitations:
22

3-
# Safe vs Valid vs Analyzable/Liftable
3+
# Safe vs Valid vs Sanity/Analyzable/Liftable
44
This document refers to bitcoin consensus and standardness rules as of bitcoin core release 0.20.
55

66
One of Miniscript’s goals are to make advanced Script functionality accommodate both machine and human analysis. However such a analysis is not possible in all cases.
77

88
- **Validity**: Validity refers to whether the Miniscript tree constructions follows the grammar rules. For eg: Top level must be `B`, or `thresh` must have all of it's arguments being dissatifyable.
99
- **Safety**: Whether all satisfactions of Miniscript require a digital signature.
10-
- **Analyzable/Liftable**: Even if the given is valid and safe, it does not imply that Miniscript is consensus and standardness complete. That is, there may exist some semantics implied by the lifted miniscript which cannot be realized in bitcoin network rules. This maybe because of two main reasons
10+
- **Sanity/Analyzable/Liftable**: Even if the given is valid and safe, it does not imply that Miniscript is consensus and standardness complete. That is, there may exist some semantics implied by the lifted miniscript which cannot be realized in bitcoin network rules. This maybe because of three main reasons
1111
- Miniscript may contain a invalid timelock and heightlock combination[article](https://medium.com/blockstream/dont-mix-your-timelocks-d9939b665094).
1212
- Resource limitations: Discussed in the next section
13+
- Repeated use of public keys or public key hashes
1314

14-
This library accepts all miniscripts that are safe and valid and the signing logic will correctly work for all of those scripts. However, analyzing/lifting such miniscripts would fail.
15+
This library accepts all miniscripts that are safe and valid and the signing logic will correctly work for all of those scripts. However, analyzing/lifting such miniscripts would fail. The functions `Miniscript::parse` and `Miniscript::from_str` only succeed on sane miniscripts. Use the insane versions(`Miniscript::parse_insane` and `Miniscript::from_str_insane`) for dealing with "insane" miniscripts. The descriptor APIs all work only for sane scripts.
1516

1617
# Resource Limitations
1718

0 commit comments

Comments
 (0)