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

Self-driving taxis are coming to London – ought to we be anxious? | Jack Stilgoe

At the top of the nineteenth century, the world’s main cities had an issue. The streets had been flooded with manure, the unintended...

US regulators open inquiry into Waymo self-driving automobile that struck youngster in California | Expertise

The US’s federal transportation regulator stated Thursday it had opened an investigation after a Waymo self-driving car struck a toddler close to an...

US robotaxis bear coaching for London’s quirks earlier than deliberate rollout this yr | London

American robotaxis as a consequence of be unleashed on London’s streets earlier than the tip of the yr have been quietly present process...

Recent articles

More like this

LEAVE A REPLY

Please enter your comment!
Please enter your name here