Bitcoin Forum
May 06, 2024, 04:07:08 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Private keys  (Read 233 times)
Kwothe117 (OP)
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?
1715011628
Hero Member
*
Offline Offline

Posts: 1715011628

View Profile Personal Message (Offline)

Ignore
1715011628
Reply with quote  #2

1715011628
Report to moderator
The Bitcoin network protocol was designed to be extremely flexible. It can be used to create timed transactions, escrow transactions, multi-signature transactions, etc. The current features of the client only hint at what will be possible in the future.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715011628
Hero Member
*
Offline Offline

Posts: 1715011628

View Profile Personal Message (Offline)

Ignore
1715011628
Reply with quote  #2

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

Activity: 378
Merit: 197



View Profile
December 16, 2017, 07:29:12 AM
Merited by ABCbits (2)
 #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: 2097
Merit: 1068


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
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



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: 3388
Merit: 4616



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 (OP)
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:  

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