Skip to content

Commit 424a57a

Browse files
committed
Merge rust-bitcoin#528: Backport of multi_a bug fix
850bd2e Fix Ci (sanket1729) 4797f99 Release 9.0.1 (sanket1729) cd9de92 Update multi_a to not include n wrapper (sanket1729) Pull request description: ACKs for top commit: apoelstra: ACK 850bd2e Tree-SHA512: 95e9e134f90e91c16bdf11f67a30047da61db143148d0cc1eb072864a07c27e2295ee4b44a5c0eb940e4cd8b71db7a1ebf2efb283f615b2800f25f1a42bdc252
2 parents a7bfff4 + 850bd2e commit 424a57a

File tree

6 files changed

+35
-5
lines changed

6 files changed

+35
-5
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
# 9.0.1 - March 8, 2023
2+
3+
- Fixed a typing rule in `multi_a` for taproot miniscript descriptors. Current typing rules
4+
incorrectly tagged `multi_a` with the `n` property. Certain miniscripts of the form `j:multi_a` could
5+
could not spent without the first key. We could not find any evidence of these scripts being used
6+
in the wild. While this is technically a breaking change, any downstream users whose code would
7+
break by this change are already vulnerable.
8+
19
# 9.0.0 - November 5, 2022
210

311
- Fixed a bug dealing with dissatisfying pkh inside thresh

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "miniscript"
3-
version = "9.0.0"
3+
version = "9.0.1"
44
authors = ["Andrew Poelstra <[email protected]>, Sanket Kanjalkar <[email protected]>"]
55
license = "CC0-1.0"
66
homepage = "https://github.com/rust-bitcoin/rust-miniscript/"

contrib/test.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ if [ "$MSRV" = true ]; then
2525
cargo update -p url --precise 2.2.2
2626
cargo update -p form_urlencoded --precise 1.0.1
2727
cargo update -p once_cell --precise 1.13.1
28+
cargo update -p syn --precise 1.0.107
2829
fi
2930

3031
# Format if told to

src/miniscript/types/correctness.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,15 @@ impl Property for Correctness {
170170
}
171171
}
172172

173+
fn from_multi_a(_: usize, _: usize) -> Self {
174+
Correctness {
175+
base: Base::B,
176+
input: Input::Any,
177+
dissatisfiable: true,
178+
unit: true,
179+
}
180+
}
181+
173182
fn from_hash() -> Self {
174183
Correctness {
175184
base: Base::B,

src/miniscript/types/malleability.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,14 @@ impl Property for Malleability {
119119
}
120120
}
121121

122+
fn from_multi_a(_: usize, _: usize) -> Self {
123+
Malleability {
124+
dissat: Dissat::Unique,
125+
safe: true,
126+
non_malleable: true,
127+
}
128+
}
129+
122130
fn from_hash() -> Self {
123131
Malleability {
124132
dissat: Dissat::Unknown,

src/miniscript/types/mod.rs

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,10 +267,7 @@ pub trait Property: Sized {
267267
fn from_multi(k: usize, n: usize) -> Self;
268268

269269
/// Type property of a `MultiA` fragment
270-
fn from_multi_a(k: usize, n: usize) -> Self {
271-
// default impl same as multi
272-
Self::from_multi(k, n)
273-
}
270+
fn from_multi_a(k: usize, n: usize) -> Self;
274271

275272
/// Type property of a hash fragment
276273
fn from_hash() -> Self;
@@ -583,6 +580,13 @@ impl Property for Type {
583580
}
584581
}
585582

583+
fn from_multi_a(k: usize, n: usize) -> Self {
584+
Type {
585+
corr: Property::from_multi_a(k, n),
586+
mall: Property::from_multi_a(k, n),
587+
}
588+
}
589+
586590
fn from_hash() -> Self {
587591
Type {
588592
corr: Property::from_hash(),

0 commit comments

Comments
 (0)