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
In order to produce non-malleable satisfactions we make use of a function that returns the optimal
255
255
satisfaction and dissatisfaction for a given expression (if any exist), or a special DONTUSE ("don't use") value,
@@ -272,9 +272,9 @@ script but the result does not have the HASSIG flag, also fail. If the satisfact
272
272
DONTUSE and HASSIG, return it.
273
273
274
274
275
-
## Discussion
275
+
==Discussion==
276
276
277
-
## Security
277
+
==Security==
278
278
279
279
Miniscript primarily aims to provide guarantees on the correctness of a Bitcoin Script. That is, to
280
280
guarantee **consensus soundness** and **standardness completeness**. Consensus soundness means
@@ -297,7 +297,7 @@ that scripts whose conditions can be met without any digital signature are insec
297
297
trivially insecure, note how a transaction lacking a signature check allows an attacker to change
298
298
its nLockTime and nSequence fields to meet additional timelock conditions.
299
299
300
-
### Type System
300
+
===Type System===
301
301
302
302
To statically verify the correctness and malleability guarantees discussed in the previous section,
303
303
we define a type system. See the specifications above for a reference of each fragment's
@@ -323,7 +323,7 @@ Finally to analyze malleability guarantees we introduce 3 new type modifiers:
323
323
* "**e**" Expressive: this requires a unique unconditional dissatisfaction to exist, and forces all conditional dissatisfactions (if any) to require a signature.
324
324
325
325
326
-
### Malleability
326
+
===Malleability===
327
327
328
328
Since Segwit, malleating a transaction no longer breaks the validity of unconfirmed descendant
329
329
transactions. However, unintentional malleability may still have a number of much weaker undesirable
@@ -354,7 +354,7 @@ The malleability analysis makes the following assumptions:
354
354
* We restrict this analysis to scripts where no public key is repeated. If signatures constructed for one part of the script can be bound to other checks in the same script, a variant of the mixing from the previous point becomes available that is equally hard to reason about. Furthermore this situation can be avoided by using separate keys.
355
355
* The attacker is constrained by common standardness rules. A miner may be able to malleate a witness considered non-malleable by Miniscript.
356
356
357
-
#### Non-Malleable Satisfaction
357
+
====Non-Malleable Satisfaction====
358
358
359
359
Malleable satisfactions or dissatisfactions appear whenever options are available to attackers distinct from the one taken by honest users. This can happen for multiple reasons:
360
360
1. Two or more options for a satisfaction or dissatisfaction are listed in the table above which are both available to attackers directly. Regardless of which option is used in the honest solution, the attacker can change the solution to the other one.
@@ -380,7 +380,7 @@ satisfaction:
380
380
* `thresh(k,...)` is always "d", a non-HASSIG dissatisfaction with just dissatisfactions must exist due to typing rules, and thus rules out usage of the other dissatisfactions. They are also overcomplete.
381
381
382
382
383
-
### Resource Limits
383
+
====Resource Limits====
384
384
385
385
Various types of Bitcoin Scripts have different resource limitations, either through consensus or standardness. Some of them affect otherwise valid Miniscripts:
386
386
* In P2WSH, scripts larger than 3600 bytes are invalid by standardness. In Tapscript, scripts are implicitly bounded by the maximum size of a block (1 million virtual bytes).
@@ -392,11 +392,11 @@ A static analysis can be performed on a Miniscript to verify if none, all or any
392
392
paths hit any of the limits.
393
393
394
394
395
-
## Test Vectors
395
+
==Test Vectors==
396
396
397
397
TBD
398
398
399
-
## Backwards Compatibility
399
+
==Backwards Compatibility==
400
400
401
401
Miniscript's syntax is compatible with BIP 380 Output Script Descriptors, and should be considered
402
402
an extension to it that provides a new type of Script expression that is only valid in
@@ -408,16 +408,18 @@ The `pk()`, `pkh()`, `multi()`, and `multi_a()`
408
408
fragments overlap with existing descriptors. These parse to the same semantic meanings as those
409
409
descriptors and produce the same scripts.
410
410
411
-
## Reference Implementation
411
+
==Reference Implementation==
412
412
413
413
A first reference implementation and documentation for Miniscript in P2WSH was originally published at
414
414
https://github.com/sipa/miniscript .
415
415
416
+
[[bip-0381.mediawiki[381]]
417
+
416
418
The reference implementation for Miniscript in P2WSH was introduced in Bitcoin Core through PRs
417
-
[24147](https://github.com/bitcoin/bitcoin/pull/24147), [24148](https://github.com/bitcoin/bitcoin/pull/24148), and
418
-
[24149](https://github.com/bitcoin/bitcoin/pull/24149). The last one to be merged was released in Bitcoin
419
+
[[24147][https://github.com/bitcoin/bitcoin/pull/24147]], [[24148][https://github.com/bitcoin/bitcoin/pull/24148]], and
420
+
[[24149][https://github.com/bitcoin/bitcoin/pull/24149]]. The last one to be merged was released in Bitcoin
419
421
Core version 25.0.
420
422
421
423
The reference implementation for Miniscript in Tapscript was introduced in Bitcoin Core in PR
422
-
[27255](https://github.com/bitcoin/bitcoin/pull/27255). This PR was merged and released in Bitcoin Core
424
+
[[27255][https://github.com/bitcoin/bitcoin/pull/27255]]. This PR was merged and released in Bitcoin Core
0 commit comments