Skip to content
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

[Question] How to get the private key for a generated address? #732

Closed
nopara73 opened this issue Feb 4, 2018 · 13 comments
Closed

[Question] How to get the private key for a generated address? #732

nopara73 opened this issue Feb 4, 2018 · 13 comments

Comments

@nopara73
Copy link

nopara73 commented Feb 4, 2018

Assuming I'm using the lnd daemon. I don't seem to find a way to do this. Maybe I can get the master extended private key somehow? Or am I supposed to do it manually? Find the wallet file, decrypt it and go on with my life?

@nopara73 nopara73 changed the title [Question] How to get a private key for a generated address? [Question] How to get the private key for a generated address? Feb 4, 2018
@Roasbeef
Copy link
Member

Roasbeef commented Feb 4, 2018

There's no way to extract private keys from the daemon currently. All key handling and signing are abstracted behind a set of core interfaces. Assuming a btcwallet implementation for these interfaces, one would need to find the wallet file, decrypt it, etc.

What use case do you have in mind?

@nopara73
Copy link
Author

nopara73 commented Feb 4, 2018

@Roasbeef Thanks for your swift reply!

There's no way to extract private keys from the daemon currently.

Is it a security consideration or it just wasn't implemented?

What use case do you have in mind?

I am looking at the possibility of replacing HiddenWallet's back end, which is custom code right now with lnd, because of Neutrino and the possibility of seamless future LN integration. I must sign an arbitrary message, build transactions with shuffled input and output indexing, sign CoinJoin transactions partially, these comes to my mind, but there are many more. As I also figured there is no transaction hex propagation through the daemon, either, so I am starting to think there are too many walls to climb here.

@nopara73 nopara73 closed this as completed Feb 4, 2018
@Roasbeef
Copy link
Member

Roasbeef commented Feb 5, 2018

Well it's just that we haven't added such an interface yet, not that we'll never do so.

@halseth
Copy link
Contributor

halseth commented Feb 5, 2018

Well ww do have the SignMessage RPC, maybe it could be extended to specify which address to sign for?

@plantOS
Copy link

plantOS commented Jun 15, 2018

Any progress on this?

@patch-master
Copy link

Hi there, any progress on enabling the extraction of private keys?

@merclyn
Copy link

merclyn commented Jan 17, 2019

Could we export the extended public Key?

@jacohend
Copy link

@Roasbeef I second @merclyn, I need to get my wallet's public key so I can use the SignOutputRaw grpc, which requires either a "key_locator" or a wallet public key as an argument

@yohaaan
Copy link

yohaaan commented Nov 12, 2019

any update on this? I'd use private key extraction as well

@AzerChainToken
Copy link

Hello people! Haved a any tools for export private key from Zap Wallet?

@guggero
Copy link
Collaborator

guggero commented Dec 16, 2019

There is a PR that adds a command line utility to extract the xprv HD extended root key and individual private keys: #2373

@jacohend you can find out the derivation path for the node public key here: https://github.com/lightningnetwork/lnd/blob/master/keychain/derivation.go
It is m/1017'/0'/6'/0/0

@KriptoQraf
Copy link

I'm new and I didn’t understand anything

@testnetprotonmail
Copy link

bump, please allow export of private keys, or enable rbf in PSBT.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests