what is a 'public key'?
The public key is a cryptographically protected code attached to a wallet. Both public and its respective private key are part of a wallet. Cryptocurrency holders are able to receive and execute transactions with their public key. The functions of a public key are comparable to the one of an IBAN or bank account number. A public key fulfills two main functions: authentication and encryption. If two cryptocurrency holders want to perform a transaction. Both individuals exchange their public addresses. As the public address and public key are both formed by the private key, the Blockchain signs every transaction with the private key to ensure that the real owner has executed the transaction. Of course it is no getting exposed to any other person but the Blockchain to obtain wallet security.
It is important to understand that even though both the public key and public address originally derive from the private key it is impossible to work out the private key from the public key or private address. This mainly due to mathematical functions and cryptography.