bitcoin core – Easy methods to decide the transaction kind utilizing transaction hash?

0
52


Easy methods to decide the transaction kind utilizing transaction hash?

There isn’t a idea of kind within the Bitcoin community. Due to this fact, neither transactions nor outputs nor inputs have a kind. Nonetheless, the outputs (locking scripts) are most frequently of a sure customary kind, and the inputs then devour these customary outputs. Due to this fact, some group of output and enter varieties is definitely outlined from these customary types of output and enter. You will need to perceive that these varieties (P2PKH, P2SH and many others.) exist just for finish customers and never for the Bitcoin community. The kind of enter or output just isn’t indicated wherever within the transaction.

Right here you may see all sorts of output: hyperlink

Right here you may see decide the enter kind: hyperlink

Primarily based on every little thing written, the conclusion is that there is no such thing as a transaction kind, however solely enter and output kind (though this isn’t a part of the community). What we might probably outline as the kind of transaction is whether or not it’s a segregated witness (segWit) or not, that’s, whether or not a number of the inputs devour the segWit output or such an enter doesn’t exist within the transaction. Such a transaction will be acknowledged very simply when its uncooked (serialized) kind. Particularly, the worth of the fifth byte is 0x00 and the worth of the sixth byte is 0x01. If the fifth and sixth bytes aren’t set to those values, it’s a non-segWit transaction.

Is there any technique to determine the transaction kind utilizing the next knowledge in Bitcoin blockchain:

No, you can not decide both the output kind, the enter kind, or the transaction kind based mostly on the given fields.

LEAVE A REPLY

Please enter your comment!
Please enter your name here