`compile --type=sh` produces a descriptor Bitcoin Core rejects
@vadim-anfv ci sta già lavorando.
Dal 7/8/2026.
Valutazione
Questa issue non è ancora stata valutata.
Descrizione
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.
- Lingua principale
- Rust
- Stelle
- 142
- Fork
- 99
- Merge medio
- 8g 1h
- PR unite (30g)
- 1
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di bitcoindevkit/bdk-cli
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
bitcoindevkit/bdk-cli#332 · 2 commenti ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
bitcoindevkit/bdk-cli#330 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
bitcoindevkit/bdk-cli#318 ·
-
enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
bitcoindevkit/bdk-cli#333 ·
-
bug
bitcoindevkit/bdk-cli#331 · 1 assegnatario ·
Tutte le issue di bitcoindevkit/bdk-cli
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
TheLarkInn/aipm#2413 ·
-
documentation
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
alexgorbatchev/simple-ptt#15 ·
-
tooling
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
todo:ticket
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
taikoxyz/taiko-mono#22168 · 1 commento ·