How do block explorer sites show information that is not available on Bitcoin Core? As I understood in the following post How to get unspents for a specified bitcoin address?, we should use listunspent only on addresses that belong to our own wallet otherwise will return blank.

But let's take an example of blockchain.info or block.io. Once we type in an address - any address, even if we generate it manually (paper wallet, or algorithmically) - and transfer some BTCs, a search of the address in one of those explorers shows me the funds.


How can they possibly have information from this newly generated address?
How can they list the unspent transactions and the current amount of an address which "is not in their wallet"?
How can they list the unspent transactions and the current amount of an address which "is not in their wallet"?


Block explorer sites maintain a separate database of information which is built by continuously scanning the Bitcoin blockchain. If block explorer sites see a standard locking script in the outputs of the transactions, they scrape the addresses out of those locking script and the amount associated with that output. This information is added to their database. Also, when a user spends bitcoins, he has to reference the txid and the output index in the input of the transaction. The block explorer sites uses this information to locate that output and check the output locking script, from which they derive the 'input address'. All of this information and continuous lookups allows block explorer sites to associate funds with addresses and show whether the bitcoins sent from a transaction have been spent or not. However, if you lock a transaction in a custom script, the block explorer sites won't be able to decode this information.


  How can they possibly have information from this newly generated address?


They continuously scan the blockchain from which they can get transactions included in blocks. Also block explorer sites run full nodes that helps them collect transactions relayed by other nodes in the mempool that haven't been confirmed in blocks yet.