In a Bitcoin wallet, the keys to a user’s account are stored, so the user can receive Bitcoins, sign transactions, and check the balance of their account. A Bitcoin wallet holds both private and public keys, which serve different purposes, but are created together.
It is the user’s keys that are stored in Bitcoin wallets, not Bitcoin itself. The concept of a wallet is similar to that of a keychain in that it stores many pairs of private and public keys. To prove ownership of Bitcoin, these keys are used to sign transactions on the blockchain. The blockchain records Bitcoin transactions as transaction outputs. The mnemonic phrase can be used to recover a lost wallet. To protect against internal and external threats that can compromise a user’s Bitcoin, it is essential to keep private keys and seed phrases secure.
Private and Public Keys
Using cryptographic key pairs, Bitcoin is sent and received. Key pairs are made up of a private key and a public key. Private keys are required for sending Bitcoin. Public keys can be shared with anyone for receiving Bitcoin. Each public key is derived directly from a corresponding private key.
A seed is created when you create your Bitcoin wallet. Known as mnemonic phrases, seeds are displayed as a series of words. Each key that you’ll use to send and receive Bitcoins will be derived from this seed.
The HD framework is an industry standard for generating and managing Bitcoin keys, which is known as a Hierarchical Deterministic (HD) design.
Each time you receive Bitcoin, your wallet will automatically generate a new public key. You will no longer have to worry about reusing public keys or addresses. Anyone could track your entire payment history if you used the same public key each time you received Bitcoin. A user’s privacy is greatly improved by treating keys as single-use tokens.
Backup Your Bitcoin Wallet
A user can always restore their wallet as long as they know their recovery seed, which is usually 12 or 24 words that were initialized with their wallet.
As you send and receive Bitcoins, your wallet will store many addresses and private keys. However, you only need to backup your wallet once. You can backup HD wallet addresses using the mnemonic representation of the seed, since HD wallet addresses are created deterministically by using a seed.
Someone who knows your recovery phrase can also steal all of your funds if they are exposed. The recovery phrase must be kept safe from strangers and ensured to not be lost or forgotten.
Bitcoin Network and Bitcoin Wallet
Since Bitcoin wallets are lightweight pieces of software, they usually don’t store the entire blockchain. Hence, a Bitcoin wallet must query the blockchain to track a user’s balance and to inform them about their transaction status.
The best wallets allow users to connect their wallets to their own nodes instead of querying the wallet provider’s servers. When a user uses a wallet that queries their own node, their addresses and transactions are not shared with a third party. Additionally, it provides users with the ability to use Bitcoin without relying on a third party.