Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Feature request: Support lnd AEZEED seed import #120

Open
jimbojw opened this issue May 4, 2021 · 1 comment
Open

Feature request: Support lnd AEZEED seed import #120

jimbojw opened this issue May 4, 2021 · 1 comment
Labels
enhancement New feature or request low Low priority

Comments

@jimbojw
Copy link
Contributor

jimbojw commented May 4, 2021

Background: Instead of using BIP-39, the lnd lightning implementation uses a cipher seed scheme called AEZEED. Implementation (Go) and details here: https://github.com/lightningnetwork/lnd/tree/master/aezeed

Feature request: Support the lnd AEZEED cipher seed format as an input mechanism in the Sparrow software wallet import dialog. This would allow users to recover/manage on-chain balances from an lnd wallet.

Workaround: A tool called guggero/chantools has a command called showrootkey that can retrieve the BIP-32 xprv. As of Sparrow v1.4.0, this can be imported directly in the software wallet import dialog.

Implementation notes: The part of the chantools code that converts the AEZEED mnemonic into the xprv starts on line 104 of lnd/aezeed.go:

	var mnemonic aezeed.Mnemonic
	copy(mnemonic[:], cipherSeedMnemonic)

	// If we're unable to map it back into the ciphertext, then either the
	// mnemonic is wrong, or the passphrase is wrong.
	cipherSeed, err := mnemonic.ToCipherSeed(passphraseBytes)
	if err != nil {
		return nil, time.Unix(0, 0), fmt.Errorf("failed to decrypt "+
			"seed with passphrase: %v", err)
	}
	rootKey, err := hdkeychain.NewMaster(cipherSeed.Entropy[:], params)
	if err != nil {
		return nil, time.Unix(0, 0), fmt.Errorf("failed to derive " +
			"master extended key")
	}
	return rootKey, cipherSeed.BirthdayTime(), nil

It looks like the mnemonic.ToCipherSeed() method is responsible for converting the AEZEED mnemonic into entropy bits. Note that hdkeychain is from btcsuite/btcutil.

@6102bitcoin 6102bitcoin added the enhancement New feature or request label May 20, 2021
@6102bitcoin
Copy link
Collaborator

Outstanding Action: As with WIF paper wallet import, nice to have but may be significant work for a niche feature.
Proposed Priority: Low

@6102bitcoin 6102bitcoin added the low Low priority label May 23, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
enhancement New feature or request low Low priority
Projects
None yet
Development

No branches or pull requests

2 participants