balance
In addition to the complete implementation of bitcoin's core protocol, bitcoin node software also includes an optional but important function mole -- Wallet:
you can regard the wallet as a safe to store all your keys and addresses, and also encapsulate many technical concepts and details of bitcoin, So that it can be understood and accepted by people other than geeks. Therefore, bitcoin enables node wallet by default. If you want to disable the wallet function, for example, you can set the disablewallet option in the configuration file:
disablewallet = 1
the wallet mole will track all address related transactions managed by it, so it can update the balance information of the wallet in time. This function is very important because there is no concept of account in bitcoin. Bitcoin is e-cash scattered among transactions. If there is no wallet to help track transactions related to our address, it is difficult to figure out how many bitcoins we hold in total
Many RPC calls provided bynodes are implemented by wallet mole. For example, when we call the getnewaddress command, the wallet mole generates the key and address and automatically adds them to the wallet, so its related transactions will automatically affect the balance of the wallet. Similarly, when we call getbalance, the wallet mole will collect the bitcoin on all addresses and return the total amount
the above content is extracted from: bitcoin development course
