Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: raslimali on June 05, 2020, 03:10:06 PM



Title: where are private keys stored?
Post by: raslimali on June 05, 2020, 03:10:06 PM
Hello community. Where does the blockchain store private keys for bitcoin addresses? They must really be stored somewhere. If I have for an example an online wallet with a private key, I think my private key is stored somewhere and not in my PC.


Title: Re: where are private keys stored?
Post by: AB de Royse777 on June 05, 2020, 03:18:08 PM
Quote
Private keys are generated by a complex mathematical algorithm outside the blockchain network. The public key and address are then generated from the private key automatically during each transaction. Both keys are stored inside a wallet file and managed by the wallet software.
Rerence is here: https://hackernoon.com/bitcoin-safety-a-guide-on-how-to-keep-your-wallet-and-private-keys-secure-94cf7b7f4a00#:~:text=Private%20keys%20are%20generated%20by,managed%20by%20the%20wallet%20software.

So here the software is your bitcoin core.

Quote
Where does the blockchain store private keys for bitcoin addresses?
Blockchain is not storing any private key information.


Title: Re: where are private keys stored?
Post by: Maus0728 on June 05, 2020, 03:24:03 PM
Technically, they are not stored in the bitcoin network but rather in your bitcoin wallet, it is the only software who stores your key pair which are your public keys and private keys that allows you sign a transaction in the bitcoin network.

Keep in mind that if it is stored in your PC, you might consider that your private key is now compromised. In your case, if it is an online wallet, then it is more likely that that wallet in not holding your private keys which is not a good indication to store a large amount of BTC.


Title: Re: where are private keys stored?
Post by: batang_bitcoin on June 05, 2020, 03:31:01 PM
I have a different understanding with what you're asking. You have mentioned an online wallet and blockchain, let me ask you if you are pertaining to blockchain.com wallet? Most online wallets will provide you the recovery phrases but if that's the wallet that you'll use in storing most of your bitcoins, choose a better wallet like electrum.

I think my private key is stored somewhere and not in my PC.
In the first place, you shouldn't keep your private keys in your computer. It's advisable to write it on a paper or make an encrypted backup. Private keys are shown before you create a wallet.


Title: Re: where are private keys stored?
Post by: RapTarX on June 05, 2020, 04:05:07 PM
If we take an example, for instance, blockchain.com wallet, they create wallet for you which have encrypted private key. According to them, they don't have access to any user's wallet. On the other hand, custodial wallets hold the private key and they have access to it.
Read this for more info- https://bitcointalk.org/index.php?topic=2940300.msg30225995#msg30225995


Title: Re: where are private keys stored?
Post by: raslimali on June 05, 2020, 04:06:20 PM
Technically, they are not stored in the bitcoin network but rather in your bitcoin wallet, it is the only software who stores your key pair which are your public keys and private keys that allows you sign a transaction in the bitcoin network.

Keep in mind that if it is stored in your PC, you might consider that your private key is now compromised. In your case, if it is an online wallet, then it is more likely that that wallet in not holding your private keys which is not a good indication to store a large amount of BTC.
Thanks everyone for taking time to respond. But if private keys are not stored on blockchain, how does the block chain know if I entered a wrong or correct password? It must have it somewhere in its memory


Title: Re: where are private keys stored?
Post by: NeuroticFish on June 05, 2020, 04:12:25 PM
But if private keys are not stored on blockchain, how does the block chain know if I entered a wrong or correct password? It must have it somewhere in its memory

Are you confusing by chance Bitcoin's blockchain with a private web service called blockchain.com ?

Blockchain is a database. It doesn't have "its memory".


Title: Re: where are private keys stored?
Post by: seoincorporation on June 05, 2020, 04:18:06 PM
Hello community. Where does the blockchain store private keys for bitcoin addresses? They must really be stored somewhere. If I have for an example an online wallet with a private key, I think my private key is stored somewhere and not in my PC.

If you use an online wallet they have to hold your private keys, in that scenario, the service should have a way to encrypt the private key in the database. The risk about this is that someone can access your wallet if they hack your credentials.

The safe way to make your own addys is with vanitygen.


Title: Re: where are private keys stored?
Post by: raslimali on June 05, 2020, 04:19:56 PM
Let us take an example of an online wallet which I have and have private keys. It is on ethereum block chain from etherdelta. When you create an account there you get a private key. But is that private key only available or recognized when I use the device through which I created the account? It is definitely not because I can import my account to say a metamask extension to another device .


Title: Re: where are private keys stored?
Post by: raslimali on June 05, 2020, 04:26:59 PM
Hello community. Where does the blockchain store private keys for bitcoin addresses? They must really be stored somewhere. If I have for an example an online wallet with a private key, I think my private key is stored somewhere and not in my PC.

If you use an online wallet they have to hold your private keys, in that scenario, the service should have a way to encrypt the private key in the database. The risk about this is that someone can access your wallet if they hack your credentials.

The safe way to make your own addys is with vanitygen.
So in case of etherdelta for example, it is an online wallet, do they have my private key? When you open an account there you are given a private key.


Title: Re: where are private keys stored?
Post by: raslimali on June 05, 2020, 04:36:11 PM
But if private keys are not stored on blockchain, how does the block chain know if I entered a wrong or correct password? It must have it somewhere in its memory

Are you confusing by chance Bitcoin's blockchain with a private web service called blockchain.com ?

Blockchain is a database. It doesn't have "its memory".
I am just wondering if the blockchain has no memory how does it know whether the secret key i entered is correct or not.


Title: Re: where are private keys stored?
Post by: bob123 on June 05, 2020, 04:36:18 PM
Your private key is (or better: should be) only stored in your wallet on your PC / mobile / whatever device you are using.
They are not stored on the blockchain at all.

Your private key is used to sign transactions. These signatures can be verified using the corresponding public key.
No one needs access to your private key to verify signatures.



So in case of etherdelta for example, it is an online wallet, do they have my private key? When you open an account there you are given a private key.

In the case of etherdelta, they don't have your private key. The private key is generated locally in your browser.
You are not given the key from their server.



I am just wondering if the blockchain has no memory how does it know whether the secret key i entered is correct or not.

You don't ever enter your private key anywhere.
You sign a transaction using your private key. And everyone can verify it by using the public key.

For visualization:
A transaction = "I want to transact X BTC from address 1 to address 2
Then you sign the transaction using the private key of address 1.
Everyone can then verify the signature by using the public key of address 1.

Please note that this visualization is not completely technically correct. But it gives you an idea how it works.


Title: Re: where are private keys stored?
Post by: The Cryptovator on June 05, 2020, 05:18:06 PM
@OP just keep in mind, privet keys aren't genarated from blockchain. It doesn't make sense that your private keys stored into blockchain, because everything on the blockchain in public. Everyone can see whatever on the blockchain. I don't if you have experience create paper wallet. That means you are able to genarate private key in offline, so how it stored into blockchain?

As others already said, private keys use to sign in the transaction into blockchain to validate transaction. Regarding sign in ehtherdelta with private keys, it will show the associate address with that private keys and that key will be use to sign the transaction. Even you may sign in via random private keys on there if the formate is correct and the address associate with it will be visible there. Overall the private keys used to spend your funds.

The private keys stored only on the wallet software where you may sign the transaction. Even where you genarated from there isn't stored as well (if legit sites and open sources). Actually there isn't any login system with private keys.


Title: Re: where are private keys stored?
Post by: pakhitheboss on June 05, 2020, 06:00:46 PM
Hello community. Where does the blockchain store private keys for bitcoin addresses? They must really be stored somewhere. If I have for an example an online wallet with a private key, I think my private key is stored somewhere and not in my PC.

When you use an online wallet and a non custodial wallet you will remain tensed and aggregated as you do not have a clue about that wallet. Most of the information provided by blockchain.com is hidden. I went throught the same dilema. In my opinion it is the worst wallet for Bitcoin.

In 2020 you can download and use the best Bitcoin wallets, here is the list.

10 Best Bitcoin wallets for 2020 (https://cointikka.com/best-cryptocurrency-wallet/)


Title: Re: where are private keys stored?
Post by: bithisach on June 05, 2020, 09:01:21 PM
I have a different understanding with what you're asking. You have mentioned an online wallet and blockchain, let me ask you if you are pertaining to blockchain.com wallet? Most online wallets will provide you the recovery phrases but if that's the wallet that you'll use in storing most of your bitcoins, choose a better wallet like electrum.

I think my private key is stored somewhere and not in my PC.
In the first place, you shouldn't keep your private keys in your computer. It's advisable to write it on a paper or make an encrypted backup. Private keys are shown before you create a wallet.

I agree that electrum is the greatest tool out there for a "lite wallet", it's very complete.

For OP, the blockchain can't and shouldn't know your private keys, your private key is that, the key that opens the public address holding the bitcoins. The blockchain doesn't need to know the private key, it only needs the transaction hash to confirm whether the real owner of said public key is the one sending the funds, if it's correct, the transaction goes through, if it isn't, it's not.


Title: Re: where are private keys stored?
Post by: raslimali on June 06, 2020, 03:22:33 AM
I have a different understanding with what you're asking. You have mentioned an online wallet and blockchain, let me ask you if you are pertaining to blockchain.com wallet? Most online wallets will provide you the recovery phrases but if that's the wallet that you'll use in storing most of your bitcoins, choose a better wallet like electrum.

I think my private key is stored somewhere and not in my PC.
In the first place, you shouldn't keep your private keys in your computer. It's advisable to write it on a paper or make an encrypted backup. Private keys are shown before you create a wallet.

I agree that electrum is the greatest tool out there for a "lite wallet", it's very complete.

For OP, the blockchain can't and shouldn't know your private keys, your private key is that, the key that opens the public address holding the bitcoins. The blockchain doesn't need to know the private key, it only needs the transaction hash to confirm whether the real owner of said public key is the one sending the funds, if it's correct, the transaction goes through, if it isn't, it's not.
It is still confusing. How does the blockchain know if I am the real owner of the public address if it does not know my real identity (private key)??


Title: Re: where are private keys stored?
Post by: raslimali on June 06, 2020, 03:28:02 AM
I am for example using etherdelta and they have an option to import an account. I insert the public key then i go to the next step to enter the private key. Then I just enter a string of letters and numbers then it says invalid key. This surely means that etherdelta knows what is the right private key associated with that public key. Otherwise it would accept whatever input.


Title: Re: where are private keys stored?
Post by: raslimali on June 06, 2020, 03:31:06 AM
I have a different understanding with what you're asking. You have mentioned an online wallet and blockchain, let me ask you if you are pertaining to blockchain.com wallet? Most online wallets will provide you the recovery phrases but if that's the wallet that you'll use in storing most of your bitcoins, choose a better wallet like electrum.

I think my private key is stored somewhere and not in my PC.
In the first place, you shouldn't keep your private keys in your computer. It's advisable to write it on a paper or make an encrypted backup. Private keys are shown before you create a wallet.

I agree that electrum is the greatest tool out there for a "lite wallet", it's very complete.

For OP, the blockchain can't and shouldn't know your private keys, your private key is that, the key that opens the public address holding the bitcoins. The blockchain doesn't need to know the private key, it only needs the transaction hash to confirm whether the real owner of said public key is the one sending the funds, if it's correct, the transaction goes through, if it isn't, it's not.

Then should we say that the only one who knows my private key is my public address?


Title: Re: where are private keys stored?
Post by: Tolosi on June 06, 2020, 03:51:07 AM
The core of the bitcoin protocol is in the eliptic curve math. Owner of the private key generates a transaction message and a signature of that message. Part of the transaction message is the that signature. Network can check if the signature is valid without the private key. Only transactions with valid signatures area accepted by the network. That is the beauty of the elliptic curve math. Your bitcoin address is derived from the private key using again eliptic curve and hash functions. Those functions are one way only. Somethimes math is beautiful. This is the case here for sure.


Title: Re: where are private keys stored?
Post by: bob123 on June 06, 2020, 10:51:41 AM
I am for example using etherdelta and they have an option to import an account. I insert the public key then i go to the next step to enter the private key. Then I just enter a string of letters and numbers then it says invalid key. This surely means that etherdelta knows what is the right private key associated with that public key. Otherwise it would accept whatever input.

Etherdelta - their server - does not know anything.
The local javascript applicatoin which is running inside your browser tells you that the private key does not match the public key.



Then should we say that the only one who knows my private key is my public address?

?
When you sign a transaction (as i have described in my post earlier), you are using your private key.
Everyone in the network can then verify it using the public key.

Whether you or someone else (with access to your private key) signed the transaction does not matter.


Title: Re: where are private keys stored?
Post by: raslimali on June 08, 2020, 07:55:00 AM
Your private key is (or better: should be) only stored in your wallet on your PC / mobile / whatever device you are using.
They are not stored on the blockchain at all.

Your private key is used to sign transactions. These signatures can be verified using the corresponding public key.
No one needs access to your private key to verify signatures.



So in case of etherdelta for example, it is an online wallet, do they have my private key? When you open an account there you are given a private key.

In the case of etherdelta, they don't have your private key. The private key is generated locally in your browser.
You are not given the key from their server.



I am just wondering if the blockchain has no memory how does it know whether the secret key i entered is correct or not.
Thanks for replying. But my logic is still troubled. Let us say I have imported a wallet from etherdelta to a metamask extension which I have on a different pc from the one I used to create my etherdelta account. If as someone here said that private wallets are created and stored locally in my browser, how does the other computer know if the private key I am now entering on metamask to import an account is correct or not?
You don't ever enter your private key anywhere.
You sign a transaction using your private key. And everyone can verify it by using the public key.

For visualization:
A transaction = "I want to transact X BTC from address 1 to address 2
Then you sign the transaction using the private key of address 1.
Everyone can then verify the signature by using the public key of address 1.

Please note that this visualization is not completely technically correct. But it gives you an idea how it works.


Title: Re: where are private keys stored?
Post by: raslimali on June 08, 2020, 07:56:01 AM
Thanks for replying. But my logic is still troubled. Let us say I have imported a wallet from etherdelta to a metamask extension which I have on a different pc from the one I used to create my etherdelta account. If as someone here said that private wallets are created and stored locally in my browser, how does the other computer know if the private key I am now entering on metamask to import an account is correct or not?


Title: Re: where are private keys stored?
Post by: bob123 on June 08, 2020, 08:56:23 AM
[...] how does the other computer know if the private key I am now entering on metamask to import an account is correct or not?

A private key basically is just a big random number.
When you import a private key into a wallet, it derives the public key and the address.

If there is nothing wrong (e.g. sanity checks / amount of bits), it is a valid private key and will therefore produce a valid public key and address.


Title: Re: where are private keys stored?
Post by: raslimali on June 21, 2020, 03:32:45 AM
Your private key is (or better: should be) only stored in your wallet on your PC / mobile / whatever device you are using.
They are not stored on the blockchain at all.

Your private key is used to sign transactions. These signatures can be verified using the corresponding public key.
No one needs access to your private key to verify signatures.



So in case of etherdelta for example, it is an online wallet, do they have my private key? When you open an account there you are given a private key.

In the case of etherdelta, they don't have your private key. The private key is generated locally in your browser.
You are not given the key from their server.
So can someone access my browser cache and find the key?


I am just wondering if the blockchain has no memory how does it know whether the secret key i entered is correct or not.

You don't ever enter your private key anywhere.
You sign a transaction using your private key. And everyone can verify it by using the public key.

For visualization:
A transaction = "I want to transact X BTC from address 1 to address 2
Then you sign the transaction using the private key of address 1.
Everyone can then verify the signature by using the public key of address 1.

Please note that this visualization is not completely technically correct. But it gives you an idea how it works.


Title: Re: where are private keys stored?
Post by: raslimali on June 21, 2020, 03:36:26 AM
So is it right to say in case of etherdelta the private key is stored in my browser cache? If yes that means anyone who can access my cache can also see my key?


Title: Re: where are private keys stored?
Post by: xhomerx10 on June 21, 2020, 03:40:40 AM
Quote
Private keys are generated by a complex mathematical algorithm outside the blockchain network. The public key and address are then generated from the private key automatically during each transaction. Both keys are stored inside a wallet file and managed by the wallet software.
Rerence is here: https://hackernoon.com/bitcoin-safety-a-guide-on-how-to-keep-your-wallet-and-private-keys-secure-94cf7b7f4a00#:~:text=Private%20keys%20are%20generated%20by,managed%20by%20the%20wallet%20software.

So here the software is your bitcoin core.

Quote
Where does the blockchain store private keys for bitcoin addresses?
Blockchain is not storing any private key information.


 LOL Hacker noon article.

" i. A private key

This is a 64-character long code that includes any blend of the letters A-F and the numbers 1–9.
"


Safety guide FAIL!



Title: Re: where are private keys stored?
Post by: bob123 on June 21, 2020, 12:48:10 PM
So is it right to say in case of etherdelta the private key is stored in my browser cache? If yes that means anyone who can access my cache can also see my key?

I don't know how etherdelta works excactly.
But it is not in the cache. It is either in the storage of your browser (most likely since i guess you don't have to "upload" it manually, right?) or a file on your computer (if you need to choose the file each time by "uploading" it).

In both cases. If someone has access to your browser (i.e. by having access to your device), and the wallet file / private keys are not encrypted, they have full access, yes.


Title: Re: where are private keys stored?
Post by: raslimali on June 21, 2020, 04:43:55 PM
So is it right to say in case of etherdelta the private key is stored in my browser cache? If yes that means anyone who can access my cache can also see my key?

I don't know how etherdelta works excactly.
But it is not in the cache. It is either in the storage of your browser (most likely since i guess you don't have to "upload" it manually, right?) or a file on your computer (if you need to choose the file each time by "uploading" it).

In both cases. If someone has access to your browser (i.e. by having access to your device), and the wallet file / private keys are not encrypted, they have full access, yes.
Thanks for your insights. My worry is that since when someone opens an account with etherdelta by simply clicking NEW ACCOUNT, you get a public address and a private key which you are prompted to copy and save it somewhere else, but as long as you are trading on etherdelta there is no way to log out and log in again so your public address remains there on your browser alongside with your private key. If someone gets hold of your computer it is just a matter of clicking EXPORT KEY and he has your key! The only way to log out there is to remove account. That means when you want to trade again you have to import your account!


Title: Re: where are private keys stored?
Post by: raslimali on June 21, 2020, 04:59:50 PM
So is it right to say in case of etherdelta the private key is stored in my browser cache? If yes that means anyone who can access my cache can also see my key?

I don't know how etherdelta works excactly.
But it is not in the cache. It is either in the storage of your browser (most likely since i guess you don't have to "upload" it manually, right?) or a file on your computer (if you need to choose the file each time by "uploading" it).

In both cases. If someone has access to your browser (i.e. by having access to your device), and the wallet file / private keys are not encrypted, they have full access, yes.
Thanks for your insights. My worry is that since when someone opens an account with etherdelta by simply clicking NEW ACCOUNT, you get a public address and a private key which you are prompted to copy and save it somewhere else, but as long as you are trading on etherdelta there is no way to log out and log in again so your public address remains there on your browser alongside with your private key. If someone gets hold of your computer it is just a matter of clicking EXPORT KEY and he has your key! The only way to log out there is to remove account. That means when you want to trade again you have to import your account!

I do not have to upload it or a file so your assumption is correct.


Title: Re: where are private keys stored?
Post by: khaled0111 on June 21, 2020, 10:17:25 PM
So is it right to say in case of etherdelta the private key is stored in my browser cache? If yes that means anyone who can access my cache can also see my key?
the safest way to use Ethetdelta is to connect to it using MetaMask. This way you will be sure that your private key never leaves your computer. Whenever you want to make a transaction you will be asked to sign it using MetaMask and you don't have to provide the PK.
One more thing, ED uses a smart contract and basically you have to deposit your coins on that smart contract to be able to trade them. AFAIK, the private key you create using ED is used to interact with the contract and is saved only on your browser. If you lose it, thete is no way to recover it and no one have access to it unless your computer gets compromised or you log in to a phishing website.


Title: Re: where are private keys stored?
Post by: DoublerHunter on June 21, 2020, 10:27:47 PM
So is it right to say in case of etherdelta the private key is stored in my browser cache? If yes that means anyone who can access my cache can also see my key?
^ Probably yes, in this case, don't use your main wallet when you are using the Etherdelta exchange platform. This is what I had did before when I was active collecting token from the airdrop and sell on the DEX. Make a brand new Myethereum wallet as your disposable wallet to import your private key, either me, I did not feel safe trusting your private on DEX exchange. 
Nevertheless, the suggestion above was right. Metamask is very safe to use but there are certain disadvantages of using chrome extension that I don't like.


Title: Re: where are private keys stored?
Post by: rathaha10 on June 21, 2020, 11:10:07 PM
Hello community. Where does the blockchain store private keys for bitcoin addresses? They must really be stored somewhere. If I have for an example an online wallet with a private key, I think my private key is stored somewhere and not in my PC.

To my understanding, i believe you are talking about the blockchain wallet platform that provides wallet for bitcoin and other top assets on both web and mobile apps and not Blockchain as the technology behind cryptocurrency. Blockchain wallet is a custodian wallet and they have access to your private keys and to certain extent even your  activities on the wallet platform. However, if your to use a non custodian wallet, you will be the one responsible for keeping your keys safe and it will not be on any server unless you uploaded it


Title: Re: where are private keys stored?
Post by: bitcoinst on June 22, 2020, 10:55:00 PM
Let us take an example of an online wallet which I have and have private keys. It is on ethereum block chain from etherdelta. When you create an account there you get a private key. But is that private key only available or recognized when I use the device through which I created the account? It is definitely not because I can import my account to say a metamask extension to another device .

It all depends on the program code, if the source code is open, then finding out whether the application stores private keys is not difficult.
There are applications that store all the information in the root of the phone, as a rule, these applications come from intruders.


Title: Re: where are private keys stored?
Post by: Stedsm on June 22, 2020, 11:42:00 PM
Hello community. Where does the blockchain store private keys for bitcoin addresses? They must really be stored somewhere. If I have for an example an online wallet with a private key, I think my private key is stored somewhere and not in my PC.

It is stored on your PC only. If not, how will the wallet access the same and give you back your public keys in return?
It's you who need to store them at a safe and secure place like -
1. Paper wallet
2. Hardware wallets
3. Cryptosteel
4. Memory card or USB drive (not just one but few copies)