Private key from myalgo wallet

Hello! :blush:

I’m new and detected Algorand, it seems to be very interesting!
At Myalgo wallet I tried to create a new wallet but I didn’t found my private key. From Bitcoin I know we have always public key and private key, where can I find my private key at Algorand?

Plz help I don’t want to make a mistake.

xoxo
Anna ~cutedoggo~ :blush:

2 Likes

It is said that the private key can ben calculated from the memonic words.

I guess that the private key is stored as a ciphertext in the system.

Hi,

When you create a new wallet (Add Wallet), the wallet will show all the security phrase that is the equivalent to the private key. Then, it will ask you to verify it asking for some of the words in the list. That’s the private key where your algos are stored (25 words).

As an alternative and the recommended way to store crypto in general, you can use Ledger Nano S. You will need to setup it backuping the 24 words but they will be inaccessible from your computer and it is tamper proof.

Best,
Pablo

3 Likes

Ok, got it. So my private key is a combination of 25 words instead of BTC random letter+number combination.
Many thanks for your help! :blush:

I don’t own much crypto yet and it would be very expensive compared to what I need to store but security is very important, I agree.
Do you know if Algorand also has offline creation like MEW or similar where I can download it on GitHub and generate address offline?

1 Like

You can create a wallet using myalgo, the private key is generated offline and stored in your browser locally. Just go to Add Wallet -> Create Wallet.
If you are storing small amounts of algos, it is good enough but it isn’t recommended for large amounts.

Best,
Pablo

1 Like

Ok, I will try

Have a nice weekend :blush:

1 Like

Hello, Is there exist a way that get my private key?
I found document: private key → 25 words, but 25 words could not → private key, Is it right?
Hope get your help, Thank you very much.

1 Like

From your 25 words the private key (and for that matter the public key, too) can be produced with an API call. E.g. in JavaScript,

const account1_mnemonic = "write the twenty five words here";
const recoveredAccount1 = algosdk.mnemonicToSecretKey(account1_mnemonic);
console.log('Private key: '+ recoveredAccount1.sk);
console.log('Address: ' + recoveredAccount1.addr);

So, the process is: “25 word mnemonic” → “seed” → “private and public key”
and “public key” → “address”

2 Likes

Thank you very much!!! :grinning: :grinning:

Actually it is not 25 random words and there must be some consistency in these words (there is 2048 words for this)…

For example this is first 25 allowed words:

abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress actual adapt

the very first valid mnemonic is

abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress abandon grief

with address NKPMVHFNJGAFVPCSPAYR43USJBJ4SMKQSHDSFQ5WXZN6KT3PYCEE3DIPMM

this is python script to get the public key from the address

import algosdk

mnemonic = "abandon ability able about above absent absorb abstract absurd abuse access accident account accuse achieve acid acoustic acquire across act action actor actress abandon grief"
to_public_key = algosdk.mnemonic.to_public_key(mnemonic)
print("Account address: " + to_public_key + " "+mnemonic)

About the security…

Does anybody know if it is safe to human pick few words and then randomly generate other words?

Hello. This is a script with which you can get a private key. This private key can be imported, for example, into a trust wallet. I checked - the wallet address is the same. The author of the script is Don Mega from the Algorand group, all thanks go to him.

import algosdk
import base64

mnemonic = “Your 25 words separated by spaces without commas”
pk = algosdk.mnemonic.to_master_derivation_key(mnemonic)
print("base 64 encoded: ",pk)
pk_bytes = base64.b64decode(pk)
pk_hex = pk_bytes.hex()
print("hex: ",pk_hex)

hex is what do you need. I imported it into the Trust wallet and it works. But there is a problem - trust wallet supports only ALGO token for now. So, if you have any other tokens in algo wallet, you won’t see them in trust.wallet. Only algo token. I don’t know abourt others wallet apps, will try.=)