`compile --type=sh` produces a descriptor Bitcoin Core rejects
@vadim-anfv 已经在做这个了。
开始于 2026年8月7日。
评估
这个 Issue 还没有评估数据。
描述
bdk-cli compile accepts --type values sh, wsh, sh-wsh and tr. Only sh produces a descriptor Bitcoin Core rejects:
$ A=$(bdk-cli --network bitcoin key generate | jq -r .xprv)
$ B=$(bdk-cli --network bitcoin key generate | jq -r .xprv)
$ D=$(bdk-cli compile "or(pk($A),pk($B))" --type=sh | jq -r .descriptor)
$ bitcoin-cli getdescriptorinfo "$D"
error code: -5
error message:
Miniscript expressions can only be used in wsh or tr.
The same policy with --type=wsh, --type=sh-wsh and --type=tr is accepted.
BIP 379 scopes Miniscript to P2WSH and Tapscript, and excludes P2SH explicitly, spec:
These specifications apply to P2WSH (BIP 141) and Tapscript (BIP 342) scripts [...] P2SH and bare scripts are excluded from this specification.
Core enforces that where it parses the Miniscript expression, src:
if (node) {
if (ctx != ParseScriptContext::P2WSH && ctx != ParseScriptContext::P2TR) {
error = "Miniscript expressions can only be used in wsh or tr.";
return {};
}
bdk-cli can still build the descriptor because rust-miniscript keeps the pre-BIP contexts. BDK also handles it end to end: wallet config --ext-descriptor "$D" followed by new_address derives a P2SH address, and the script itself is consensus-valid. Other descriptor-based wallets may not support this type though - Core rejects it outright, in both getdescriptorinfo and importdescriptors.
@tvpeter how would you like this handled?
- drop
shfrom the accepted--typevalues - keep it, but warn on output and document that it is outside BIP 379 specification
Happy to open the PR once you have picked one.
- 主要语言
- Rust
- 星标
- 142
- 派生
- 99
- 平均合并
- 8 天 1 小时
- 30 天内合并 PR
- 1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bitcoindevkit/bdk-cli 的其他 Issue
-
enhancement
难度 2/5 1-3 小时 新手友好度 72/100
bitcoindevkit/bdk-cli#332 · 2 条评论 ·
-
难度 2/5 1-3 小时 新手友好度 65/100
bitcoindevkit/bdk-cli#330 ·
-
难度 2/5 1-3 小时 新手友好度 76/100
bitcoindevkit/bdk-cli#318 ·
-
enhancement
难度 3/5 1-2 天 新手友好度 68/100
bitcoindevkit/bdk-cli#333 ·
-
bug
bitcoindevkit/bdk-cli#331 · 已指派 1 人 ·
查看 bitcoindevkit/bdk-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 75/100
TheLarkInn/aipm#2413 ·
-
documentation
难度 1/5 1 小时以内 新手友好度 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
难度 2/5 1-3 小时 新手友好度 75/100
-
todo:ticket
难度 2/5 1-3 小时 新手友好度 70/100
-
难度 2/5 1-3 小时 新手友好度 75/100
taikoxyz/taiko-mono#22168 · 1 条评论 ·