The wallet software is used to store private or public keys and Bitcoin address. It performs various functions, such as receiving and sending bitcoins. Nowadays, software usually offers both functionalities: Bitcoin client and wallet. On the disk, the Bitcoin core client wallets are stored as the Berkeley DB file:
$ file wallet.dat
wallet.dat: Berkeley DB (B-tree, version 9, native byte-order)
Private keys are generated by randomly choosing a 256-bit number by wallet software. The rules of generation are predefined and were discussed in Chapter 4, Public Key Cryptography. Private keys are used by wallets to sign the outgoing transactions. Wallets do not store any coins, and there is no concept of wallets storing balance or coins for a user. In fact, in the Bitcoin network, coins do not exist; instead, only transaction information is stored on the blockchain (more precisely...