rpc: add deriveaddressesfromprivkey command #24160
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is a simple command for listing out all the address variants given a privkey, a feature which seems obvious but missing (unless I'm not finding the command!).
$ ./bitcoin-cli -regtest getnewaddress bcrt1qss60qxqt3vk6kxm4j6ufwp725f89esvm8lhvf6 $ ./bitcoin-cli -regtest dumpprivkey bcrt1qss60qxqt3vk6kxm4j6ufwp725f89esvm8lhvf6 cPsQTSmMZ8e3AEUWGjS73f5R364yJxH6RxcgnwbHjbKbFPUP2Dtu $ ./bitcoin-cli -regtest deriveaddressesfromprivkey cPsQTSmMZ8e3AEUWGjS73f5R364yJxH6RxcgnwbHjbKbFPUP2Dtu { "p2pkh": "msZzuZcZUYP8pdLZ3BktxFNZJQNR8ZBQjd", "segwit": "bcrt1qss60qxqt3vk6kxm4j6ufwp725f89esvm8lhvf6", "p2sh": "2N6EW9Va47woKmpzUmkqhpzemabnJAZudWW" }