You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If we are producing a hash for either a coinbase transaction, or a non-coinbase transaction that has no transparent inputs, the value of transparent_sig_digest is identical to the value specified in section T.2.
The term "field encoding" refers to the binary serialized form of a Zcash transaction field, as specified in section 7.1 of the Zcash protocol specification.
A 32-byte null, as a coinbase has no previous outpoint.
4
index (UINT32_MAX)
uint32_t
0xffffffff, as a coinbase has no previous outpoint.
Thus, the required field encoding of the output field values for the transparent input of a coinbase transaction, is the field encoding of a null prevout. And indeed that is what we use.
I will note that "3.11 Coinbase Transactions" was added to the protocol spec in March 2022, after the Zebra bug occurred and this issue was filed. However, ZIP 244 is clear that the encoding is the one used in the transaction, and AFAIK Zebra did not have a bug in how it parsed and serialized coinbase transactions (and thus must have been correctly handling null prevouts).
I also note an issue with that March 2022 change: the protocol spec uses "null prevout" and "non-null prevout", but does not specify "prevout" AFAICT.
In ZIP-143 and ZIP-244 it's not clear how the prevouts of coinbase transactions should be handled. This may have contributed to a bug in Zebra.
The expected behaviour is implicit, since Bitcoin uses a "fake" outpoint for coinbase transactions and this outpoint is what must be hashed.
It would be helpful to mention this explicitly in those ZIPs.
The text was updated successfully, but these errors were encountered: