This requires tracking the provenance of UTXOs to some extent, which may require changing the data we store in our database. It might be worth checking what Zcashd does here.
Describe the solution you'd like
Rather than just tracking raw transparent::Outputs, we should track Utxos, a new structure that includes a transparent::Output as well as metadata:
Is your feature request related to a problem? Please describe.
One of the transaction consensus rules, whose previous implementation was removed in https://github.com/ZcashFoundation/zebra/pull/1340/commits/f607c9840aa2e37a14cb595fd6e9b9a1fa478850 , requires that transactions with transparent inputs which are the outputs of coinbase transactions must have no transparent outputs. (The previous implementation did not actually check this).
This requires tracking the provenance of UTXOs to some extent, which may require changing the data we store in our database. It might be worth checking what Zcashd does here.
Describe the solution you'd like
Rather than just tracking raw
transparent::Output
s, we should trackUtxo
s, a new structure that includes atransparent::Output
as well as metadata:This requires:
Utxo
structure;Utxo
structure as stored in the database;zebra_state::Response::Utxo
variant to return aUtxo
rather than a rawOutput
;Then, in subsequent PRs, we can use this information to implement the relevant consensus rules.