Here’s a policy I want to get working:
or(pk(MAIN),or(thresh(2,pk(KEY_1),pk(KEY_2),pk(KEY_3)),and(sha256(HASH_TARGET),older(144))))
It parses without issue in code:
...
let policy_string = format! (
"or(pk({}),or(thresh(2,pk({}),pk({}),pk({})),and(sha256({}),older(144))))",
pub_main_key, pub_a_key, pub_b_key, pub_c_key, hash_target
);
let policy: Concrete<DescriptorPublicKey> = policy_string.parse()
.expect("valid policy");
println!("{:#?}", {policy.to_string()});
...
But it throws a compile error when testing it in the ‘Policy to Miniscript compiler’ section of bitcoin.sipa.be/miniscript












