What is a private key? What is a public key and how is it related to an address?

So in most coins the concept of private and public key is the base foundation for identification. If you have the private key to a wallet you can spend the coins in that wallet. If only have the public key you can't spend any coins, but you can verify that a given transaction is valid.

So to understand how it all is related take a look at the image below:

To the left we have the private key. If you have the private key you can generate the public key using an elliptic function. That is abstract and not easy to understand, but the point is that you can go from a private key to a public key, but not from the public key to the private key.

When you have the public key the address is just a hash (SHA256) of the public key. What is hashing and SHA256? It is an algorithm that takes an input and generate a 64 byte long array no matter how large the input. It guaranties that it's almost unlikely that two different input can generate the same output so there is no collisions. It's impossible to go from the output back to the input! So if you have the hash of something you can not in any way go back to the get the input. The only way is to brute force all possible combination of input and that is not possible with todays computers.

So why don't we normally not use the public key as the address? The reason is that IF somehow the elliptic function can be cracked and it becomes possible to go from the public key to the private key we have an extra layer of protection because of the hash used to generate the address.

Did you know it's possible to send coins to both the address and the public key?

I'm trying to keep this info short. Enjoy.

So in most coins the concept of private and public key is the base foundation for identification. If you have the private key to a wallet you can spend the coins in that wallet. If only have the public key you can't spend any coins, but you can verify that a given transaction is valid.

So to understand how it all is related take a look at the image below:

To the left we have the private key. If you have the private key you can generate the public key using an elliptic function. That is abstract and not easy to understand, but the point is that you can go from a private key to a public key, but not from the public key to the private key.

When you have the public key the address is just a hash (SHA256) of the public key. What is hashing and SHA256? It is an algorithm that takes an input and generate a 64 byte long array no matter how large the input. It guaranties that it's almost unlikely that two different input can generate the same output so there is no collisions. It's impossible to go from the output back to the input! So if you have the hash of something you can not in any way go back to the get the input. The only way is to brute force all possible combination of input and that is not possible with todays computers.

So why don't we normally not use the public key as the address? The reason is that IF somehow the elliptic function can be cracked and it becomes possible to go from the public key to the private key we have an extra layer of protection because of the hash used to generate the address.

Did you know it's possible to send coins to both the address and the public key?

I'm trying to keep this info short. Enjoy.

Cardano is the most promising 3 gen. crypto right now.