1

Shown in the gray area here, describing how to apply, I think, Segwit to a transaction (particularly a Bitcoin Cash tx). The last section is titled "serialized signed transaction" however it doesn't appear to be the final form of the raw tx that you can copy and paste into a bitcoin cash wallet to use "sendrawtransaction". Or is it the final raw tx form in spite of what it appears to be to me?

Example of final copy and paste form of a bitcoin cash tx: Tx f0b9313fc11ce5ec5ac619f35dcf332530e99d185d8ee79b913bcc0b8b5e6df1

01000000

01

f5a6acfe637ceb57552e703bd4a3bb7ae10c75e81886646cf4ca641881daa4a3

00000000

6b48304502210088b72059940330faa94940a6f37b1be4d926a4d246abda8a1e6174a3a00659

040220

06e0627d6525afa275c4e730799ac11c037eed2e35a0839afcc62dfe710afb3d

4121

035e366a13be81aaada32f309b289ca26741fd55c582d6d8d394f9be7c7519974f

feffffff

02643fcb1d00000000

1976a9149b52b7016d89c5ad7645a8bbc34719b46131545288ac

0094357700000000

1976a914787b7c14737c3956456f40cf7abfca9b641afd5788ac

00000000

What the original webpage shows (but not for the same tx):

01000000

00

01

02

fff7f7881a8099afa6940d42d1e7f6362bec38171ea3edf433541db4e4ad969f

00000000

494830450221008b9d1dc26ba6a9cb62127b02742fa9d754cd3bebf337f7a55d114c8e5cdd30be

0220

40529b194ba3f9281a99f2b1c0a19c0489bc22ede944ccf4ecbab4cc618ef3ed01

eeffffff

ef51e1b804cc89d182d279655c3aa89e815b1b309fe287d9b2b55d57b90ec68a01

00000000

ffffffff

0220

2cb20600000000

1976a9148280b37df378db99f66f85c95a783a76ac7a6d5988ac

9093510d00000000

1976a9143bde42dbee7e4dbe6a21b2d50ce2f0167faa815988ac

000247304402203609e17b84f6a7d30c80bfa610b5b4542f32a8a0d5447a12fb1366d7f01cc44a

0220

573a954c4518331561406f90300e8f3358f51928d43c212a8caed02de67eebee

0121

02

5476c2e83188368da1ff3e292e7acafcdb3566bb0ad253f62fc70f07aeee6357

11000000

The one from the example website shows the "00" and the "02" being added near the beginning and that huge mess of stuff after the final output is mentioned. Yet the first example I gave is the raw data straight from a "getrawtransaction" through the bitcoin cash wallet and it does not contain those things and yet is still considered to be valid. Or is all that other stuff just basically "extra"?

  • Why does it not appear to be the final form of the raw tx? – Pieter Wuille Aug 17 '17 at 23:37
  • Also, BIPs are proposals for Bitcoin, not Bitcoin Cash. Bitcoin Cash doesn't even have Segwit (and seems very opposed to even). – Pieter Wuille Mar 24 '18 at 8:13
0

I would like to comment on your "mess of stuff"... maybe not the best way to get support, if you don't understand what it is, and define it as such. I decode it here for you:

VERSION
 01000000

SEGWIT (BIP141): this is a segwit tx, marker=00
       (BIP141): flag=01

TX_IN COUNT [var_int]: hex=02, decimal=2
 TX_IN[0]
  TX_IN[0] OutPoint hash (char[32])
  9F96ADE4B41D5433F4EDA31E1738EC2B36F6E7D1420D94A6AF99801A88F7F7FF
  TX_IN[0] OutPoint index (uint32_t)
  hex=00000000, reversed=00000000, decimal=0
  TX_IN[0] Script Length (var_int)
  hex=49, decimal=73
  TX_IN[0] Script Sig (uchar[])
  4830450221008B9D1DC26BA6A9CB62127B02742FA9D754CD3BEBF337F7A55D114C8E5CDD30BE022040529B194BA3F9281A99F2B1C0A19C0489BC22EDE944CCF4ECBAB4CC618EF3ED01 
  TX_IN[0] Sequence (uint32_t)
  EEFFFFFF
 TX_IN[1]
  TX_IN[1] OutPoint hash (char[32])
  8AC60EB9575DB5B2D987E29F301B5B819EA83A5C6579D282D189CC04B8E151EF
  TX_IN[1] OutPoint index (uint32_t)
  hex=01000000, reversed=00000001, decimal=1
  TX_IN[1] Script Length (var_int)
  hex=00, decimal=0
  TX_IN[1] Sequence (uint32_t)
  FFFFFFFF
TX_OUT COUNT, hex=02, decimal=2
 TX_OUT[0]
  TX_OUT[0] Value (uint64_t)
  hex=202CB20600000000, reversed_hex=0000000006B22C20, dec=112340000, bitcoin=1.12340000
  TX_OUT[0] PK_Script Length (var_int)
  hex=19, dec=25
  TX_OUT[0] pk_script (uchar[])
  76A9148280B37DF378DB99F66F85C95A783A76AC7A6D5988AC
 TX_OUT[1]
  TX_OUT[1] Value (uint64_t)
  hex=9093510D00000000, reversed_hex=000000000D519390, dec=223450000, bitcoin=2.23450000
  TX_OUT[1] PK_Script Length (var_int)
  hex=19, dec=25
  TX_OUT[1] pk_script (uchar[])
  76A9143BDE42DBEE7E4DBE6A21B2D50CE2F0167FAA815988AC

WITNESS TXIN[0] stack elements: hex=00, decimal=0
WITNESS TXIN[1] stack elements: hex=02, decimal=2
 WITNESS data[0]:
  47304402203609E17B84F6A7D30C80BFA610B5B4542F32A8A0D5447A12FB1366D7F01CC44A0220573A954C4518331561406F90300E8F3358F51928D43C212A8CAED02DE67EEBEE01
 WITNESS data[1]:
  21025476C2E83188368DA1FF3E292E7ACAFCDB3566BB0AD253F62FC70F07AEEE6357

 LOCK_TIME
11000000

So the 02 at the beginning indicates two inputs (TX_IN COUNT), and it's witness data is displayed at the end.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.