Ok, great. But my regtest setup (version 14.1) gives me a similar raw coinbase transaction:
020000000001010000000000000000000000000000000000000000000000000000000000000000ffffffff050282060101ffffffff020e642500000000002321031a70a95a57f63b7d63e46803d385fd483b77f7a71a7a753ffcf7aafb67ec3edcac0000000000000000266a24aa21a9edad9d9c439414e2d257fda34cdc00667c0ecd7d78256721a4178046b49ee7382f0120000000000000000000000000000000000000000000000000000000000000000000000000
Is the implementation error in the node? Maybe working in 15.0?
Hmm. That's interesting. I can reproduce that. I will investigate and see what's up with that.
Regardless, the txid is calculated from the non-witness serialization of a transaction, so you should strip out the witness parts of this and hash the remaining. That will get you the txid.
Ok, so apparently that is actually expected behavior. From BIP 141:
and the coinbase's input's witness must consist of a single 32-byte array for the witness reserved value.
This is done to allow for future extensibility.