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

Feature: Import wallet using Keplr private key in TerraStation (includes basic solution) #61

Open
asotirov opened this issue Apr 21, 2022 · 0 comments
Labels
enhancement New feature or request

Comments

@asotirov
Copy link

asotirov commented Apr 21, 2022

Right now you cannot use the private key from the Keplr extension and import the wallet in TerraStation.

This could be crucial for some users, because some Keplr accounts used Google login to generate their access to Keplr extension and do not have their mnemonics.
However, they do have the private key which should be good enough for everything that has to do with that single Cosmos universe wallet.
My suggestion is to add a simple form that allows to input a private key, account alias, terra address (probably not needed) and password and it will import an account from the hex encoded private key (such as the one Keplr provides)

Meanwhile if stumbles uppon this, here is how to generate the Terra private key (used in "Add wallet > Import wallet") from the Keplr hex encoded private key (copied from "Select Account > ... three-dots > View Private Key".

const KEPLR_PRIVATE_KEY = "keplr_private_key_without_0x"
const TERRA_ADDRESS_IN_KEPLR = "keplr_Terra_address"
const NAME = "account_alias_to_be_used_in_terra_station"
const PASSWORD_IN_TERRA = "password_same_as_terra_station_import_wallet_screen_when_importing"
const ENCRYPTED_KEY= encrypt(KEPLR_PRIVATE_KEY, PASSWORD_IN_TERRA)
const key = Buffer.from(`{
    "name":"${NAME}",
    "address":"${TERRA_ADDRESS_IN_KEPLR}",
    "encrypted_key":"${ENCRYPTED_KEY}"
}`).toString('base64')

The encrypt method is this one https://github.com/terra-money/station/blob/f55a28de9812f72bb36f9072cb86e54f4e64efc7/src/utils/terra-keystore.ts#L6

this is a copy of the station-legacy issue

@alecande11 alecande11 added the enhancement New feature or request label Dec 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants