btcwallet icon indicating copy to clipboard operation
btcwallet copied to clipboard

Import external watch-only addresses

Open tuxcanfly opened this issue 10 years ago • 12 comments

Added RPC commands to import external watch-only addresses both with and without pubkeys. WIP on finishing test coverage and docs.

Refs #192

tuxcanfly avatar Mar 02 '15 18:03 tuxcanfly

Since the format of existing addresses in the db is being changed here, the db version needs to be bumped and it needs upgrade code to handle the new serialization. You should be able to do it without requiring the private passphrase by specifically targetting the new field offset.

davecgh avatar Mar 23 '15 17:03 davecgh

Yeah, we will need a upgrade to initialize the watchingOnly field, I guess it can be inferred by checking that pubkey is not nil.

tuxcanfly avatar Mar 23 '15 19:03 tuxcanfly

@davecgh Added upgrade path, addressed items reviewed above. Tested that we support importing pubkeys, p2pkh and p2sh addresses now.

tuxcanfly avatar Mar 24 '15 14:03 tuxcanfly

Addressed all the review items above except the upgrade re-serialization, will be done with that in a bit.

tuxcanfly avatar Mar 31 '15 17:03 tuxcanfly

@davecgh Done with the re-serialization bit. Added docs to make it readable. Please review.

tuxcanfly avatar Mar 31 '15 18:03 tuxcanfly

Needs tests with the version upgrades test setup in #237

tuxcanfly avatar Apr 15 '15 14:04 tuxcanfly

This needs a rebase over latest master. Could you also squash all of the fixes (all commits after 43f8801) into a single commit?

jrick avatar May 01 '15 18:05 jrick

OK, updated PubKey to return compressed as well as ok. Refactored related methods accordingly.

tuxcanfly avatar May 11 '15 15:05 tuxcanfly

The changed methods need better documentation to describe what all the return values are. Either the interface definition can use named returns to document the values, or comments should be added to describe what each bool means.

jrick avatar May 14 '15 18:05 jrick

Thanks, using named returns in the interface and also updated docs about the return values.

tuxcanfly avatar May 15 '15 15:05 tuxcanfly

What's the status on this? The corresponding PRs btcsuite/btcd#279 and btcsuite/btcjson#41 were merged a long time ago.

Did btcsuite/btcwallet#192 "supersede" this PR?

ghost avatar Aug 27 '16 07:08 ghost

There are several conflicts preventing this from being merged. There will be even more conflicts if decred/dcrwallet#315 is backported to btcwallet.

We're also moving away from the idea of importing keys into a HD wallet, both to simplify our code and to make the entire wallet recoverable from just the seed. Would need a discussion about if we still even want this feature.

jrick avatar Aug 29 '16 13:08 jrick