A private key is a secret password that is unique that controls a public key inside a blockchain. The public key is named "public" because it is visible to anyone on the blockchain. The private key is named "private" because it must be kept secret and secure as it is the only way to control the public key.
The private and public keys are associated because the public key is created by passing the private key through a cryptographic mathematical function. In this way they are inherently connected and are usually called a "private and public key pair".
The Private Key Must Be Kept in a Safe Place
Non-custodial wallets such as Emerald give you the ability to keep control of your public keys by letting you only create wallets that are connected to your private keys, which you and only you control.
The 4 ways in which you can create accounts on the blockchains Emerald supports are:
- Using your hardware wallet: In this way, your private keys are secure inside a hardware wallet, such as Ledger Nano, and never touch your computer or phone, so they are not exposed to the internet.
- Creating a 24 word seed or secret passphrase: In this way, you write down the 24 secret words of the seed or secret passphrase and keep them somewhere secure. Then, these words are used to create your private and pubic keys, which are kept secure and encrypted inside the Emerald app on your machine.
- Using a raw private key: If you have a private key in clear text, this format is usually called "raw private key". In this way, you can keep it in a safe place and create a wallet on Emerald which will keep it secure and encrypted inside the Emerald app on your machine.
- Using a Private Key JSON file: For Ethereum, Ethereum Classic, and other Ethereum compatible blockchains, you can also have a Private Key JSON file and create your Emerald wallet using it, which will be kept secure and encrypted inside the Emerald app on your machine.
In all 4 cases above, you control your private keys and it is imperative that you keep them secure and in a safe place.
The Public Key Is Your Account on the Blockchain
The function of your public key is to be the account where you keep your assets on the blockchain.
For example, if you have 1 BTC in the Bitcoin network, it will be booked under your Bitcoin public key; if you have ETH, USDT, DAI, NFTs or any other crypto asset inside Ethereum, they will be booked under your Ethereum public key.
This is what gives you "ownership" and control of the assets inside the blockchains. Then, with your private keys that are associated with your public keys you can sign transactions that move your assets or transfer them to other accounts, smart contracts, or dapps.
How Do Private and Public Keys Look Like?
Below are examples of how raw private keys look like and their associated public keys for the Bitcoin and Ethereum blockchains:
Bitcoin Raw Private Key: L4Va7VUjJoHA32PwjTSuYx8JPNFnS9WWboHA2AwC7FnRRZJxF1Xf
Associated Bitcoin Public Key: 1WwrULWdMVd3bxmwVJxjJ1inKXqrePHtN
Ethereum Raw Private Key: 36fdbed2213dd215e1c81b4d581697a9f006f24567953ab067677132108e11c8
Associated Ethereum Public Key: 0xa71c2ae1ec42fc1b78694eefb99f00b6de71038b
WARNING: DO NOT USE THE EXAMPLES ABOVE FOR YOUR ACTUAL USE ON BLOCKCHAINS. THE ABOVE ARE JUST FOR PURPOSES OF THIS EXAMPLE. YOU MUST USE YOUR OWN PRIVATE KEYS AND PUBLIC KEYS.