create_tx accepts recipient addresses from the wrong network
Los mantenedores suelen responder en 2 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 82/100
Línea de trabajo
Empieza por CreateTxCommand y parse_recipient, los dos lugares mencionados en el issue. Sigue cómo parse_recipient convierte el destinatario en un script y cómo execute accede a la red de la wallet; revisa las definiciones existentes de BDKCliError para InvalidNetwork. Se considerará terminado cuando create_tx rechace una dirección de otra red con ese error específico antes de generar un PSBT.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Describe the bug
create_tx accepts a recipient address belonging to a different network than the wallet. The transaction is built successfully, but the resulting PSBT is unspendable on the target network and only fails later at broadcast time with a node-side rejection. The cause is in parse_recipient: it calls Address::from_str (which yields Address<NetworkUnchecked>) and immediately converts to ScriptBuf via .script_pubkey(), discarding the network information before the wallet's network is known. bdk-cli therefore never compares the two.
To Reproduce
- Create a regtest wallet:
bdk-cli --network regtest wallet -w regtest_user1 --descriptor "..." --change_descriptor "..." create - Attempt to send to a testnet address:
bdk-cli --network regtest wallet -w regtest_user1 create_tx --to tb1qdgxnu...:1000 - Observe: the command succeeds and returns a PSBT.
- Broadcasting that PSBT against the regtest node fails with an address/script error, because
tb1...does not belong to the regtest network.
Expected behavior
create_tx should reject the recipient at construction time with a specific error naming the mismatch, rather than producing a PSBT that can never be spent. BDKCliError::InvalidNetwork { requested, found } should be created for this purpose. The recipient should be carried through as Address<NetworkUnchecked> and validated with require_network(ctx.state.wallet.network()) inside execute, immediately before conversion to ScriptBuf.
Build environment
- BDK-CLI tag/commit:
main - OS+version: macOS 12.7.6 (Monterey)
- Rust/Cargo version:
rustc --versionoutput - Rust/Cargo target:
x86_64-apple-darwin
Additional context
The fix is confined to CreateTxCommand and parse_recipient; no changes to the wallet API are needed.
- Lenguaje dominante
- Rust
- Estrellas
- 142
- Forks
- 103
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 5
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bitcoindevkit/bdk-cli
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
bitcoindevkit/bdk-cli#358 ·
Los mantenedores suelen responder en 2 días
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bitcoindevkit/bdk-cli#357 ·
Los mantenedores suelen responder en 2 días
-
Remove "wallet" field from `WalletConfigInner`Posiblemente ocupada @Jennycj la tomó hace 7 días. Abiertoenhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
bitcoindevkit/bdk-cli#332 · 2 comentarios ·
Los mantenedores suelen responder en 2 días
-
enhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
bitcoindevkit/bdk-cli#359 ·
Los mantenedores suelen responder en 2 días
-
Add wallet commands that returns a list of unused addressesPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abiertoenhancement
Dificultad 3/5 1-2 días Aptitud para principiantes 38/100
bitcoindevkit/bdk-cli#349 ·
Los mantenedores suelen responder en 2 días
Todos los issues de bitcoindevkit/bdk-cli
Issues similares
-
documentation
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
charles-hood/DiagramCraft#73 ·
-
Dificultad 1/5 1-3 horas Aptitud para principiantes 78/100
ontologyportal/sigma-rs#200 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
chipsalliance/caliptra-sw#4311 ·
Los mantenedores suelen responder en 2 días
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
`image_generation`: `max_retries` is ignored for OpenAI-compatible providers (always 2 retries)Posiblemente ocupada @ericz7900 la tomó hoy. Abiertollm translation
Dificultad 2/5 1-3 horas Aptitud para principiantes 77/100
Los mantenedores suelen responder en 1 día