What can be the simplest approach to retrieve addresses which can be utilized in particular transaction? For example, in the event you have a look at following transaction which is retrieved by getblock of JSON RPC with argument of verbosity 2 (https://developer.bitcoin.org/reference/rpc/getblock.html),
....
"tx":[
{
.....
"vin":[
{
"coinbase":....,
"sequence": ...
}
],
"vout":[
{
"value":...,
"n":...,
"scriptPubKey":{
"asm":...,
"desc":...,
"hex":...,
"type":...
}
}
]
How can I do know receiver’s deal with by “scriptPubKey”? One of many challenges was there have been several types of scriptPubKey in order that it was form of laborious to parse them. Does anybody know finest approach to retrieve public deal with from any form of scriptPubKey, in order that the end result might be matched with the addresses which can be utilized by block explorers?
P.S. I believe among the newer transactions really comprise “Handle” subject contained in the scriptPubKey, however older transactions don’t. I wish to have a generalized technique that may deal with any form of transactions.
