Can I generate an address without using bitcoin core? I am running bitcoin core in my mode. I am using getnewaddress to generate an address and then I am using unspent to get the unspent of an address which returns the unspent successfully. If I created an address without using getnewaddress (using some 3rd party or offline) and when I am using unspent on that address it is not giving the unspent instead it is returning an empty list. Could anyone tell me how to solve this?
Bitcoin Core does not store the information for all addresses as that would be computationally expensive and not very useful. For you to get this data, the address needs to be part of your wallet. So you must add the address to the wallet using importaddress and allow Bitcoin Core to rescan the blockchain. It will then find all of the transactions related to that address and look for new transactions related to that address. Note that rescanning can take a long time so if you want to import multiple addresses, use importmulti.