A cryptocurrency wallet is nothing else than a software program, which is capable to store both private and public keys. In addition to that, it can also interact with different blockchains, so that the users can send and receive digital currency and also keep a track on their balance.
The way the digital wallets work
In contrast to the conventional wallets that we carry in our pockets, digital wallets do not store currency. In fact, the concept of blockchain has been so smartly blended with cryptocurrency that the currencies never get stored at a particular location. Nor do they exist anywhere in hard cash or physical form. Only the records of your transactions are stored in the blockchain and nothing else.
A real-life example
Suppose, a friend sends you some digital currency, say in form of bitcoin. What this friend does is he transfers the ownership of the coins to the address of your wallet. Now, when you want to use that money, you’ve unlock the fund.
In order to unlock the fund, you need to match the private key in your wallet with the public address that the coins are assigned to. Only when both these private and public addresses match, your account will be credited and the balance in your wallet will swell. Simultaneously, the balance of the sender of the digital currency will decrease. In transactions related to digital currency, the actual exchange of physical coins never take place at any instance.