<p>The analogy that you suggest isn't quite accurate because a private/public key pair have a very exact mathematical relation, whereas a username/password have no real relation (except maybe an entry in a database somewhere). </p>

<p>A private key is essentially a 256 bit number. Using this private key, and an Elliptic Curve library that supports the use of the <code>secp256k1</code> curve, you can deterministically calculate what the associated public key is. Since a bitcoin address is a hash of the public key, all you really need is the private key and you can calculate everything else to be able to see what transactions resulted in the address being credited/debited coins. That's why coinbase only has you give your private key.</p>

CC BY-SA 3.0
2014-11-12T04:22:23.857Z
Thanks for explaination, but I still don't see what stops me from trying random 256bit sentences when importing private keys to my wallet and finally I should be able to find one with some money on it... 
Is it only considered secure because number of currently used wallets is much smaller than number of valid private keys and thus probability that I will find private key with money on it is relatively small?
Bart
CC BY-SA 3.0
2014-11-12T04:31:14.287Z
There are 2^256-1 valid private keys. The system is secure because doing exactly what you described, trying private keys until you get one that has some money on it, would take so long you are pretty much guaranteed to never find it. Read up more on Elliptic Curve Cryptography if you're interested, it's pretty fascinating stuff.
morsecoder
CC BY-SA 3.0
2014-11-12T04:32:07.737Z
There are actually better attacks on the system than doing what you described, but even those would still take years even on extremely fast and parallel computers.
morsecoder
CC BY-SA 3.0
2014-11-12T04:46:23.400Z
@Bart: "Relatively small" is a [tremendous understatement](http://bitcoin.stackexchange.com/a/32333/5757).
Nate Eldredge
CC BY-SA 3.0
2014-11-12T08:00:30.427Z
@Bart: In other words, there are 115792089237316195423570985008687907853269984665640564039457584007913129639935 possible private keys. If there are a trillion keys with coins in them (actually there are less), you'd need to try about 116 vigintillion keys to find one. If you try a trillion keys per second, it will take you 4 quattuordecillion years, which is 257 decillion times the age of the universe. So it's not going to happen.
Meni Rosenfeld
CC BY-SA 3.0
2014-11-12T04:11:03.810Z
2014-11-12T04:11:03.810Z
morsecoder
<p>Unlike email accounts and passwords, in Bitcoin no two public keys can share the same private key because the public key is derived from the private key mathematically.</p>

<p>It's true you could generate private keys at random and check their corresponding public addresses for unspent bitcoins. And if you found any, you could spend them since you'd have the private key. If it was at all feasible to find and spend other users' bitcoins this way, the Bitcoin ledger would be useless. So the set of possible keys was made intentionally enormous as to make such random searching infeasible and pointless even if extremely powerful computers were used to perform these searches for centuries.</p>

<p>Here's a great video on this topic:</p>

<p><a href="http://youtu.be/ZloHVKk7DHk" rel="nofollow">http://youtu.be/ZloHVKk7DHk</a></p>

CC BY-SA 3.0
2014-11-12T08:34:44.963Z
2014-11-12T08:39:52.263Z
2014-11-12T08:39:52.263Z
drewmikb
<p>The short answer is like many other common encryption systems you can create the public key from the private key (and therefore gain access to the contents) but you cant create the private from the public. Therefore you don't need to input the public key because it can be generated from the private key.</p>

<p>As other comments have said, the chances of you guessing/generating a valid private key are essentially nil.</p>

CC BY-SA 3.0
2014-11-12T04:42:41.907Z
2014-11-12T04:42:41.907Z
George
<p>I created a paper wallet on coinbase and wanted to import it to coinbase.com. It allowed me to import it by specifying private key only. I was surprised that I didn't have to specify public key as well... is it secure?</p>

<p>I am surely missing here something but the analogy that comes to my mind is ability to log in into someone's gmail account by providing only password and not email. I mean, if that would be possible we could specify "P@ssword" and I'm sure someones has this kind of password to their email, that would let us log in to that account.</p>

<p>Similarily, I could specify some random private key and hope that it's associated with some public address... </p>

<p>Could you please clarify why my reasoning is not correct and why importing bitcoins by specifying private key only is safe?</p>

<p>Thanks!</p>

CC BY-SA 3.0
2014-11-12T09:50:51.757Z
`*Similarily, I could specify some random private key and hope that it's associated with some public address...*` Sure, but an attack based on hope isn't particularly useful. I could guess an account and password and *hope* it's yours.
David Schwartz
<private-key><paper-wallet><import>
Why I don't need to specify public key to import paper wallet
Bart
# Why I don't need to specify public key to import paper wallet

(Asked by: username_0 on 2014-11-12)

I created a paper wallet on coinbase and wanted to import it to coinbase.com. It allowed me to import it by specifying private key only. I was surprised that I didn't have to specify public key as well... is it secure?

I am surely missing here something but the analogy that comes to my mind is ability to log in into someone's gmail account by providing only password and not email. I mean, if that would be possible we could specify "P@ssword" and I'm sure someones has this kind of password to their email, that would let us log in to that account.

Similarily, I could specify some random private key and hope that it's associated with some public address...

Could you please clarify why my reasoning is not correct and why importing bitcoins by specifying private key only is safe?

Thanks!

**Tags:** private-key, paper-wallet, import

> **Comments:**
> **username_1**: `*Similarily, I could specify some random private key and hope that it's associated with some public address...*` Sure, but an attack based on hope isn't particularly useful. I could guess an account and password and *hope* it's yours.  

---

## 3 answers

### Answer by username_2 on 2014-11-12. Score: 1 | Accepted answer

The analogy that you suggest isn't quite accurate because a private/public key pair have a very exact mathematical relation, whereas a username/password have no real relation (except maybe an entry in a database somewhere).

A private key is essentially a 256 bit number. Using this private key, and an Elliptic Curve library that supports the use of the `secp256k1` curve, you can deterministically calculate what the associated public key is. Since a bitcoin address is a hash of the public key, all you really need is the private key and you can calculate everything else to be able to see what transactions resulted in the address being credited/debited coins. That's why coinbase only has you give your private key.

> **Comments:**
> **username_0**: Thanks for explaination, but I still don't see what stops me from trying random 256bit sentences when importing private keys to my wallet and finally I should be able to find one with some money on it...  Is it only considered secure because number of currently used wallets is much smaller than number of valid private keys and thus probability that I will find private key with money on it is relatively small?  
> **username_2**: There are 2^256-1 valid private keys. The system is secure because doing exactly what you described, trying private keys until you get one that has some money on it, would take so long you are pretty much guaranteed to never find it. Read up more on Elliptic Curve Cryptography if you're interested, it's pretty fascinating stuff.  
> **username_2**: There are actually better attacks on the system than doing what you described, but even those would still take years even on extremely fast and parallel computers.  
> **username_3**: @username_0: "Relatively small" is a [tremendous understatement](http://bitcoin.stackexchange.com/a/32333/5757).  
> **username_4**: @username_0: In other words, there are 115792089237316195423570985008687907853269984665640564039457584007913129639935 possible private keys. If there are a trillion keys with coins in them (actually there are less), you'd need to try about 116 vigintillion keys to find one. If you try a trillion keys per second, it will take you 4 quattuordecillion years, which is 257 decillion times the age of the universe. So it's not going to happen.  

---

### Answer by username_5 on 2014-11-12. Score: 1

Unlike email accounts and passwords, in Bitcoin no two public keys can share the same private key because the public key is derived from the private key mathematically.

It's true you could generate private keys at random and check their corresponding public addresses for unspent bitcoins. And if you found any, you could spend them since you'd have the private key. If it was at all feasible to find and spend other users' bitcoins this way, the Bitcoin ledger would be useless. So the set of possible keys was made intentionally enormous as to make such random searching infeasible and pointless even if extremely powerful computers were used to perform these searches for centuries.

Here's a great video on this topic:

<http://youtu.be/ZloHVKk7DHk>


---

### Answer by username_6 on 2014-11-12. Score: 1

The short answer is like many other common encryption systems you can create the public key from the private key (and therefore gain access to the contents) but you cant create the private from the public. Therefore you don't need to input the public key because it can be generated from the private key.

As other comments have said, the chances of you guessing/generating a valid private key are essentially nil.


---

