Author

Topic: RAW transaction format - nead help (Read 176 times)

staff
Activity: 3458
Merit: 6793
Just writing some code
November 02, 2019, 12:18:25 PM
#2
It's the empty witness stack for the second input. The second input is not segwit, but because there is a segwit input in this transaction, it has to have something in the witness area. So it just has the empty stack which is represented by a single 0 byte.
kzv
legendary
Activity: 1722
Merit: 1285
OpenTrade - Open Source Cryptocurrency Exchange
November 02, 2019, 11:35:36 AM
#1
Hello

I have read this
https://en.bitcoin.it/wiki/Protocol_documentation#tx
https://bitcoin.org/en/developer-reference#raw-transaction-format

and still can not understand one byte in my RAW transaction (testnet)
Code:
getrawtransaction 2e4308716eaaf6d27d2b91bfe2a78fc7819176966b619b6d8dc675f5373aa3d9
Quote
0200000000010218f739a82336bfec14c75a55ef28260b493ea89711319ba799368380328ddbe00 00000001716001408a8ba315488b40811b9886ff4396e0c94ce183efeffffff6cc66a094304e399 a9678dfbf1f88a8f2223c67d38ad0c69f5a8426d54ab479a000000006a473044022062e7ba2ec9a 4a26fba867624b7786f6e1cd11363186bcf73a5a163b2f32f1d1e02204 332986870d8e8d54545313deabab49586d851f7c74c185026b731b0e172d20b012103903c1d380a 2b05c96e8ad40cbc8a1b647cadef7a1deff8df6b8528a337465cdffeffffff0202450f000000000 017a9148536bef594948115aa8ea99ce415767df30f8a3a87a06f2200000000001976a9140bb5f9 fffd2c0f7bbb9dd4116341f3fba10d041888ac024730440220724686754b2c80564048cbafab84e07ab91f9e9a64c1baca8e726de70209e9cd02201f9 1ac61ce789e7032c2561dc24e26adca029d6449d82e96c252ace18d4dbba40121026f627029af8b 372f3c81c5ae5cb4ce0971fb6d059e22351bc7191d9841a4156e00ac1f1800

Last 4 bytes is a locktime, but what is the leading zero byte??

Code:
decoderawtransaction 0200000000010218f739a82336bfe...

Quote

{
  "txid": "2e4308716eaaf6d27d2b91bfe2a78fc7819176966b619b6d8dc675f5373aa3d9",
  "hash": "3dc884c4d56e4d940ce3d52c7e41956e26c5393ace11f594baaac7699938d79a",
  "version": 2,
  "size": 397,
  "vsize": 315,
  "weight": 1258,
  "locktime": 1580972,
  "vin": [
    {
      "txid": "e0db8d3280833699a79b311197a83e490b2628ef555ac714ecbf3623a839f718",
      "vout": 0,
      "scriptSig": {
        "asm": "001408a8ba315488b40811b9886ff4396e0c94ce183e",
        "hex": "16001408a8ba315488b40811b9886ff4396e0c94ce183e"
      },
      "txinwitness": [
        "30440220724686754b2c80564048cbafab84e07ab91f9e9a64c1baca8e726de70209e9cd02201f9 1ac61ce789e7032c2561dc24e26adca029d6449d82e96c252ace18d4dbba401",
        "026f627029af8b372f3c81c5ae5cb4ce0971fb6d059e22351bc7191d9841a4156e"

      ],
      "sequence": 4294967294
    },
    {
      "txid": "9a47ab546d42a8f5690cad387dc623228f8af8f1fb8d67a999e30443096ac66c",
      "vout": 0,
      "scriptSig": {
        "asm": "3044022062e7ba2ec9a4a26fba867624b7786f6e1cd11363186bcf73a5a163b2f32f1d1e0220433 2986870d8e8d54545313deabab49586d851f7c74c185026b731b0e172d20b[ALL] 03903c1d380a2b05c96e8ad40cbc8a1b647cadef7a1deff8df6b8528a337465cdf",
        "hex": "473044022062e7ba2ec9a4a26fba867624b7786f6e1cd11363186bcf73a5a163b2f32f1d1e02204 332986870d8e8d54545313deabab49586d851f7c74c185026b731b0e172d20b012103903c1d380a 2b05c96e8ad40cbc8a1b647cadef7a1deff8df6b8528a337465cdf"
      },
      "sequence": 4294967294
    }
  ],
  "vout": [
    {
      "value": 0.01000706,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_HASH160 8536bef594948115aa8ea99ce415767df30f8a3a OP_EQUAL",
        "hex": "a9148536bef594948115aa8ea99ce415767df30f8a3a87",
        "reqSigs": 1,
        "type": "scripthash",
        "addresses": [
          "2N5PbScRn7p7m2HEs1Bh8tshbN7TpgtRvxM"
        ]
      }
    },
    {
      "value": 0.02256800,
      "n": 1,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 0bb5f9fffd2c0f7bbb9dd4116341f3fba10d0418 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a9140bb5f9fffd2c0f7bbb9dd4116341f3fba10d041888ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
          "mgasj7m5vQWp4zixtHjiEgpGxex6ZCvhX8"
        ]
      }
    }
  ]
}





Jump to: