Add wallet commands that returns a list of unused addresses
Maintainers usually reply within 2 days
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Start by reading the existing wallet unused_address command and how it calls bdk_wallet::Wallet::list_unused_addresses. Add a plural unused_addresses command that returns all revealed but unused addresses; consider the mentioned --keychain_kind flag with External as the default. The issue asks whether this should replace or accompany the singular command, so settle that design question before implementation.
Written by the indexing model from the issue text.
Description
Describe the enhancement
Currently bdk-cli can only return the last unused address from a wallet when long standing account could contain multiple unused addresses. The bdk_wallet::Wallet already provides list_unused_addresses method, which returns an iterator of revealed-but-unused addresses. This feature request exposes that method via the CLI. The current command is:
cargo run wallet -w test_user1 unused_address
it returns something like:
{
"address": "tb1q0aj7vx0lxy.....scjveq6",
"index": 0
}
Use case
If a wallet builds a transaction involving many New internal addresses but that transaction is never broadcast, then all of these addresses can now easily be used in a later transaction via the new unused_addresses subcommand. The singular method cannot solve this. The list method does, because it surfaces all the stranded addresses so they can be reused.
Additional context
Alongside this issue the KeychainKind is hardcoded into it as KeychainKind::External. It might be about time to bring the --keychain_kind flag to see both kinds and keep KeychainKind::External as default.
I plan to work on this issue myself but I want to know if this should replace the current subcommand or exist alongside it.
- Dominant language
- Rust
- Stars
- 142
- Forks
- 103
- Avg merge
- 4d 8h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from bitcoindevkit/bdk-cli
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
bitcoindevkit/bdk-cli#360 ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
bitcoindevkit/bdk-cli#358 ·
Maintainers usually reply within 2 days
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bitcoindevkit/bdk-cli#357 ·
Maintainers usually reply within 2 days
-
Remove "wallet" field from `WalletConfigInner`Possibly taken @Jennycj claimed this 7 days ago. Openenhancement
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
bitcoindevkit/bdk-cli#332 · 2 comments ·
Maintainers usually reply within 2 days
-
enhancement
Difficulty 3/5 1-2 days Newbie friendliness 55/100
bitcoindevkit/bdk-cli#359 ·
Maintainers usually reply within 2 days
All issues in bitcoindevkit/bdk-cli
Similar issues
-
BASEPRI needs an ISBOpen
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
rust-embedded/cortex-m#702 · 1 comment ·
-
Make major, minor, and makedev safe on solarish targetsPossibly taken @xtqqczze claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
improvement/feedback improvement/workflow-project
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
higress-group/HiRoute#166 ·
Maintainers usually reply within 1 day
-
Proxy ignores l5d-retry-http and l5d-retry-grpc conditions that follow a comma and spacePossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
Maintainers usually reply within 3 days
-
sncast panics when decoding a `u384` valuePossibly taken @RaphaelFakhri claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
foundry-rs/starknet-foundry#4635 ·
Maintainers usually reply within 3 days