How do the block explorers do the search by addresses -- do they
search the entire blockchain at query time, which is very inefficient,
or do they maintain some sort of index which they update iteratively?
The block explorers parse all of the transactions one by one and create their own database and index using the address generated from the ...
Is the blocks and chainstate folder store the same blocks data ?
No, the blocks directory contains the actual blocks. The chainstate directory contains the state as of the latest block (in simplified terms, it stores every spendable coin, who owns it, and how much it's worth).
How can we read those data using code and display that on the web frontend ...
The actual script implemented on Lightning Network is a little bit different from what you quoted. This is the script below and the specification is here
# Penalty transaction
I've created that transaction on ...
If you look closely on blockexplorer.com, you will notice that the site does mention that the transaction was included in block #1484064. The blockexplorer seems to be confused about the height of the blockchaintip, or has some other general issues regarding the confirmation count. For example, it shows all of the transactions in the latest block to have -...