Calculating addresses from Bitcoin transaction information

on

|

views

and

comments


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.

Share this
Tags

Must-read

Constructing the Torc Driverless Security Case

At Torc, we’ve structured our security case on three foundational pillars: Engineer It to Be Secure, Function It to Be Secure, and the...

What’s DL+S? Unlocking the Huge Information Required to Develop Autonomous Vans

Breakthroughs in AI for autonomous driving don't occur in isolation. They occur when information, simulation, machine studying, infrastructure, and car testing work as...

Why I can’t wait to get right into a driverless automotive | Self-driving automobiles

Adrian Chiles (Driverless automobiles are taking us on a street to nowhere, 10 September) needs to know who requested for driverless automobiles. I...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here