Wallets Master Class
In this course, we'll be looking at exactly what a wallet is, how it works, and how to create a wallet on some of the major blockchains (including the Sepolia test network).
What is an address?
In order to fully understand what a wallet is, we first need to look at what an address is.
An address represents the identity of Externally Owned Accounts and contracts.
Externally Owned Accounts refer to accounts that are backed by a private key.
Contracts generally do not have keys, but access is granted through instructions in the code.
These accounts contain a key pair that is used to access the account. Anyone holding the private key (preferably only you) can access the account.
If you do not know, a key pair is a public key and a private key. The public key is meant to be shared, whereas the private key is meant to be kept to yourself and never shared. The private key allows you to generate a valid signature that can be used to interact with your account (and your funds).
What is a wallet?
A wallet is a wrapper around a key pair. A wallet can be created by providing a private key to it. Once initialised, the wallet can be used to sign transactions and send these transactions to an RPC node (the broadcasting node).
Creating a wallet
Before we continue, let's look at how to create a wallet using Metamask.
Go to the this link and install the extension for your browser:
Once installed, you should see the Metamask icon in your browser. Click on it and follow the instructions to create a new wallet. Once you have created your wallet, you should see a screen showing your balance and your address.
From the start, you should be able to switch between multiple different networks. The network you are currently on is shown in the top left corner. You can switch between networks by clicking on the network name and selecting a different network.
At the bottom of the networks there should be an option to toggle test networks. Once toggled, you will be able to switch your wallet to the Sepolia test network. Do that now since we'll be coming back to this in a bit.
What is a wallet? (continued)
Now that you have some hands-on experience with creating a wallet, let's continue with the theory.
The moment you create a new wallet, you actually generate a new key pair. The public key is your address - notably starting with 0x
. This address can be shared with people to allow them to send tokens to you. This address serves as an on-chain identifier for you.
Now, let’s talk more about your private key. This key is the most important thing in your life. Well, maybe not THE most important, but seriously, though, if someone has access to your private key, they can generate a signature that allows them to send funds out of your wallet.
There is a well-known phrase that goes, “Not your keys, not your money”. This is an extremely important thing to keep in mind because it really is as easy as that. Most exchanges offer a wallet with sign-up. They are storing an encrypted (hopefully encrypted) version of your private key in the database, so whenever you do something, they can decrypt it and use it to sign your transaction.
Now, many exchanges combat this single point of failure by implementing MPC wallets. An MPC (Multi-Party Computational) Wallet is just a fancy way of saying we need multiple “keys” to generate a valid signature. So, if one of the keys is compromised, the attacker would still need the other parts to generate a signature to actually use the funds.
So, in short - your wallet is a wrapper around an account that is used to transact on the blockchain.
Do I need more than one wallet?
It's important to note the difference between a wallet and an account. A wallet is a wrapper around an account. So while you might have multiple accounts, you can use the same wallet to access all of them.
Let's look at a wallet/account breakdown again:
- You have an account (key pair facing the blockchain and outside world)
- You import the account into a wallet (like MetaMask)
- Then, use the wallet to sign transactions and broadcast them to the network.
If you generate an account on one type of chain, it will be valid on other chains of the same type. If you generate an account on Ethereum, you can use the same account on, for instance, Polygon or Binance Smart Chain. We will understand why in a bit (this will also be important for the Smart Contracts section).
For different types of chains, you would need different accounts. For example, your Bitcoin account and Ethereum account can not be used interchangeably, so you would need a different account for each of them.
Since wallets are just wrappers around accounts, wallets can contain multiple accounts for different chains.
For example, using MetaMask, you can access all EVM (Ethereum Virtual Machine) chains. Using other wallets like Coinbase or Binance, you can hold a wider variety of tokens across more chains, including Bitcoin.
What do I need to use my wallet?
Wallets require funds to be able to send transactions. These funds are used to pay for the transaction fees. Let's look at how to get funds for the Sepolia test network and then how to use them.
Navigate to the following link:
This is called a faucet. A faucet is a service that provides free tokens to users. This is useful for testing purposes, as you can get free tokens to test your application with.
It's important to note that these tokens have no value as they are on a test network. They are only useful for testing purposes. This ensures that you never have to spend real money to test your application.
You can input your address and request some tokens. You should receive them within a few seconds. You can now use these tokens to send transactions on the Sepolia test network.
How do I use my wallet?
Using a wallet differs from wallet to wallet, and it's best to refer to the wallet you are using for instructions on how to use it.
We will explore how to use your account on the Sepolia test network when developing smart contracts in the other courses.
What is a cold wallet and a hot wallet?
A cold wallet is a wallet that is not connected to the internet. They are considered more secure than hot wallets. The biggest reason to use a cold wallet is to store your funds in a secure location over longer periods of time. Examples of cold wallets are Ledger and Trezor.
A hot wallet is a wallet that is connected to the internet. They are more user-friendly and easier to use. Examples of hot wallets are MetaMask, Coinbase, and Binance.
Conclusion
In this course, we looked at what a wallet is, how it works, and how to create a wallet on some of the major blockchains (including the Sepolia test network).
You're now ready to move on to the next course, where we'll be looking at how to develop smart contracts on the Sepolia test network.