Author

Topic: Question on public keys (Read 230 times)

hero member
Activity: 1386
Merit: 513
Payment Gateway Allows Recurring Payments
July 15, 2024, 11:54:41 AM
#14
I also came across a post saying wallets can be created offline for safety purposes but if that is so, how possible is it for the same public keys to be generated twice? From the length and numbers of accepted characters in a public key, I know the permutations are almost infinite but what are the chances of a wallet generating a public key twice?
Welcome to this forum. I hope you find it enjoyable and beneficial. I'm glad you chose to ask a question that not only revisits the topic for those already familiar with it but also introduces it to those who are new. I have a great topic for you to read that I came across some time ago. It's incredibly helpful, especially if you read all the replies. While one member might make a mistake or error in their post, others often provide corrections.

This will enhance your knowledge and help you think critically when searching for and creating tutorial posts, should you ever wish to do so.

Public keys and Addresses - Are there striking similarities or difference. After reading this thread you must no collision is not possible because the possibility of collision is 2128.
member
Activity: 97
Merit: 43
July 12, 2024, 10:22:31 PM
#13
This is why I referenced the numbers of atoms in the universe in my above example.
You can use this graphic to simplify your lecture. People can get impression with graphics than pure texts for reading.

legendary
Activity: 2268
Merit: 16328
Fully fledged Merit Cycler - Golden Feather 22-23
July 12, 2024, 02:39:48 PM
#12
https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04_keys.adoc

There is a tip in Mastering Bitcoin book too.
Quote
The size of Bitcoin’s private key space (2256) is an unfathomably large number. It is approximately 1077 in decimal. For comparison, the visible universe is estimated to contain 1080 atoms.

This is why I referenced the numbers of atoms in the universe in my above example.
The point was also do describe how our brain is not wired to understand the exponents.
Another example
10^5 seconds ago it was 1 day ago
10^7 seconds ago was 4 months ago
10^9 seconds ago was 31 years  ago
10^18 seconds ago was twice the age of the universe

My linked post is full of such examples
member
Activity: 97
Merit: 43
July 11, 2024, 09:31:08 PM
#11
https://github.com/bitcoinbook/bitcoinbook/blob/develop/ch04_keys.adoc

There is a tip in Mastering Bitcoin book too.
Quote
The size of Bitcoin’s private key space (2256) is an unfathomably large number. It is approximately 1077 in decimal. For comparison, the visible universe is estimated to contain 1080 atoms.
legendary
Activity: 2268
Merit: 16328
Fully fledged Merit Cycler - Golden Feather 22-23
July 11, 2024, 04:23:15 PM
#10
I also came across a post saying wallets can be created offline for safety purposes but if that is so, how possible is it for the same public keys to be generated twice? From the length and numbers of accepted characters in a public key, I know the permutations are almost infinite but what are the chances of a wallet generating a public key twice?

It is possible sure.
as it: if you were asked to pick two atoms in the universe, is it possible to select the same atom twice?

The theoretical possibility exists; yes, in reality, you can ignore this possibility and trust a good entropy generator to generate a random number to secure your intergenerational wealth.
Of course, things change if your entropy generator isn't so good, and actually, you pick those atoms only from a very specific region in the universe.

You can read something about this here:
There are 2^256 private keys out there: how big is that number?
legendary
Activity: 2380
Merit: 5213
July 09, 2024, 06:42:52 AM
#9
What could then be the major difference between the public key and your bitcoin address aside from bitcoin address being a compressed version of a public key.
Your address is not the compressed version of your public key. Your address represents the locking script, not the public key.


I realized bitcoin address are most oftentimes even shorter than the private key, they are just between 26 to 35 alphanumeric.
Again wrong.

P2WPKH addresses are 42 characters long.
P2WSH and P2TR addresses are 62 characters long.


But the public key is meant to be shared as well as the bitcoin address.
Your public key is revealed whenever you make a transaction.
There is no need to share your public key with others if they want to send you bitcoin.


Another question I wanted to ask alongside is, aside from the use of QR Codes to make it easy for people to scan other people's bitcoin addresses, can't they be further compressed to be a little more or less than 10 digits, so people can easily memorize it off hands for their every day transactions since the use of Bitcoin has risen significantly around the world?
You can't have such a short address, if you want it to be standard.
legendary
Activity: 2310
Merit: 4085
Farewell o_e_l_e_o
July 09, 2024, 05:16:31 AM
#8
I realized bitcoin address are most oftentimes even shorter than the private key, they are just between 26 to 35 alphanumeric. The private key is never to be shared with others but to be kept privately for your own use.
About Keys (Private keys, Public keys) & Addresses.

Quote
Most preferably, off the internet or the computers. But the public key is meant to be shared as well as the bitcoin address.
Reason that private keys must be kept in private is if you share your private keys, your bitcoins will be stolen and gone forever. Bitcoin transactions are irreversible so that if your bitcoins were moved, no way to ask for reverse/ refund. Except if you ask police to arrest the thief to get your bitcoin back, it's nearly impossible and complicated.

There are two famous sayings to sum up
  • It's not your private key, it's not your bitcoin.
  • Never share your Bitcoin private keys.
member
Activity: 88
Merit: 29
July 09, 2024, 04:52:59 AM
#7
An address isn't just a shorter version of a public key.
A coin sent to a public key is different from a coin sent to an address. They have different locking scripts.

Also note that an address isn't necessarily the hash of a public key. A bitcoin address can be the hash of a script.
From the little knowledge I acquired from here now. What could then be the major difference between the public key and your bitcoin address aside from bitcoin address being a compressed version of a public key. I realized bitcoin address are most oftentimes even shorter than the private key, they are just between 26 to 35 alphanumeric. The private key is never to be shared with others but to be kept privately for your own use. Most preferably, off the internet or the computers. But the public key is meant to be shared as well as the bitcoin address.

Another question I wanted to ask alongside is, aside from the use of QR Codes to make it easy for people to scan other people's bitcoin addresses, can't they be further compressed to be a little more or less than 10 digits, so people can easily memorize it off hands for their every day transactions since the use of Bitcoin has risen significantly around the world?
legendary
Activity: 2380
Merit: 5213
July 08, 2024, 10:55:18 AM
#6
So does this mean that hashing must be involved weather a public keys are used or a script is used.
Right.

Whenever you generate an address, you first genrate a private key and a public key.
To receive bitcoin from someone, you can give them your public key, but that's not common these days and to receive bitcoin from people, we give them a bitcoin address. With giving a bitcoin address to someone, you acutally tell them what locking script you want to be used for your coins.

We have some standard locking scripts and each of them corresponds to a different type of address.
For example, a P2PKH address (an address starting with 1) contains public key hash and and a P2SH address (an address starting with 3) contains a script hash.
newbie
Activity: 9
Merit: 4
July 08, 2024, 08:51:33 AM
#5
An address isn't just a shorter version of a public key.
A coin sent to a public key is different from a coin sent to an address. They have different locking scripts.

Also note that an address isn't necessarily the hash of a public key. A bitcoin address can be the hash of a script.
I was initial restricted from posting
So does this mean that hashing must be involved weather a public keys are used or a script is used.
member
Activity: 97
Merit: 43
July 08, 2024, 06:08:15 AM
#4
So instead of making the normal introduction most newbies usually make, I decided to  introduce myself with something with a bit of  better quality after I have done some readings here.
Newbies don't need to make introductions to show their quality. They need study on Bitcoin and the forum, it's enough.

Quote
From some posts I read here I got to understand that public keys are created by a bitcoin wallet before the addresses are created. In the post they made mention of a process called hashing of the public keys to create addresses but I don't fully understand how it works.
Keys, addresses, wallets
Wallet software creates private key randomly and through Eliptic Curve Multiplication to create public key. After that, from public key and Hashing function, it creates public address.

Hashing functions include SHA256 and RIPEMD-160, call Double-Hash or HASH160.

Quote
I also came across a post saying wallets can be created offline for safety purposes but if that is so, how possible is it for the same public keys to be generated twice?
If you have a private key, you can get a public key and a public address, multiple times, it's called wallet recovery. Without this ability (recovery), it's risky to use Bitcoin because if you lose your wallet or private key, you lose your bitcoin.
legendary
Activity: 2380
Merit: 5213
July 08, 2024, 06:02:18 AM
#3
Addresses are just the shorter version of public keys gotten through compression of the key using the hash function as you have stated. The public key is long and has many characters that look similar, the compression to address was just to Make it smaller and also easier to write down.
An address isn't just a shorter version of a public key.
A coin sent to a public key is different from a coin sent to an address. They have different locking scripts.

Also note that an address isn't necessarily the hash of a public key. A bitcoin address can be the hash of a script.
hero member
Activity: 868
Merit: 952
July 08, 2024, 05:21:05 AM
#2
Addresses are just the shorter version of public keys gotten through compression of the key using the hash function as you have stated. The public key is long and has many characters that look similar, the compression to address was just to Make it smaller and also easier to write down. You can read through learnme.com to know about keys and addresses.

I also came across a post saying wallets can be created offline for safety purposes but if that is so, how possible is it for the same public keys to be generated twice? From the length and numbers of accepted characters in a public key, I know the permutations are almost infinite but what are the chances of a wallet generating a public key twice?

Yes you can create wallet or generate your keys without having to connect to the internet.
No you cannot generate same public key from two different private key. Because the private key is a 1:1 to a public key. That is a private key creates a unique public key that cannot be created from another private key.

 As for the possible collision of addresses (public key hashes) it is possible that a private key can generate similar addresses since there are more possible private keys (2256) than the possible number of addresses (2160), but the combination needed for this is huge and not easily possible as it seems.
newbie
Activity: 9
Merit: 4
July 08, 2024, 04:51:28 AM
#1
I've been on this forum for quite a while now and i decided to go through the rules and a few other Post in the meta and beginners and help section. I have been reading through for some time now and I discovered introductions are not fancied much here. So instead of making the normal introduction most newbies usually make, I decided to  introduce myself with something with a bit of  better quality after I have done some readings here.

Firstly I don't know if this is the right section to post this.

I have been doing some proof reading about creation of wallets and I have a couple of questions.
From some posts I read here I got to understand that public keys are created by a bitcoin wallet before the addresses are created. In the post they made mention of a process called hashing of the public keys to create addresses but I don't fully understand how it works.

I also came across a post saying wallets can be created offline for safety purposes but if that is so, how possible is it for the same public keys to be generated twice? From the length and numbers of accepted characters in a public key, I know the permutations are almost infinite but what are the chances of a wallet generating a public key twice?
Jump to: