1

What is the relationship between a Bitcoin Private Key / Public Key / Address? I see that a private key / public key pair is generated, but is there a possibility of generating a private key already in use? And, also I'm assuming that a wallet address is a bitcoin address? Does each wallet address have a one-one relationship with a private key?

Thanks

1
2

Using Elliptical Curve Digital Signature Algorithm (ECDSA), the private key is used to generate the public key, a secure hash function is then applied to the public key and a checksum appended to produce a Base58 formatted bitcoin address.

A private key collision is theoretically possible, but practically impossible due to the sheer number of them available on the network (quadrillions+).

1

Private keys

Old wallets used one private key generated randomly by the wallet when first run.

In modern "Hierarchical Deterministic" (HD) wallets. One private key is generated either randomly or derived from a phrase called a seed-phrase or recovery-phrase which itself is generated from a random number. Then many other private keys are generated from this using a "derivation path" which can differ between different brands of wallet. The derivation path is chosen by the developers and some different developers chose different derivation paths. This affects wallet recovery.

Public keys

One public key is generated from (along with?) each private key.

Addresses

Addresses are constructed from public keys for certain common types of transaction. Not all transactions involve addresses.

The most common types of transaction create addresses as a prefix followed by a hash of a public key followed by a checksum (so that typing errors may be detected).

Because HD wallets generate a new address for each transaction, behind the scenes they are using the fixed derivation path to generate new private keys and public keys from which to create the address.

So HD wallets have many addresses, it isn't sensible to think of a "wallet address".


Relationships and Probabilities

What is the relationship between a Bitcoin Private Key / Public Key / Address?

Something not entirely unlike this:

entropy --> random number  --> phrase --> private key --> public key --> address
                   |                        ^   |
                   '------------------------'   +--> private key --> pubkey --> addr
                                                +--> private key --> pubkey --> addr
                                                :
                                                '--> private key --> pubkey --> addr

is there a possibility of generating a private key already in use?

Its about as likely as your home spontaneously changing into a pot of petunias. Which physicists might tell you is theoretically possible but not ever going to occur due to its improbability. The point is we are talking about statistical probabilities involving numbers that are far more vast than most of us have any hope of comprehending because they are far greater than any numbers we routinely encounter or can imagine.

And, also I'm assuming that a wallet address is a bitcoin address?

Yes.

Does each wallet address have a one-one relationship with a private key?

So far yes.

New types of transactions can be invented and I imagine new types of address could be invented.

2
  • Thanks @redgrittybrick!. Explains it well. So, the first private key in your diagram is essentially the crucial part of this scenario? If I have this (since it's my own bitcoin account), then I can simply use it on another wallet provider, and just add my private key there, and the bitcoins will be there for me to send from? – Chris J Dec 30 '20 at 2:59
  • @Chris: Yes. But the new wallet must use the same derivation path. Many wallets allow you to choose the derivation path. Some don't. – RedGrittyBrick Dec 30 '20 at 10:02
0

A private key is an integer k in the range of (0, 2256]. The public key K is the corresponding elliptic curve point on secp256k1: K = k×G, where G is the base point or generator of secp256k1.

A Pay to Public Key Hash (P2PKH) address is derived from the public key by first applying a SHA256d hash and then a RIPEMD-160 hash. The address is then encoded using Base58Check. This means that there are only 2160 addresses for 2256 private keys, and therefore about 296 private keys map to each address. Since there is no central registration of addresses after they are generated, there is no mechanism to prevent key collisions, but as Travis already explained, the sheer size of the number space makes collisions astronomically unlikely to occur. The question Is each Bitcoin address unique? goes into more detail.

By now, there are a number of different address types that can be derived from the same private keys. So strictly speaking, there can be multiple addresses associated with the same private key, but for most practical purposes you can assume that each address is unique and has a one-to-one relationship with a private key.

Without further context, I would take "wallet address" and "bitcoin address" indeed to refer to the same concept.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.