output – Tips on how to establish a transaction enter sort?

0
55


I’m at the moment engaged on a software parsing each transaction of the bitcoin blockchain, utilizing the getrawtransaction RPC name in verbose mode.
My objective is to retailer all of them in a database, whereas maintaining some helpful details about them (i.e., not all the pieces that’s given by the RPC name).

One thing I’m having bother to grasp although is easy methods to exactly “tag” an enter with a kind? The outputs all have a “sort” string that enables me to tag them as P2SH, P2PK, P2WSH, and so on, however the inputs do not.

What I attempted to this point is to parse the content material of the scriptSig attribute of the inputs. For instance, to know if an enter is P2PK, I learn someplace that the ASM code of the scriptSig of the enter ought to begin with 30. Once I examine with some on-line instruments which have already tagged each transaction inputs/outputs, it seems to be prefer it’s correct, however I haven’t got any proof that what I’m doing is true.

Is there some form of on-line sources with exact specs permitting me to establish an enter? I can not handle to search out any.

One other thought I had is that every output is, clearly, linked to an output.
Might I suppose that the kind of enter is identical because the one of many output it’s linked to?

It will make sense to me, however I’d moderately not bounce to conclusions; I nonetheless have loads to study Bitcoin.

Thanks very a lot!

LEAVE A REPLY

Please enter your comment!
Please enter your name here