Pages:
Author

Topic: Public vs. private keys (Read 229 times)

full member
Activity: 182
Merit: 190
December 17, 2021, 10:27:23 AM
#22

Dammit, for the first few paragraphs (before the exchange getting hacked, I hope), it seemed the guy was talking about me!  Grin
True,  I've been researching for about 2+ months, not 2 weeks, and I still can't start, but, damn! Am I so typical? Shocked
legendary
Activity: 2450
Merit: 4415
🔐BitcoinMessage.Tools🔑
December 17, 2021, 02:17:45 AM
#21
The exchange wallet is not the same as your wallet. So in the exchange wallet you work only with your public key/address, because you don't really have access to your private key.
In the case of a centralized exchange, you have neither a personal wallet, private keys, addresses nor public keys. You will own nothing basically. Once you hand over your coins to an exchange, it has full control over them. What you see on your balance is not what you have just deposited (real coins) but an entry in their database with the amount they owe you. They receive your coins, add them to their reserves and give you a promise to pay you back once you request. Like any other promise, the promise to pay you may also be broken without an exchange facing any legal consequences. Here is a great article I found that explains things in detail:  Buy vs Own: Do You Really Own the Crypto You Just Bought?
full member
Activity: 182
Merit: 190
December 16, 2021, 02:49:36 PM
#20
The video is not from youtube, but from a Udemy course
What kind of Udemy course talks about exchanges? Or does it just talk about Bitcoin and how it works?

There's a whole lot of cryptocurrency courses (for trading, investing, robot making) on Udemy. So far I took 5 of them. Right now, I'm starting on a python course, so I can write a bot.

In any case, Now I'm starting to understand reality and how idiotic my initial question was.
It wasn't. You were just confused. Don't be discouraged to make questions, it's the only way to learn.

Thank you. You guys are great.
I have learnt a great deal from the Udemy courses, but sometimes there are things that seem to be considered a given, and are not for me. Thank you for the patience.  Smiley
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 16, 2021, 02:39:55 PM
#19
So the only way you have to send your funds to an external wallet would be to use the external wallet's public key. I'm guessing that wouldn't work the other way around...
Exactly.

The video is not from youtube, but from a Udemy course
What kind of Udemy course talks about exchanges? Or does it just talk about Bitcoin and how it works?

In any case, Now I'm starting to understand reality and how idiotic my initial question was.
It wasn't. You were just confused. Don't be discouraged to make questions, it's the only way to learn.
full member
Activity: 182
Merit: 190
December 16, 2021, 02:28:10 PM
#18
BlackHatCoiner: Oh, oh, nooooww I'm starting to get it. The exchange wallet is not the same as your wallet. So in the exchange wallet you work only with your public key/address, because you don't really have access to your private key. So the only way you have to send your funds to an external wallet would be to use the external wallet's public key. I'm guessing that wouldn't work the other way around...

Upgrade00: I'm not working with any exchange yet (which is part of the problem, I guess, as I don't have any personal experience. I'm just trying to address doubts I have before I sink any money on it.
The video is not from youtube, but from a Udemy course (which, now that I think of it, would open a whole 'nother can of worms). In any case, Now I'm starting to understand reality and how idiotic my initial question was.

Thank you all for the help. Smiley
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 16, 2021, 02:17:57 PM
#17
What exchange are you using? So you get two wallets automatically when registering?
I think he's just using it as an example.

Firstly, exchange wallets are usually non custodian
You mean they're usually custodial?

I do not clearly understand this part, however;
I think Berny needs to understand there are two ways to use bitcoin;

1. By owning the private keys.
2. By trusting another entity to do it for you.

However, it's oxymoron to use the second way unless you feel really comfortable in your exchange and/or trade. Bitcoin was created to avoid trusting a third party.
legendary
Activity: 2114
Merit: 2248
Playgram - The Telegram Casino
December 16, 2021, 02:11:16 PM
#16
Let me see if I can make my question a bit more clear: I open an account in an exchange. Automatically I get a wallet in that exchange. MY wallet.
I get another wallet. Also MY wallet.
What exchange are you using? So you get two wallets automatically when registering?

I can withdraw my coins from either one of the wallets, or I can receive the funds in the other one. To send the coins I need the private key from the wallet sending them. However, to receive the coins, I only need the public key from the wallet receiving the coins. At least that's what they show on the videos I watched.
If I understand you, One of the addresses is for sending out, i.e, you own the private keys, while you can use both for receiving?
Firstly, exchange wallets are usually custodian, so you probably do not own the private keys of any of the wallets. But lets take it that in this scenario, you do.
- Yes, you need the private keys to send,
- No, you do not need the public key to to receive, you only need the public address, both are not the same.

So it would make sense, so as to not expose your private key, to do the transaction from the sending wallet , which you can make with only the receiving wallet's public key.
I do not clearly understand this part, however;
- Your private keys are not exposed when you sign a transaction.
- Every private key associated to a bitcoin wallet has a public key and also a public address,
- Your public key is what is exposed when you sign a transaction, reason wallets change addresses after each transactions on some wallet software.

I don't know if I can upload a video in here, so as to show you guys what I mean.
You could just easily drop the youtube link.
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 16, 2021, 02:03:10 PM
#15
Dammit, I'm starting to feel like you guys are trying to explain a very simple concept to me, and I'm not getting it. I'm starting to feel like an idiot.
Don't. This is a difficult concept to understand at first. Here's the problem:  You've used to make transactions using an exchange. You should download a non-custodial wallet (like Electrum) instead and see how bitcoin works there.

The exchange won't show you any private keys. Instead, the only thing it gives you is the address you're supposed to give anyone who wants to send you money. It doesn't even give you the public key, to see how a public key looks like.

Let me see if I can make my question a bit more clear: I open an account in an exchange. Automatically I get a wallet in that exchange. MY wallet.
You open account in an exchange: It is automatically not your money. It's YOUR wallet, it's NOT YOUR money. It's someone else's who manages them for you, just like a bank.

I can withdraw my coins from either one of the wallets, or I can receive the funds in the other one.
If by withdrawing you mean to empty your balance by sending it to your other wallet, then you can both withdraw and receive.

To send the coins I need the private key from the wallet sending them.
Again, someone else has the private key, not you. So, you don't need any private key while you stay in the exchange just like you don't need the bank notes if you've given them to your bank. The exchange signs your transactions.
full member
Activity: 182
Merit: 190
December 16, 2021, 01:47:57 PM
#14
Dammit, I'm starting to feel like you guys are trying to explain a very simple concept to me, and I'm not getting it. I'm starting to feel like an idiot. Sad

Let me see if I can make my question a bit more clear: I open an account in an exchange. Automatically I get a wallet in that exchange. MY wallet.
I get another wallet. Also MY wallet.

I can withdraw my coins from either one of the wallets, or I can receive the funds in the other one. To send the coins I need the private key from the wallet sending them. However, to receive the coins, I only need the public key from the wallet receiving the coins. At least that's what they show on the videos I watched.
So it would make sense, so as to not expose your private key, to do the transaction from the sending wallet , which you can make with only the receiving wallet's public key.
I don't know if I can upload a video in here, so as to show you guys what I mean. It's a 27 minute video, so I don't know if I can upload something that big. In any case, it shows just that, not the withdrawal of the coins from a wallet, but the sending of the coins from the other one.

Please, somebody tell me if I'm making any sense at all. I'm starting to feel like I need help to count with my fingers... Sad
legendary
Activity: 1512
Merit: 7340
Farewell, Leo
December 16, 2021, 12:54:45 PM
#13
Berny, in cryptography there are the so-called “digital signatures”. A private key is a very large, random number and the public key is resulted from a special form of multiplication (whose division is considered impossible) between the private key and another known number. When you sign a message, you use the private key to form a valid signature. When you verify the signature of that message you use its public key. So, I can provide you a proof that I'm the owner of a particular public key, without having to reveal the private key.

When you want to spend an amount of bitcoins, you sign a transaction with that statement. When you want to receive, you give your bitcoin address and someone else signs a transaction in which they state what they spend and to who.

So, to answer your question:
But when do you use it?
Every single time you make a transaction.

If you want to withdraw your money from the exchange, you use your public key. But then, if you wanna send your money back to the exchange, you use the public key from your exchange's wallet?
If you want to withdraw your money from an exchange you give them an address and they lock their funds to that address. If you want to return money to the exchange you sign a transaction that spends to their address.

So using your private key would be limited to getting your money out of the system (cashing out)? Because even if you purchase something, it makes sense (at least from my completely uninformed point of view) to use the seller's public key to make the payment...
And how do the money get out of the system? The seller always prepared an invoice for you to pay. “Cashing out” bitcoins doesn't get money out of the system, it just transfers them to another person. Cash out, essentially, means trade BTC for USD/EUR etc.

the public key is nothing else than your deposit/withdrawal Bitcoin address.
A public key isn't an address. The address is an encoded version of the hash of the public key. I hope this didn't confuse anybody.

I recommend to read this thread:  Important terms that are frequently confused.
legendary
Activity: 2114
Merit: 2248
Playgram - The Telegram Casino
December 16, 2021, 12:53:51 PM
#12
Whoa! Hold on. Is there a difference (when talking about keys and addresses), between Bitcoin and other coins?
What I've seen is that, to transfer your coins from your exchange wallet to your software wallet, you use your software wallet's public key, and to transfer funds from your software wallet to your exchange's wallet, you use the exchange wallet's public key. Basically meaning you can keep your funds safe by never using your software wallet's private key. Do you need both?
Considering you are trying to understand the concept, I will say you should remove the part about the exchange wallet and understand the basics first, before trying to apply it to different concepts.

If you create a bitcoin wallet, what you own are set of keys (public and private) which you can use to access sets of inputs and outputs on the blockchain; all the keys are derived from the seed phrase.
Your private keys are derived from the seed phrase and is used to sign transactions, reason why it is commonly said, 'Not your keys, Not your coins'.
Your public keys are derived from your private keys, it sort of serves as a layer of security to verify the signature.
Your public address is a hash of the public key and is used to receive inputs to a specific wallet, it determines destination, sort of how a home address works.

This derivation pathway is not backward compatible, i.e, you cannot generate the public keys from the public address, or the private key from the public key.
To send a transaction, You need the private keys (and by extension the public keys, to check the signature),
To watch a wallet (only), you need the public keys,
To select the destination of an input, you need the public address.
With a non custodian wallet, which most exchange wallets are, you only have a public address which you use to receive inputs, when you send out you do not actually sign transactions, but only send a request to the exchange server to complete (sign) a transaction.
legendary
Activity: 2450
Merit: 4415
🔐BitcoinMessage.Tools🔑
December 16, 2021, 12:34:42 PM
#11
Whoa! Hold on. Is there a difference (when talking about keys and addresses), between Bitcoin and other coins?
What I've seen is that, to transfer your coins from your exchange wallet to your software wallet, you use your software wallet's public key, and to transfer funds from your software wallet to your exchange's wallet, you use the exchange wallet's public key. Basically meaning you can keep your funds safe by never using your software wallet's private key. Do you need both?
A cryptocurrency wallet is software that manages your private keys, signs the transactions you send to an exchange, generates the addresses you give an exchange to receive coins. Every time you send a transaction from your wallet, a private key is used to sign this transaction. Please note that you almost never see or interact with private keys directly, but your wallet does it every time you want to send coins to someone. An exchange does exactly the same: it signs a transaction with their private key and sends it to the address you gave them.
legendary
Activity: 2380
Merit: 5213
December 16, 2021, 12:27:50 PM
#10
What I've seen is that, to transfer your coins from your exchange wallet to your software wallet, you use your software wallet's public key, and to transfer funds from your software wallet to your exchange's wallet, you use the exchange wallet's public key.
For making any bitcoin transaction, whether it's made to a wallet or to an exchange, you need the recipient's address.
Note that although the recipient's address can be derived from the public key, but you always need to enter the address when making a transaction. I don't think there's any wallet or exchange accepting public keys when making a transaction.


Basically meaning you can keep your funds safe by never using your software wallet's private key. Do you need both?
Your private key is used only when you want to make a transaction from a non-custodial wallet.
As long as you don't intend to spend bitcoin from your non-custodial wallet, you don't need your private key.

Note that if you want your wallet to be 100% secure, you should create it on an air-gap device (a device which has been always offline and will never be online).
full member
Activity: 182
Merit: 190
December 16, 2021, 12:15:16 PM
#9
I feel you don't know how an exchange work.
You need to know the difference between an exchange and a non-custodial wallet.

If you hold your bitcoin on a non-custodial wallet, you have full control over your fund. If you want to make a transaction, your wallet needs your private key to sign the transaction.
If you want to withdraw a fund from the exchange, you don't need any private key. Because you are not the one who makes the transaction. You request the exchange to make a transaction and the transaction is signed by the exchange not you. In this case, the private key is owned by the exchange.

Your bitcoin address is what you need to receive bitcoin.
Let's say you want to send me bitcoin. I give you my bitcoin address and you send me bitcoin.


Whoa! Hold on. Is there a difference (when talking about keys and addresses), between Bitcoin and other coins?
What I've seen is that, to transfer your coins from your exchange wallet to your software wallet, you use your software wallet's public key, and to transfer funds from your software wallet to your exchange's wallet, you use the exchange wallet's public key. Basically meaning you can keep your funds safe by never using your software wallet's private key. Do you need both?

NeuroticFish: thank you, I  will read it. I know Exodus is not 100% open source, but Electrum is for Bitcoin only, and I intend to invest on several different coins. That's why I was interested in EToro, buy it's now out, as it offers a download button that downloads nothing, and instead tricks you into opening  an account with  them.

Mk4:  thank you, I will give that a read.
mk4
legendary
Activity: 2870
Merit: 3873
Paldo.io 🤖
December 16, 2021, 11:54:37 AM
#8
If you're fine without going too technical, then let's simplify it a bit.

Your public key(and addresses): your bank account number; whereas you can receive money freely
Your private key: your online banking login credentials(and 2fa); whereas you're going to need this to send out money

Hence why your should secure your private key, whereas it's mostly fine to give out your public key(besides privacy reasons, because blockchains are public).

BTW, I haven't started yet, I have downloaded Exodus, and I'm now trying to download EToro, as it's said to be safer. Far as I know, both are non custodian wallets, right?
Exodus is non-custodial but not open-source as far as I know; and eToro is custodian.

Here's some reading material for you: https://cryptosec.info/wallets
legendary
Activity: 3668
Merit: 6382
Looking for campaign manager? Contact icopress!
December 16, 2021, 11:48:09 AM
#7
Ok, now I'm more confused than before.  Huh

NeuroticFish, you say you use your address, not your public key,  but cygan says both are the same?
BTW, I haven't started yet, I have downloaded Exodus, and I'm now trying to download EToro, as it's said to be safer. Far as I know, both are non custodian wallets, right?

The bitcoin address is generated from the public key by using an one-way hashing function and by adding a checksum that helps preventing typing errors.
If you have patience, you can read here: https://www.oreilly.com/library/view/mastering-bitcoin-2nd/9781491954379/ch04.html
There's an nice image there too:


If you do the reading, keep in mind that it's an older version of the book and Bitcoin has evolved since, for example there are more types of addresses, not only starting with 1.



Exodus is not open source, hence it's better to avoid it.
I use Electrum and I'm very happy with it. It's the most mature light wallet for bitcoin. (just if you use it, make sure you get it from https://electrum.org/ and verify it https://bitcoinelectrum.com/how-to-verify-your-electrum-download/)
legendary
Activity: 2380
Merit: 5213
December 16, 2021, 11:41:23 AM
#6
I feel you don't know how an exchange work.
You need to know the difference between an exchange and a non-custodial wallet.

If you hold your bitcoin on a non-custodial wallet, you have full control over your fund. If you want to make a transaction, your wallet needs your private key to sign the transaction.
If you want to withdraw a fund from the exchange, you don't need any private key. Because you are not the one who makes the transaction. You request the exchange to make a transaction and the transaction is signed by the exchange not you. In this case, the private key is owned by the exchange.

Your bitcoin address is what you need to receive bitcoin.
Let's say you want to send me bitcoin. I give you my bitcoin address and you send me bitcoin.


NeuroticFish, you say you use your address, not your public key,  but cygan says both are the same?
Your bitcoin address is different from your public key, but any one who has your public key can derive your address.
Any private key generates a public key and the address is generated by that public key.


public key = Bitcoin adress
Bitcoin adress = public key
Any bitcoin address is a hash of a public key.
legendary
Activity: 3304
Merit: 8633
Crypto Swap Exchange
December 16, 2021, 11:41:01 AM
#5
Quote
A public key allows you to receive cryptocurrency transactions. It’s a cryptographic code that’s paired to a private key. While anyone can send transactions to the public key, you need the private key to “unlock” them and prove that you are the owner of the cryptocurrency received in the transaction. The public key that can receive transactions is usually an address, which is simply a shortened form of your public key.

Therefore, you can freely share your public key without worry. You may have seen donation pages for content-creators or charities with the public keys for their crypto addresses online. While anyone can donate, you’d need the private key to unlock and access the donated funds.
https://www.gemini.com/cryptopedia/public-private-keys-cryptography#section-what-is-a-public-key

public key = Bitcoin adress
Bitcoin adress = public key
 Wink
full member
Activity: 182
Merit: 190
December 16, 2021, 11:29:58 AM
#4
Ok, now I'm more confused than before.  Huh

NeuroticFish, you say you use your address, not your public key,  but cygan says both are the same?
BTW, I haven't started yet, I have downloaded Exodus, and I'm now trying to download EToro, as it's said to be safer. Far as I know, both are non custodian wallets, right?
legendary
Activity: 3304
Merit: 8633
Crypto Swap Exchange
December 16, 2021, 11:22:49 AM
#3
the public key is nothing else than your deposit/withdrawal Bitcoin address.
you use it to send the Bitcoins from the exchange to your wallet or from your wallet to any exchange.

the private key you only use to import your wallet on another pc or for example to restore your wallet (if no wallet.dat file is available anymore)
Pages:
Jump to: