Is there a way to get sender's public key based only on the raw transaction data no matter the P2... type?
Is there a way to get sender's public key based only on the raw transaction data no matter the P2... type
Probably, if you exclude all current transaction types whose most popular names don't begin with the words "pay to ...":
|Script type||Public Key in locking script||Public Key in unlocking script|
|Pay-to-Script-Hash (P2SH)||No||Yes (in redeem script)|
The last of these is the most comprehensive of those listed, however it lacks full details.
The method that can be used to retrieve the public keys in each case (i.e. answer to How?) can be found by inspecting the detailed descriptions in the linked references above. Exact details depend on available tools and skillsets.