You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/resource_limitations.md
+5-5Lines changed: 5 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,12 +3,12 @@ TODO: Rust-miniscript behaviour for resource limitations:
3
3
# Safe vs Valid vs Sanity/Analyzable/Liftable
4
4
This document refers to bitcoin consensus and standardness rules as of bitcoin core release 0.20.
5
5
6
-
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.
6
+
One of Miniscript’s goals are to make advanced Script functionality accommodate both machine and human analysis. However such an analysis is not possible in all cases.
7
7
8
8
-**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.
9
9
-**Safety**: Whether all satisfactions of Miniscript require a digital signature.
10
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
11
-
- Miniscript may contain a invalid timelock and heightlock combination[article](https://medium.com/blockstream/dont-mix-your-timelocks-d9939b665094).
11
+
- Miniscript may contain an [invalid timelock and heightlock combination](https://medium.com/blockstream/dont-mix-your-timelocks-d9939b665094).
12
12
- Resource limitations: Discussed in the next section
13
13
- Repeated use of public keys or public key hashes
14
14
@@ -25,17 +25,17 @@ There are two types of limitations within the resource limitations: 1) Those tha
25
25
Certain limitations like script size are independent of satisfactions and as such those can script creation time. If there is any script that does not satisfy these
26
26
- Scripts over 520 bytes are invalid by consensus (P2SH).
27
27
- Scripts over 10000 bytes are invalid by consensus (bare, P2SH, P2WSH, P2SH-P2WSH).
28
-
-Anything but c:pk(key) (P2PK), c:pk_h(key) (P2PKH), and thresh_m(k,...) up to n=3 is invalid by standardness (bare).
28
+
-For bare scripts (ie not P2PKH, P2SH, [p2sh-]P2WPKH, [p2sh-]P2WSH), anything but c:pk(key) (P2PK), c:pk_h(key) (P2PKH), and thresh_m(k,...) up to n=3 is invalid by standardness.
29
29
- Scripts over 3600 bytes are invalid by standardness (P2WSH, P2SH-P2WSH).
30
30
31
31
rust-miniscript errors on parsing descriptors with these limitations and the compiler would not create these scripts.
32
32
33
33
## Limitations dependent on satisfactions
34
34
35
-
Some limitations are dependent on satisfaction path taken by script. It is possible that certain script satisfaction paths are not valid by consensus rules because they exceed the following limits:
35
+
Some limitations are dependent on satisfaction path taken by script. It is possible that certain script satisfaction paths are not valid because they exceed the following limits:
36
36
37
37
- Script satisfactions where the total number of non-push opcodes plus the number of keys participating in all executed thresh_ms, is above 201, are invalid by consensus (bare, P2SH, P2WSH, P2SH-P2WSH).
38
38
- Script satisfactions with a serialized scriptSig over 1650 bytes are invalid by standardness (P2SH).
39
39
- Script satisfactions with a witness consisting of over 100 stack elements (excluding the script itself) are invalid by standardness (P2WSH, P2SH-P2WSH).
40
40
41
-
rust-miniscript correctly parses these miniscripts, but does not allow lifting/analyzing these scripts if any of the spend paths exceeds the above limits. The satisfier logic does **not** guarantee to find the satisfactions for these scripts.
41
+
rust-miniscript correctly parses these miniscripts, but does not allow lifting/analyzing these scripts if any of the spend paths exceeds the above limits. The satisfier logic does **not** guarantee to find the satisfactions for these scripts. The policy compiler would not create such scripts.
0 commit comments