Author

Topic: Controlling Lightning Wallet BTC Using Electrum (Read 299 times)

member
Activity: 138
Merit: 14
I just want to make it clear here, that I do NOT have any bitcoin stuck in a lightning wallet.

The peach desktop lightning wallet from bitfury is currently able to receive and send my bitcoin with no problems.

I only started this thread because I wasn't able to control my bitcoin in the lightning wallet by transferring their seed to electrum. This thread has been a very useful resource in explaining why that happened and what needs to be done IF FOR SOME REASON TBD IN THE FUTURE, I would no longer have access to the Peach wallet.
legendary
Activity: 3374
Merit: 3095
BTC price road to $80k
I tried inputting my 24 words in the gugger demo link, but the software just got stuck, and didn't spit out a seed. I googled for other ways to get AEZ back to something BIP-39 compatible, but nothing turned up. I guess this issue is something to watch out for in these early early days of lightning adoption

Check these two link below and maybe this is what you are looking for if ever your wallet is lost or if you can't access your wallet maybe these 2 links may help as I found it from google when searching past days ago.

- https://lightning-wallet.com/recovering-lost-balance#recovering-lost-balance
- https://lightning-wallet.com/reimbursing-funds-locked-in-a-lost-payment-channel#reimbursing-funds-locked-in-a-lost-payment-channel

You can see there if how to use your backup phrase.
member
Activity: 138
Merit: 14
You'd need to follow the process for converting those AEZ words back into a seed... then use that seed to generate the private keys that match the addresses that your coins are on (assuming that you can somehow close the lightning channels to "return" the remaining coins to the wallet).

I found this encoder/decoder: https://gugger.guru/blockchain-demo/#!/aezeed

was linked by the devs here: https://github.com/bitcoin-s/bitcoin-s-core/issues/342  but as they note:
Quote
aezeed online demo (NOTE: don't know who made this)

So, use at your own risk etc.

Also, theoretically, it SHOULD work with LND... as they seem to be using the same process.


I tried inputting my 24 words in the gugger demo link, but the software just got stuck, and didn't spit out a seed. I googled for other ways to get AEZ back to something BIP-39 compatible, but nothing turned up. I guess this issue is something to watch out for in these early early days of lightning adoption.

HCP
legendary
Activity: 2086
Merit: 4361
You'd need to follow the process for converting those AEZ words back into a seed... then use that seed to generate the private keys that match the addresses that your coins are on (assuming that you can somehow close the lightning channels to "return" the remaining coins to the wallet).

I found this encoder/decoder: https://gugger.guru/blockchain-demo/#!/aezeed

was linked by the devs here: https://github.com/bitcoin-s/bitcoin-s-core/issues/342  but as they note:
Quote
aezeed online demo (NOTE: don't know who made this)

So, use at your own risk etc.

Also, theoretically, it SHOULD work with LND... as they seem to be using the same process.
member
Activity: 138
Merit: 14
So, bottom line...if I lose access to the Peach wallet in the future, how can I access any BTC I may have stored there with these AEZ words?
HCP
legendary
Activity: 2086
Merit: 4361
...
Your wallet depends on LND which in turn creates the seeds for you (based on my understanding) and the seed scheme is not BIP39 but instead a modified version of it which they call AEZSeed (AEZ = easy authenticated-encryption method made easy) differences include addition of a version byte, a timestamp and using scrypt instead of PBKDF2 and using AEZ encryption! [2]
This is why you are getting "BIP 39 (checksum:failed)" exception in Electrum.
...
[2] https://github.com/lightningnetwork/lnd/blob/d541ebe3765bc0db9fe568332f7aabd3a2014612/aezeed/README.md
Thanks very much for this... I had gone digging through the code looking for the mnemonic generation sections, but had been unable to find anything... apparently, I didn't dig quite as far as you!  Tongue

So, while they are still using the standard BIP39 wordlist, they have a custom "seed <--> mnemonic" process which implements a couple of extra features... and results in "non-BIP39 compatible" seed mnemonics. Roll Eyes
member
Activity: 138
Merit: 14
I had to dig deep into LightningPeach source code[1] to figure this out and please note that I have little expertise in JavaScript so don't take this as review of the code.

Your wallet depends on LND which in turn creates the seeds for you (based on my understanding) and the seed scheme is not BIP39 but instead a modified version of it which they call AEZSeed (AEZ = easy authenticated-encryption method made easy) differences include addition of a version byte, a timestamp and using scrypt instead of PBKDF2 and using AEZ encryption! [2]
This is why you are getting "BIP 39 (checksum:failed)" exception in Electrum.

I don't know of any tool that you could use to convert your seed words to BIP32 extended master private key but it doesn't seem that hard to write a script to do that.

[1] https://github.com/LightningPeach/lightning-peach-wallet
[2] https://github.com/lightningnetwork/lnd/blob/d541ebe3765bc0db9fe568332f7aabd3a2014612/aezeed/README.md


Great response, thanks for taking the time to research this.
legendary
Activity: 1040
Merit: 2785
Bitcoin and C♯ Enthusiast
I had to dig deep into LightningPeach source code[1] to figure this out and please note that I have little expertise in JavaScript so don't take this as review of the code.

Your wallet depends on LND which in turn creates the seeds for you (based on my understanding) and the seed scheme is not BIP39 but instead a modified version of it which they call AEZSeed (AEZ = easy authenticated-encryption method made easy) differences include addition of a version byte, a timestamp and using scrypt instead of PBKDF2 and using AEZ encryption! [2]
This is why you are getting "BIP 39 (checksum:failed)" exception in Electrum.

I don't know of any tool that you could use to convert your seed words to BIP32 extended master private key but it doesn't seem that hard to write a script to do that.

[1] https://github.com/LightningPeach/lightning-peach-wallet
[2] https://github.com/lightningnetwork/lnd/blob/d541ebe3765bc0db9fe568332f7aabd3a2014612/aezeed/README.md
legendary
Activity: 3682
Merit: 1580
yeah electrum doesn't support lightning yet. that branch is still in development.
legendary
Activity: 2534
Merit: 6080
Self-proclaimed Genius
If that's the case, you can try importing your peach wallet's Master Private Key and import it through Electrum's "Use a Master Key" option.
I don't know how to extract it from peach wallet though.

One more problem though, you mentioned about lightning wallet BTC.
So if the funds are still in the channels, it wont be restored in your newly created wallet by simply importing the SEED or keys.
member
Activity: 138
Merit: 14
...On installation, I was given a 24 word seed.

I tried to create the same wallet in electrum to see if i could control the BTC in the Peach lightning wallet through electrum. I tried opening a wallet using all 3 paths (legacy, segwit, Bech32) with the seed...
What were the exact steps you tried? Were you just using "File -> New\Restore -> Standard Wallet -> I already have a seed -> [ENTER SEED] -> Next"?

or did you explicitly select the "BIP39 seed" option during the wallet setup? Huh


Quote
Can anyone explain why? Do they use different seed words when generating lightning wallets?
Fairly sure it is the "standard" BIP39 wordlist.


I'm not aware of another way to create a previously made wallet other than "File -> New\Restore -> Standard Wallet -> I already have a seed -> [ENTER SEED] -> Next"?, so that's what I did. After inputting the 24 words, the only way to continue is either to check the BIP-39 box, or to extend the word list.

Interestingly, I tried to go through the process again to see if I missed anything. After inputting the 24 words and checking BIP39 box and pressing OK, this time I noticed the words "BIP 39 (checksum:failed)"  to the left of the OPTIONS button (these words weren't in red or some other color, just regular black letters).

So maybe the peach wallet creators used something besides a BIP 39 word list (same thing electrum does) Huh
HCP
legendary
Activity: 2086
Merit: 4361
...On installation, I was given a 24 word seed.

I tried to create the same wallet in electrum to see if i could control the BTC in the Peach lightning wallet through electrum. I tried opening a wallet using all 3 paths (legacy, segwit, Bech32) with the seed...
What were the exact steps you tried? Were you just using "File -> New\Restore -> Standard Wallet -> I already have a seed -> [ENTER SEED] -> Next"?

or did you explicitly select the "BIP39 seed" option during the wallet setup? Huh


Quote
Can anyone explain why? Do they use different seed words when generating lightning wallets?
Fairly sure it is the "standard" BIP39 wordlist.
member
Activity: 138
Merit: 14
I don't find any solution about this in google it seems no one doing this.

What I found is this.
  • Eclaire uses a BIP49 segwit extension seed that it asks you to write down and save when it creates a BTC address for you
  • It doesn't save this anywhere on the phone
  • The funds you have tied in your LN channels, you would have to close each channel and they will withdraw to your BTC address
  • You can recover your BTC address (thus your funds) that you created using that seed outside Eclaire - to Electrum, Nano Ledger, anything that supports BIP49 seeds
  • The only funds you'd lose are if you have funds in your LN channels and your phone died, you lost your phone, etc. There is currently no backup for funds in your LN channels. The wallet warns you of this and tells you not to tie too much money to channels.

Can you try to change the derivation path to m/49'/0'/0'/0 or m/49'/0'/0'/2


Thanks for the reply the reddit info was good. However adding the 2 in the derivation path didn't fix the problem.
legendary
Activity: 3374
Merit: 3095
BTC price road to $80k
I don't find any solution about this in google it seems no one doing this.

What I found is this.
  • Eclaire uses a BIP49 segwit extension seed that it asks you to write down and save when it creates a BTC address for you
  • It doesn't save this anywhere on the phone
  • The funds you have tied in your LN channels, you would have to close each channel and they will withdraw to your BTC address
  • You can recover your BTC address (thus your funds) that you created using that seed outside Eclaire - to Electrum, Nano Ledger, anything that supports BIP49 seeds
  • The only funds you'd lose are if you have funds in your LN channels and your phone died, you lost your phone, etc. There is currently no backup for funds in your LN channels. The wallet warns you of this and tells you not to tie too much money to channels.

Can you try to change the derivation path to m/49'/0'/0'/0 or m/49'/0'/0'/2
member
Activity: 138
Merit: 14
I downloaded Peach wallet (bitfury's desktop lightning wallet) and am using that for now for lightning network (still buggy for me).

On installation, I was given a 24 word seed.

I tried to create the same wallet in electrum to see if i could control the BTC in the Peach lightning wallet through electrum. I tried opening a wallet using all 3 paths (legacy, segwit, Bech32) with the seed, but I couldn't see my lightning wallet BTC balance on electrum (the addresses for BTC receipt in the lightning wallet start with 3, looks like Segwit to me). As far as electrum is concerned  it recognizes the seed as a brand new wallet.

Can anyone explain why? Do they use different seed words when generating lightning wallets?
Jump to: