Author

Topic: Wallet - wallet address - private key - public key - explained in detail. (Read 129 times)

legendary
Activity: 1274
Merit: 1924
฿ear ride on the rainbow slide
Explained simply:

A desktop wallet is software code that syncs with the blockchain. It manages your private and public keys. It allows you to sign messages that are transmitted to the network nodes that allow you to spend (send) your coins. It also syncronises to the blockchain and retrieves the valid balance held on the blockchain.
More details about wallets: Bitcoin Wallets - Which, what, why?

Your coins are stored as a record on the blockchain.

Your public key hashes to your wallet address. (A mathematical / cryptographic calculation creates your valid wallet address from your public key)

You can spend those coins by using your private key.

Public and private keys can be generated online and offline. Offline generation is generally more secure.

Once coins have been sent to a wallet address they appear on the blockchain allocated to that wallet address.

A wallet address won't appear in a block explorer until coins have been sent to the address or a signed message has been sent from that address.


In more detail:

A valid bitcoin address is between 26-35 alphanumeric characters beginning with the numbers 1 and 3

Altcoins will use a different prefix for example Litecoin uses:

L - Legacy, Non-P2SH (Pay to script hash) address prefix
3 - P2SH prefix that is backwards compatible to the M prefix.
M - Current P2SH address prefix


Some online wallets will prevent you from sending it to an invalid address outside of that range.
If a transaction is sent to an address outside of that range it can still be potentially recovered (For example as a cross chain recovery).
Not all wallet addresses are compatible so cross chain recoveries are not always possible because the way that the private key is generated is different.
Cross chain recoveries are done by importing the public and private keys into the wallet.dat file of your wallet software.
If a transaction is sent to a wallet address (regardless of what it is) it will by default have a private key that can potentially unlock it - regardless of whether it is known or not and regardless of whether it was initially generated from a a private key or not.

The private key and wallet address are related by a complex mathematical equation.

Coins are allocated to a wallet address and that record is stored on the blockchain. A signed message using the valid private key is needed to spend those coins (transfer them to another address) .

Regardless of what you do offline - the coins are stored online on the blockchain - every wallet has an associated private key or keys - regardless of whether they are known or not.

The blockchain is a ledger. A public record of transactions. A private key is the cryptographically related secret alphanumeric passphrase associated with the wallet address that allows you to generate a message acceptable to the blockchain that provides the ability to transfer it from one address to another.


Chart source: https://en.bitcoin.it/wiki/Address

Currently (under RIPE-MD160 ) there are (2^160) 1,461,501,637,330,902,918,203,684,832,716,283,019,655,932,542,976 potential bitcoin addresses and  around 2^96 private keys whose corresponding public key hashes to that address

The total size of the multiple output transaction must be under 100K bytes or it will not be included in blocks or relayed on the network.
A compressed pubkey p2pkh is 146 bytes and an uncompressed pubkey p2pkh is 178 bytes.

Source:
https://en.bitcoin.it/wiki/How_to_cheaply_consolidate_coins_to_reduce_miner_fees
https://bitcoin.stackexchange.com/questions/62781/litecoin-constants-and-prefixes
https://bitcointalksearch.org/topic/m.45902659

Comments and corrections welcomed.
Jump to: