Using Bitcoin-Core 0.21.1
We have a spending policy to allow one key to sign OR another key AND a timelock.
or(pk(key_1),and(pk(key_2),after(15120)))
eg. HD Public Key Format:
key_1: [80c7402a/84h/1h/0h]tpubDDRf8pwB3k8Ew2ct7Z4AMfsh9GVcFSrE9e94yhQa6HhbZCCM1VuPKdBjeNvT1nbenStgmn2LovWFaFvKXeSonPk5eghpV5ouQvzYPiUNonP/*
key_2:[5c959c83/84h/1h/0h]tpubDDJ5z8wZtrtqCujsnY6qZMNejmrvCoyaD62FQGdtruXA3RkUfdLfJnuyapVo8U4djhkJ22Bn3Y1vTbPxoALRLW9Hvwrh2nzWBSsHm8kJmR2/*
Using miniscriptc and the HD Public Keys, we get the following decriptor:
wsh(or_d(pk(key_1),and_v(v:pk(key_2),after(15120))))#fddcjzdh
This appears to be valid on miniscriptc and it generates a receiving address.
Expected behaviour
Using importdescriptors with bitcoin-core should successfully import the descriptor and getnewaddress must return the same address as generated by miniscriptc.
Actual behaviour
When we pass this descriptor to getdescriptorinfo
We get this errror:
error code: -5
error message:
A function is needed within P2WSH
We referenced https://github.com/bitcoin/bitcoin/blob/master/doc/descriptors.md and the examples only show wsh and sh being used with pkh/wpkh , multi or sortedmulti - which I assumed are what get classified as 'functions'
Maybe since we are using or_d here, which it is not a function but rather a comparison operator ?
We have also referenced http://bitcoin.sipa.be/miniscript/ to build this policy.