block – Relation between transaction information and transaction id

on

|

views

and

comments


Since BIP144, transaction information consists of two components (regular information and witness information). There are additionally two distinct transaction serialization codecs:

  • The legacy serialization format, which shops model quantity, transaction inputs, transaction outputs, and locktime.
  • The prolonged serialization format, which additionally has a flag/marker to point the prolonged format is in use, and has witness information for each transaction enter.

The prolonged format should be used if witness information is current. The legacy format should be used if no witness information is current.

The txid is the double-SHA256 hash of the serialized transaction in legacy format, that means that any witness information needs to be stripped out (because the legacy format doesn’t help witness information). If the transaction had no witness information within the first place (as pre-segwit transaction do), the txid is simply the hash of the serialized transaction.

The hash (or wtxid) of a transaction is the double-SHA256 hash of the serialization together with potential witness information. If the transaction accommodates no witness information, this similar to the txid.

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