What can be the simplest strategy to retrieve addresses which can be utilized in particular transaction? As an illustration, should 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 taking a look at “scriptPubKey”? One of many challenges was there have been several types of scriptPubKey in order that it was sort of onerous to parse them. Does anybody know finest strategy to retrieve public deal with from any sort of scriptPubKey, in order that the outcome will probably be matched with the addresses which can be utilized by block explorers?
P.S. I feel among the newer transactions truly comprise “Handle” discipline contained in the scriptPubKey, however older transactions don’t. I need to have a generalized technique that may deal with any sort of transactions.