feat(#93): wallet export/import (Lotus hex-KeyInfo) + import-lotus#106
Merged
Conversation
- 'lantern wallet export <addr>' prints hex(JSON(KeyInfo)), the exact wire format 'lotus wallet export' uses, so keys round-trip between Lotus and Lantern in either direction. - 'lantern wallet import [hex|-]' imports one key from arg or stdin (pipe lotus wallet export straight in). - 'lantern wallet import-lotus <repo>' walks <repo>/keystore, decodes the base32 (multiformats RawStdEncoding, same as Lotus fsrepo) filenames, filters wallet-* entries (libp2p host keys, jwt secrets etc are skipped), parses KeyInfo JSON and imports each key. - Everything lands in Lantern's passphrase-protected keystore via the existing wallet.Import; nothing is written to disk unencrypted. - go-base32 promoted from indirect to direct dep (already in the tree via libp2p). Tests: fake Lotus repo keystore round-trip (base32 names, wallet-* filtering, non-base32 junk skipped, imported keys sign), hex wire format round-trip, ~ expansion. Installer full-tier import question deferred to the #87 installer polish pass - the CLI command is the load-bearing piece.
33 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the #93 wallet migration surface:
lantern wallet export <addr>— hex(JSON(KeyInfo)), the exactlotus wallet exportwire format; keys round-trip both directions.lantern wallet import [hex|-]— one key from arg or stdin.lantern wallet import-lotus <repo>— bulk import: walks<repo>/keystore, decodes base32 filenames (multiformats RawStdEncoding, same as Lotus fsrepo), filterswallet-*(host keys/jwt secrets skipped), imports each KeyInfo.Everything lands in Lantern's passphrase-protected keystore via the existing
wallet.Import; nothing unencrypted touches disk.Tests: fake Lotus repo round-trip (base32 names, filtering, junk skipped, imported keys sign), hex wire round-trip, ~ expansion. Installer-question half of #93 deferred to the #87 installer polish pass; noting that on the issue.
Closes #93.