How import private key to Keplr extension - metamask

I export the private key from metamask then import to Keplr wallet.
But the new wallet got diff address with the old one in metamask.
So how can I do in this case?

When I did this import with ONE to Metamask staking.one read the ONE address even though it had a different address displayed in Metamask on the EVM side. Check the block chain explorer to verify funds and move a tiny amount for proof of function

Related

How to import an account into the NEAR wallet using only the private key (no seedphrase)

In this post, I'll run through how you can import an account into the NEAR Wallet using only your private key. This is useful when you've created accounts (or sub-accounts) using the CLI or near-api-js and only have access to the private key.
To import the account, simply click this URL and replace the YOUR_ACCOUNT_ID and YOUR_PRIVATE_KEY.
testnet:
https://wallet.testnet.near.org/auto-import-secret-key#YOUR_ACCOUNT_ID/YOUR_PRIVATE_KEY
mainnet:
https://wallet.near.org/auto-import-secret-key#YOUR_ACCOUNT_ID/YOUR_PRIVATE_KEY
FWIW you can find the source reference for this URL here https://github.com/near/near-wallet/blob/f6bc62abd7b28213b40ceb9d5371fe3b7a6a6b28/packages/frontend/src/components/Routing.js

Need help importing account from wallets such as MetaMask, Coinbase, etc into Brownie

Apologize in advance if this question was already asked before.
I was looking for a way to programmatically pull the account from MetaMask (or some other wallet) and add it to brownie. The problem I keep facing is that I can't add the account in Brownie without knowing the private key/ keystore file. As far as I can tell, there really isn't a direct way to programmatically get the private key from MetaMask.
How am I supposed to import a real account into brownie? Maybe there is a way other than using a private key or a keystore file?
*Yes, I know I can export the private key from MetaMask, but that can't be done programmatically.
I also looked into some eth_requestAccounts method that Metamask has in its documentation, but that still didn't seem to answer my question.

How to add a ledger-enabled account created outside of near wallet to the near wallet?

I have an account which was initially created via near-cli.
I then geneated a ledger key:
near generate-key key --useLedgerKey="44'/397'/0'/0'/2'"
And added it to the account:
near add-key <account_id> <the key from the previous step>
I now open the wallet, click "Access your account", "Ledger Recovery", "Sign in with Ledger", "Sign In".
At this stage it asks me to confirm the public key, though doesn't really show which public key I am approving. I approve it on the ledger.
It asks me for the account id, I enter it. It says "user found".
I confirm, and it errors out with "No accounts are associated with this Ledger device. You must first create an account, then add this Ledger to it to login."
How do I get around it? Am I using the wrong path when generating the key?
Currently, the NEAR Wallet only supports the default Ledger path:
"44'/397'/0'/0'/1'"
If you add the public key that corresponds to this HD path to your account, you should be able to login successfully.
near generate-key key --useLedgerKey="44'/397'/0'/0'/1'"
Unfortunately this is not supported yet. Current Ledger support in wallet is limited to use 44'/397'/0'/0'/1' HD key path. This is going to change in later releases.
In the meanwhile if you want to stake your tokens from multiple such accounts you might find this tool useful:
http://multistaker.near.org/
The NEAR wallet now supports the updated flow which allows you to create your account using any ledger path from the CLI (as per your question), fund that account or implicit account (the 64 char nonsense string) with at least 1 NEAR and then add that account to your NEAR wallet. You can't add without funding the account since it takes NEAR to make the add.
To add to the wallet, on the wallet dropdown select "Import Account" and then click "Advanced Options" to bring up the HD path selector. Select the right HD path, plug in the ledger and good to go.
ATM Chrome isn't working with the wallet as per this post but firefox does.
There is currently an open path to import a private key into the NEAR Wallet. To my understanding, the wallet then creates another new keypair on the fly and adds it as a full access keypair, such that the wallet doesn't actually use or store the private key you just sent it after this transaction.
https://wallet.near.org/auto-import-secret-key#YOUR_ACCOUNT_ID/YOUR_PRIVATE_KEY
See also How to import an account into the NEAR wallet using only the private key (no seedphrase)

How do I sign a message with a newly created Near account in a 3rd party app?

I'm setting up a new Near account, and I want to use its keys to sign a message in an app I'm building. How can I do this?
I used the wallet.nearprotocol.com page to create an account. Then, I used nearlib to connect to the testnet, and verify the account's balance and public keys.
But I couldn't find a way to add the account into the localStorage key store or otherwise access a method to sign a message. Nor could I find a wallet plugin or extension that would provide me access.
Generally the idea is that you never transfer given private key between 2 devices / security contexts.
So normally instead of getting private key out of wallet you just want to generate new key pair and request wallet to add public key.
https://github.com/nearprotocol/nearlib/blob/master/src.ts/wallet-account.ts provides relatively easy way to do it for webapp.
Note that it limits access to a give contract ID, so if you need unrestricted access you basically just need to omit contractId.
See examples at https://near.dev/ for WalletAccount usage.

Detect the existence of a private key

I 'm trying to present the user a dialog to pick a certificate. Originally I used CryptUIDlgSelectCertificateFromStore with the "MY" store, but this results in picking all the certificates, where I only want the user to select between the
certificates that have private keys.
For that reason, I create a new memory store and store only the certificates for which a private key exists. I can use CryptAcquireCertificatePrivateKey to get a private key of a certificate, but this may result in a dialog box requesting a PIN for example. I don't want to use the CRYPT_ACQUIRE_SILENT_FLAG because a provider might want to show information on the key (not necessarily a pin or a smart card prompt).
Is there a way to know that there is a private key without actually acquiring it?
Thanks.

Resources