-
Notifications
You must be signed in to change notification settings - Fork 38.7k
[WIP] Importmulti private key support #12705
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
6c839f8 to
32e70ab
Compare
promag
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK. Light review.
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "Importmulti private key support",
Also fix default=true to be consistent with most of the code.
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "[wallet] [rpc] Move private key import functionality out of importprivkey",
Remove this scope?
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "[wallet] [rpc] Move private key import functionality out of importprivkey",
Nit, move throw to new line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistency?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, because of the other one below. Fixed.
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "[wallet] [rpc] Move private key import functionality out of importprivkey",
static bool ...?
src/wallet/rpcdump.cpp
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In commit "[wallet] [rpc] Add privkey support to importmulti",
Nit, UniValue result(UniValue::VOBJ);
|
Concept ACK |
1 similar comment
|
Concept ACK |
|
Thank you for working on this! I think we should be careful here though.
|
I think it should absolutely use The way it should work IMO is that it integrates into all the functionality that exists (including labels, birth times), but simply permit the scriptpubkey/address (and for p2sh-p2wpkh, also the redeemscript) to be omitted and computed by default from the private key - provided we have figured out how to deal with the encoding of different types of address derivation. |
|
@sipa It seems Electrum 3.0 included an extension to WIF for segwit stuff: A good starting point might be to rework this PR to adopt that and see what people think? |
|
@promag Thanks for the feedback, see e896ba0, 6408244. |
|
@sipa Small note:
The method implementation does support birth times, in the |
|
Concept ACK Other than the quirks that |
The new ImportPrivateKey method is to be used by importmulti when user provides a private key.
da1e008 to
1582698
Compare
| Needs rebase |
|
Closing as too many aspects of this are up in the air. |
Partially addresses #12703.
Fully addresses #9694.
This implementation simply uses the existing
importprivkeycode (moved into a separateImportPrivateKeymethod), and does not support redeem scripts, internal, pubkeys, or keys options.One question is if this should be simplified to where a user can put private keys in
keysand leavescriptPubKeyempty, or if it makes more sense to add a new field as I do here.Another question is whether this should be incorporated more into how
importmultiworks, rather than basing it off ofimportprivkey(although with the timestamp argument, it seems like it does all we want it to).(I was initially planning on deriving the arguments for
ProcessImportand letting it do its thing, but realized there can be multiple scriptPubKeys for one private key, so I'd have to callProcessImportmultiple times, with the same private key.. which will trigger an error.)