4
Writing my own blockchain parser, I have come across an unrecognized opcode in block number 142312. The relevant section of the transaction input is this:
"in":[
{
"prev_out":{
"hash": "0000000000000000000000000000000000000000000000000000000000000000",
"n": 4294967295
},
"coinbase": "fc70035c7a81bc6f4876c6036e4bc4080eaf81377bc9672828061491e79df5d4ddf1d65b058ccb30563f1f1c14f658607bd2c7138e87e480bcec3f5b91d041d041"
}
],
fc corresponds to opcode 252, which is not listed in the Bitcoin wiki. How should I interpret this script value?
My block parsing program gives me the following raw coinbase script value:
fc70035c7a81bc6f4876c6036e4bc4080eaf81377bc9672828061491e79df5d4ddf1d65b058ccb30563f1f1c14f658607bd2c7138e87e480bcec3f5b91d041d041
That is, there isn't any opcode before the above hexadecimal string.
i know they aren't but i have parsed the block myself and this is how the coinbase script starts - there is no op_pushdata before 'fc'. i will update the question with the full coinbase script value in a sec – mulllhausen – 2013-11-25T05:40:58.557
@mulllhausen Actually, I forgot that blockexplorer.com prints coinbase scriptsigs differently than other scripts. It does start with 0xFC. This is legal: coinbase scriptsigs can be invalid scripts, even if they usually are valid. You can't interpret it as a script because it isn't one. – theymos – 2013-11-25T06:28:59.007
ah right. how can i identify whether the script element is a coinbase scriptsig? i'm guessing it would be wrong to assume that the first transaction in the block is always the coinbase transaction? – mulllhausen – 2013-11-25T06:31:05.637
@mulllhausen No, that's right. – theymos – 2013-11-25T06:31:37.223
you mean it is identified as being the first transaction in the block? – mulllhausen – 2013-11-25T06:44:35.217
1@mulllhausen Yes, the coinbase tx is always the first tx in a block, and every block must have a coinbase tx. – theymos – 2013-11-25T07:30:36.720