cannot be distinguished by looking at vin or vout alone. One has to test (vout-vin) == 40 to make sure. Neither case satisfies the “one input and its hash is 0” criteria – they have no input hash. Only the grant tx has zero hash looking like “000…00”
That’s how the raw data are, but getrawtransaction parses that in an attempt to make it more readable. When it’s a CoinBase getrawtransaction actually returns an object with a “coinbase” key in “vin”.
What do you want to know? Whether a transaction is a minting reward? If
there is at least one input
and the first input does not have a “coinbase” key
and the first output is empty (0 value and empty scriptPubKey)