> I wonder how Blockchain explorers deal with more complex scripts. For example on blockchain.com one can look up coins by putting an "address" into the search bar. But how would one look up coins that are not locked by a script that puts the coins under control of a certain key? Or a script that puts them under control of multiple keys?
Essentially, you "send" the Bitcoin to the hash of the script, then whenever a transaction spends those coins it must reveal the script (whose hash must match), as well as some data (normally a digital signature or two) that fulfills the script's conditions.
So, the block explorer doesn't get to deal with it until the coins are spent, up until that point all it knows is a hash, which is represented as beginning with a "3", to differentiate it from the simple single-key addresses that begin with a "1".
When it's spent, a block explorer could show the revealed script contents if it wanted.
The reveal of the script is actually time-delayed. See https://en.bitcoin.it/wiki/Pay_to_script_hash
Essentially, you "send" the Bitcoin to the hash of the script, then whenever a transaction spends those coins it must reveal the script (whose hash must match), as well as some data (normally a digital signature or two) that fulfills the script's conditions.
So, the block explorer doesn't get to deal with it until the coins are spent, up until that point all it knows is a hash, which is represented as beginning with a "3", to differentiate it from the simple single-key addresses that begin with a "1".
When it's spent, a block explorer could show the revealed script contents if it wanted.