What are public keys, private keys and wallet addresses?

In cryptography, a public key and private key are both needed to access any encrypted information. In essence, cryptography is the practice of encrypting certain information to keep it secret from third parties. It is used to ensure that only a party with permission can decipher the data. 

What is cryptography?

The term “cryptography” has Greek roots and originally meant “secret writing.” Over time, cryptography evolved from intelligence agencies and the military writing and decoding confidential messages and became a separate branch of computer science. Similar to the internet, the origins of cryptocurrencies can be traced back to academic and military use cases, which eventually expanded to the private sphere. 

People involved in this movement refer to themselves as “cypherpunks” and have been advocating a shift to greater privacy and control over our data since the late 1980s.  

The origins of cryptocurrencies can be traced back to academic and military use cases, which eventually expanded to the private sphere. 

Why do cryptocurrencies such as Bitcoin use a two-key system?

The basic concept behind the two-key system is the following: the public key allows you to receive transactions, while the private key is necessary to send transactions. It gets a little bit more complicated when we take a look at how this ingenious system actually works. 

Using two different keys (a public and a private key) is called asymmetric cryptography, which is a vital aspect of a blockchain. The two keys are connected to each other in mathematical terms. 

The unique public key has its origins in the private key. This connection allows users to create unforgeable signatures, which can only be validated by other participants of the network who have knowledge of the corresponding public key.

Using two different keys – a public and a private key – is called asymmetric cryptography.

What’s the difference between an address, a key, and a wallet?

There are a lot of misconceptions regarding the differences between addresses, keys, and wallets. To provide more clarity on this topic, let’s look at their characteristics one by one.

Address

An address is a randomly generated set of numbers and letters which represent a type of unique number similar to a bank account number. As an example, here is the Bitcoin genesis address – the first Bitcoin address ever: 1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa. 

The difference is that an address can be created for free by anyone and within a matter of seconds without needing a third party. You can create as many public addresses as you like or need.

You can freely share your public address with others. That way, people can send cryptocurrencies to your address.

Because the Bitcoin or Ethereum networks are not anonymous but pseudonymous, your holdings and transactions can be viewed by anyone who knows your public address.

Keys

There are two types of keys: public keys and private keys. Public keys are comparable to account numbers. They can be freely shared with everyone, and anyone can potentially send transactions to them.

Private keys, on the other hand, should be kept private, as their name suggests. You can think of them as a kind of PIN or verification code, which, together with its corresponding public key grants you access to the actual funds on the blockchain. 

You should NEVER, under any circumstances, share your private key(s) with any other person. It’s best to store them in the most secure way possible (e.g. on a paper wallet or a hardware wallet).

Note that the keys are not stored on a blockchain. Instead, they can be kept in an (encrypted) file, which can be saved anywhere and stored offline.

Wallet

You can think of a wallet as a sort of encrypted virtual keychain, containing all the information needed to access your funds on the Bitcoin blockchain. A wallet combines and contains both your address(es) as well as your digital key(s).

The simplest form of a wallet is a file containing a database. It can also be stored offline because it does not need a connection to an actual blockchain.