Bitcoin Forum
November 15, 2024, 09:08:36 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why isn't public key enough?  (Read 1338 times)
smemo92 (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
September 12, 2014, 02:13:18 PM
 #1

Hi, I'm studying Bitcoin protocol and I have a question: why can't we use public key as an address? Why is it not enough? Address is simply obtained from public key that is hashed ecc.. I can't understand why we need an address and we can't use public key instead. Public key is public as it is defined so I can only imagine that we don't use that because it is too long.
Is this the reason?
I've found this question here http://bitcoin.stackexchange.com/questions/3600/why-are-bitcoin-addresses-hashes-of-public-keys but there is only one answer and it is about the size of the public key and some not specified security problem. Anyone can explain with more details this problem?
Thank you
HELP.org
Hero Member
*****
Offline Offline

Activity: 510
Merit: 500



View Profile WWW
September 12, 2014, 02:17:42 PM
 #2

Hi, I'm studying Bitcoin protocol and I have a question: why can't we use public key as an address? Why is it not enough? Address is simply obtained from public key that is hashed ecc.. I can't understand why we need an address and we can't use public key instead. Public key is public as it is defined so I can only imagine that we don't use that because it is too long.
Is this the reason?
I've found this question here http://bitcoin.stackexchange.com/questions/3600/why-are-bitcoin-addresses-hashes-of-public-keys but there is only one answer and it is about the size of the public key and some not specified security problem. Anyone can explain with more details this problem?
Thank you

I think one reason was that it uses multiple types of cryptography so if there was issues with one type being broken you still can't reverse the public address into a private key.

https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses is the process

Certified Bitcoin Professional
Bicoin.me - Bitcoin.me!
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1086


Ian Knowles - CIYAM Lead Developer


View Profile WWW
September 12, 2014, 02:20:26 PM
 #3

The problem is if someone ever finds a weakness in ECDSA that might enable a private key to be recovered from a public one. Although in general this is a "theoretical" problem a "real" problem was found (last year from memory) due to the use of "non-random" K values (you'll need to google that to find out the gory details).

Provided an address has not been used then its public key does not appear in the blockchain (only the hashed "address") so it keeps your "savings safer". Of course if a weakness was found in ECDSA that did allow "private keys to be worked out" then you would not be able to "spend your BTC" until some kind of "fix" was made available (as your first attempt to do so would publish the public key making it vulnerable to a tx "replacement" that might steal your BTC).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
smemo92 (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
September 12, 2014, 02:42:13 PM
 #4

thank you for your answers, I understand what you say, but when I send a transaction on the network I've understood that i also send my public key because I've signed the transaction with my private key and so everyone had to check the transaction with my public one.
So everyone can know my public key, it is not true? Maybe I've don't understood how transactions work. If it works in this way the problem still remains and using an address doesn't hide the public key.
HELP.org
Hero Member
*****
Offline Offline

Activity: 510
Merit: 500



View Profile WWW
September 12, 2014, 02:43:25 PM
 #5

The problem is if someone ever finds a weakness in ECDSA that might enable a private key to be recovered from a public one. Although in general this is a "theoretical" problem a "real" problem was found (last year from memory) due to the use of "non-random" K values (you'll need to google that to find out the gory details).


http://www.nilsschneider.net/2013/01/28/recovering-bitcoin-private-keys.html

Certified Bitcoin Professional
Bicoin.me - Bitcoin.me!
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4851



View Profile
September 12, 2014, 02:46:05 PM
 #6

- snip -
why can't we use public key as an address? Why is it not enough? Address is simply obtained from public key that is hashed ecc.. I can't understand why we need an address and we can't use public key instead. Public key is public as it is defined so I can only imagine that we don't use that because it is too long.
Is this the reason?
- snip -
 Anyone can explain with more details this problem?
Thank you

Public key is enough.  You can use public key if you want.  Most people prefer to use Bitcoin address.

There are a few reasons that Bitcoin addresses are more popular than Public Keys:

  • Bitcoin addresses are shorter.
  • Bitcoin addresses have a checksum built in to prevent a typo from resulting in lost bitcoins
  • Bitcoin addresses provide 2 additional layers of cryptography. If ECDSA is ever weakened, your bitcoins will still be safe with a bitcoin address.
  • Bitcoin addresses have a version number that allows new address types with new functionality (such as P2SH)
CIYAM
Legendary
*
Offline Offline

Activity: 1890
Merit: 1086


Ian Knowles - CIYAM Lead Developer


View Profile WWW
September 12, 2014, 02:50:51 PM
 #7

thank you for your answers, I understand what you say, but when I send a transaction on the network I've understood that i also send my public key because I've signed the transaction with my private key and so everyone had to check the transaction with my public one.
So everyone can know my public key, it is not true? Maybe I've don't understood how transactions work. If it works in this way the problem still remains and using an address doesn't hide the public key.

Yes - but only when you *send* (where that address is one of the UTXOs). If you create a new address and "receive" BTC then your public key has *not hit the blockchain* (and won't until you spend that UTXO).

Note also that I am pretty sure that if you sign a "verifymessage" then your public key is included in that "signature" (so don't sign messages with a bitcoin address that you haven't "spent from" unless you really have to).

With CIYAM anyone can create 100% generated C++ web applications in literally minutes.

GPG Public Key | 1ciyam3htJit1feGa26p2wQ4aw6KFTejU
DannyHamilton
Legendary
*
Offline Offline

Activity: 3486
Merit: 4851



View Profile
September 12, 2014, 02:52:20 PM
 #8

thank you for your answers, I understand what you say, but when I send a transaction on the network I've understood that i also send my public key because I've signed the transaction with my private key and so everyone had to check the transaction with my public one.
So everyone can know my public key, it is not true?

No.  You sign a transaction when you spend the output, not when you receive it.  Therefore, when you give out a new bitcoin address, the sender does not know your public key, and does not need to know your public key.  They just send the output to the RIPEMD-160 hash (bitcoin address) that you provide them.

The unspent output then remains unspendable until someone with the private key can provide a valid signature.  It is only when you spend that output that you then sign the transaction that spends it and include the public key for the network to verify the signature.  However, once you broadcast that transaction with the signature, the output is spent and no longer available for anyone to take if there is a weakness in ECDSA.

This is one of several reasons why bitcoin addresses are not supposed to be re-used.  If you re-use a bitcoin address for receiving more than one transaction, then any unspent outputs that are still associated with the bitcoin address after the public key has been broadcast become susceptible to attack if ECDSA is ever weakened.  If you use a new address for EVERY transaction, then you aren't exposed to this risk.

Maybe I've don't understood how transactions work. If it works in this way the problem still remains and using an address doesn't hide the public key.

Perhaps you understand better now?
smemo92 (OP)
Newbie
*
Offline Offline

Activity: 12
Merit: 0


View Profile
September 12, 2014, 02:58:58 PM
 #9

Oh yes I know that my public key is sent only when I spend Bitcoin, the mistake that i've done is to consider using only one bitcoin address for more transactions. Now i've understood why we use it, it is not necessary but it is a good way to prevent some attacks or problem, thank you to everyone Smiley
amaclin
Legendary
*
Offline Offline

Activity: 1260
Merit: 1019


View Profile
September 12, 2014, 03:40:26 PM
 #10

In the beginning of bitcoin era there was only one script type - transferring bitcoins to a public key (not to its hash)

look at the first p2p transacton (Satoshi Nakamoto to Hal Finney)
http://webbtc.com/tx/f4184fc596403b9d638783cf57adfe4c75c605f6356fbc91338530e9831e9e16
(right-bottom corner, "Scripts" column)

there are two outputs in it:
1) transfer 10 btc to publicKey "04ae1a62fe09c5f51b1390..." (this is Finney)
2) send 40 btc change to publicKey "0411db93e1dcdb8a016b49840f8c..." (this is Satoshi)
TimS
Sr. Member
****
Offline Offline

Activity: 250
Merit: 253


View Profile WWW
September 13, 2014, 01:09:14 AM
 #11

Of course if a weakness was found in ECDSA that did allow "private keys to be worked out" then you would not be able to "spend your BTC" until some kind of "fix" was made available (as your first attempt to do so would publish the public key making it vulnerable to a tx "replacement" that might steal your BTC).
That depends on how severe the weakness is. If it allows you to trivially calculate the private key from the public key, then it is a severe problem as you describe. If the vulnerability allows you to calculate it, but still non-trivially (e.g. 1 minute to a few years), then using addresses (without reusing them or leaving a balance after spending once) will provide you the security required for you and you alone to spend your BTC.
justusranvier
Legendary
*
Offline Offline

Activity: 1400
Merit: 1013



View Profile
September 13, 2014, 01:11:26 AM
 #12

Oh yes I know that my public key is sent only when I spend Bitcoin, the mistake that i've done is to consider using only one bitcoin address for more transactions. Now i've understood why we use it, it is not necessary but it is a good way to prevent some attacks or problem, thank you to everyone Smiley
Public keys in Bitcoin are ephemeral.

It's an error to use them more than once.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!