# Public key

In cryptocurrencies, a **public key** is used as the basis for an address. Each public key corresponds to a specific private key, which can be used to spend the funds associated to the corresponding public key or address. A public key can be calculated from a private key, but it is not possible to calculate a private key from a public key.

The Trezor Wallet does not show raw public keys to users, as addresses are used to send and receive transactions. It is possible to view account public keys (XPUBs). However, these should not be shared with others as this can result in all transaction information being exposed and potential loss of funds.

## Public key vs. public key hash [edit]

Hashing is using a hash function on data in order to produce a hash output. Examples of popular hash functions are SHA-256, MD5, RIPEMD-160. Address is an public key hash of public key and the main reason that these are used is probably that they are shorter and more convenient to use.