I'm trying to locate the public keys associated with a Bitcoin block's transaction inputs and outputs.
Can anyone tell me where those are encoded?
Thank you.
I'm trying to locate the public keys associated with a Bitcoin block's transaction inputs and outputs.
Can anyone tell me where those are encoded?
Thank you.
Simply put, in general you can't.
Depending on the signature schema, all you could get would be a hash of that public key, or, even worse, a hash of a redeem script.
More specifically, you could get some public keys in some cases. This is a partial list of what you could get:
There are other signature schemes and in standard transactions you should be able to get either the source public key or the destination public key.
What you could do is indexing the whole blockchain and fill the gaps in transactions where BTC addresses are not included together with their public key. But, for instance, if your BTC address appears only in P2PKH outputs, you have no means to find that public key.