How to search for TXs using only the PublicKey linked to those TXs? The quest is to define a method for searching TXs on the Bitcoin blockchain using only a PublicKey in HEX format - as opposed to searching TXs by popular terms like  wallet ID, txid, hash, etc. 

I haven't found any such method. Does it exist?  

Scenario:

Bob holds a compressed PublicKey of the form  

02af31b067645ffe4eb534d609da80332e5c5747543fd97385e832c6fdf2d4b4bf

Hypothetically, Bob has no other info at his disposal and he wants to query the Blockchain to find all TXs associated with the above PublicKey. 

If Bob succeeds, he finds this Transaction

Is this type of searching the blockchain possible?
In fact, the usual way to consult blockchains is using the public key (purportedly the public key of the searcher) as the result will be all the transactions in which the key is involved:
https://www.blockchain.com/btc/address/1EwpnNBdFJykwxp6X8v9AfZnup9bgmrLE1

I suppose you're puzzled about the way to convert the public key to the public address, as the latter is the one used in blockchain explorers (I don't know if there's some one that can use the public key as input) :


You can use online tools like this one: https://iancoleman.io/bitcoin-key-compression/
Or some code, for example using my very simple Python scripts bitcoin-in-tiny-pieces, in this case, as the prefix of the compressed pub key is 02 we know that y is even, and as y is not necessary in compressed form we can use 0x00 as y coordinate:


:

$ ./bitcoin-address-from-public-key.py af31b067645ffe4eb534d609da80332e5c5747543fd97385e832c6fdf2d4b4bf 00 
pubkey = 04af31b067645ffe4eb534d609da80332e5c5747543fd97385e832c6fdf2d4b4bf00

Compressed public key: 
key_hash =      98f7fbd15e7b30a4ed55aec7baae40729967ba67 
checksum =      c199dbe6fc87793152351aaa25b4ce28e395225dd3abcb4606b159e1ac26b346 
key_hash + checksum =   0098f7fbd15e7b30a4ed55aec7baae40729967ba67 c199dbe6 
bitcoin address =       1EwpnNBdFJykwxp6X8v9AfZnup9bgmrLE1


In case you want to ask directly blockchain.info from command line it is possible to combine various scripts:

C:\&gt; bitcoin-address-from-public-key af31b067645ffe4eb534d609da80332e5c5747543fd97385e832c6fdf2d4b4bf 00 | bitcoin-get-address-balance

address         = 1EwpnNBdFJykwxp6X8v9AfZnup9bgmrLE1
total_received  = 1.57390781 Bitcoin
final_balance   = 0 Bitcoin


In these examples I've modified two lines in bitcoin-address-from-public-key.py with COMPRESS_PUBKEY = 1 and VERBOSE = False.