Bitcoin Forum
September 23, 2018, 11:09:52 PM *
News: ♦♦ New info! Bitcoin Core users absolutely must upgrade to previously-announced 0.16.3 [Torrent]. All Bitcoin users should temporarily trust confirmations slightly less. More info.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Private keys  (Read 135 times)
Kwothe117
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 16, 2017, 01:59:28 AM
 #1

I'm starting to get my head around Bitcoin, Blockchain etc. but I want to learn more about private keys, their generation, and use.

As I understand any 128-bit sequence can be a private key which can, in turn, be used to generate a 32-bit address using a one-way function.

1. Is there a set of rules that narrow down what is a good private key?
2. Is there anything in place to avoid collisions (multiple private keys to one address) other than statistics?

Also, roughly how many public addresses are currently storing bitcoin?
1537744192
Hero Member
*
Offline Offline

Posts: 1537744192

View Profile Personal Message (Offline)

Ignore
1537744192
Reply with quote  #2

1537744192
Report to moderator
1537744192
Hero Member
*
Offline Offline

Posts: 1537744192

View Profile Personal Message (Offline)

Ignore
1537744192
Reply with quote  #2

1537744192
Report to moderator
1537744192
Hero Member
*
Offline Offline

Posts: 1537744192

View Profile Personal Message (Offline)

Ignore
1537744192
Reply with quote  #2

1537744192
Report to moderator
Make a difference with your Ether.
Donate Ether for the greater good.
SPRING.WETRUST.IO
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1537744192
Hero Member
*
Offline Offline

Posts: 1537744192

View Profile Personal Message (Offline)

Ignore
1537744192
Reply with quote  #2

1537744192
Report to moderator
1537744192
Hero Member
*
Offline Offline

Posts: 1537744192

View Profile Personal Message (Offline)

Ignore
1537744192
Reply with quote  #2

1537744192
Report to moderator
1537744192
Hero Member
*
Offline Offline

Posts: 1537744192

View Profile Personal Message (Offline)

Ignore
1537744192
Reply with quote  #2

1537744192
Report to moderator
aplistir
Full Member
***
Offline Offline

Activity: 257
Merit: 108



View Profile
December 16, 2017, 07:29:12 AM
 #2

I'm starting to get my head around Bitcoin, Blockchain etc. but I want to learn more about private keys, their generation, and use.

As I understand any 128-bit sequence can be a private key which can, in turn, be used to generate a 32-bit address using a one-way function.

1. Is there a set of rules that narrow down what is a good private key?
2. Is there anything in place to avoid collisions (multiple private keys to one address) other than statistics?

Also, roughly how many public addresses are currently storing bitcoin?


Some mistakes in your text. Any 256bit number works as a private key, and addresses are 160bit.

1. There are no set of rules that narrow private keys, but my own opinion is that there should be. While it is unlikely that your private key would be really small, or close to 1/2 or 3/4 of the search space (psychological values, where humans could start searching for your key) You still would not want your private key to be there.
2. Nothing to avoid collisions, except the huge amount of possible keys, which makes a collision extremely improbable.

About 2 months ago there were:
~21600000 addresses containing some balance and
~661000 addresses containing > 1BTC

My Address: 121f7zb2U4g9iM4MiJTDhEzqeZGHzq5wLh
samson
Legendary
*
Offline Offline

Activity: 1526
Merit: 1012


View Profile
December 16, 2017, 08:08:54 AM
 #3

The the OP : You need to read the manuals which explain how Bitcoin actually works.

Developer Guide : https://bitcoin.org/en/developer-documentation

Developer Referrence (contains everything in low level detail) : https://bitcoin.org/en/developer-reference

These are the things you need to learn about :

sha256
ripemd160
ECDSA using secp256k1 for signature creation and verification

Also what a public key is and how it's used to create and verify a signature based on some arbitrary data like an sha256 hash. It's not like RSA where something is encrypted with one key and decrypted with the other, that's not how it works with ECC.

Forget anything you're read about RSA, it's not applicable here.
bob123
Hero Member
*****
Offline Offline

Activity: 686
Merit: 568



View Profile WWW
December 16, 2017, 09:00:41 AM
 #4

1. Is there a set of rules that narrow down what is a good private key?

A private key is a 256 bit number. So basically there is just 1 (very important) rule: Randomness.
The RNG is probably the most popular attack path when trying to crack (implemented) crypthographic functions.


2. Is there anything in place to avoid collisions (multiple private keys to one address) other than statistics?

Multiple private public keys to one address referes to hash collision:
Since there are 2^256 public keys and 2^160 addresses, there are 2^96 public keys which match to one address (on average).
 
For address collision (where 2 people accidentially generate the same address (spendable priv-/pub- keypair for this address):
Not statistics is keeping this from happening, but maths. 2^160 is about 1,460,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.
There isn't enough energy on earth to even generate a small percentage of all of those addresses.

DannyHamilton
Legendary
*
Offline Offline

Activity: 2198
Merit: 1373



View Profile
December 16, 2017, 09:18:59 AM
 #5

- snip -
there are 2^256 public keys and 2^160 addresses,
- snip -
2^160 is about 1,460,000,000,000,000,000,000,000,000,000,000,000,000,000,000,000.
- snip -

Or precisely:
1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976

- snip -
Also, roughly how many public addresses are currently storing bitcoin?

- snip -
About 2 months ago there were:
~21600000 addresses containing some balance and
- snip -

Note that there could NEVER be more than 2,099,999,997,690,000 addresses storing bitcoins at any moment in time.

Furthermore, due to lost bitcoins and some addresses storing more than 0.00000001 BTC, the actual maximum number of addresses that ever WILL store bitcoins at any given moment in time will ALWAYS be SIGNIFICANTLY less than 2,099,999,997,690,000 addresses.

Therefore, the absolute worst case scenario (an imaginary situation where there actually are 2,099,999,997,690,000 addresses storing bitcoins) would result in less than:
0.0000000000000000000000000000002 % of the available address space being used to store bitcoins at any moment.

Kwothe117
Newbie
*
Offline Offline

Activity: 10
Merit: 0


View Profile
December 18, 2017, 09:12:32 AM
 #6

Thanks guys for clearing that all up for me! Great answers. Seems like I've got some reading up to do but I'm really impressed by blockchain Cheesy
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!