-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Track the provenance of UTXOs #1342
Labels
A-consensus
Area: Consensus rule updates
C-design
Category: Software design work
C-enhancement
Category: This is an improvement
Milestone
Comments
hdevalence
added
C-enhancement
Category: This is an improvement
S-needs-triage
Status: A bug report needs triage
labels
Nov 20, 2020
hdevalence
added
A-consensus
Area: Consensus rule updates
C-design
Category: Software design work
labels
Nov 20, 2020
Here's the relevant structure in Zcashd (thanks @str4d for the pointer): https://github.com/zcash/zcash/blob/877212414ad40e37cf8e49884a90767c54d59ba2/src/coins.h#L23-L79 |
hdevalence
changed the title
Determine whether a UTXO is the output of a coinbase transaction
Track the provenance of UTXOs
Nov 23, 2020
hdevalence
added a commit
that referenced
this issue
Nov 23, 2020
This commit changes the state system and database format to track the provenance of UTXOs, in addition to the outputs themselves. Specifically, it tracks the following additional metadata: - the height at which the UTXO was created; - whether or not the UTXO was created from a coinbase transaction or not. This metadata will allow us to: - check the coinbase maturity consensus rule; - check the coinbase inputs => no transparent outputs rule; - implement lookup of transactions by utxo (using the height to find the block and then scanning the block) for a future RPC mechanism. Closes #1342
hdevalence
added a commit
that referenced
this issue
Nov 23, 2020
This commit changes the state system and database format to track the provenance of UTXOs, in addition to the outputs themselves. Specifically, it tracks the following additional metadata: - the height at which the UTXO was created; - whether or not the UTXO was created from a coinbase transaction or not. This metadata will allow us to: - check the coinbase maturity consensus rule; - check the coinbase inputs => no transparent outputs rule; - implement lookup of transactions by utxo (using the height to find the block and then scanning the block) for a future RPC mechanism. Closes #1342
hdevalence
added a commit
that referenced
this issue
Nov 23, 2020
This commit changes the state system and database format to track the provenance of UTXOs, in addition to the outputs themselves. Specifically, it tracks the following additional metadata: - the height at which the UTXO was created; - whether or not the UTXO was created from a coinbase transaction or not. This metadata will allow us to: - check the coinbase maturity consensus rule; - check the coinbase inputs => no transparent outputs rule; - implement lookup of transactions by utxo (using the height to find the block and then scanning the block) for a future RPC mechanism. Closes #1342
hdevalence
added a commit
that referenced
this issue
Nov 24, 2020
This commit changes the state system and database format to track the provenance of UTXOs, in addition to the outputs themselves. Specifically, it tracks the following additional metadata: - the height at which the UTXO was created; - whether or not the UTXO was created from a coinbase transaction or not. This metadata will allow us to: - check the coinbase maturity consensus rule; - check the coinbase inputs => no transparent outputs rule; - implement lookup of transactions by utxo (using the height to find the block and then scanning the block) for a future RPC mechanism. Closes #1342
hdevalence
added a commit
that referenced
this issue
Nov 24, 2020
This commit changes the state system and database format to track the provenance of UTXOs, in addition to the outputs themselves. Specifically, it tracks the following additional metadata: - the height at which the UTXO was created; - whether or not the UTXO was created from a coinbase transaction or not. This metadata will allow us to: - check the coinbase maturity consensus rule; - check the coinbase inputs => no transparent outputs rule; - implement lookup of transactions by utxo (using the height to find the block and then scanning the block) for a future RPC mechanism. Closes #1342
7 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-consensus
Area: Consensus rule updates
C-design
Category: Software design work
C-enhancement
Category: This is an improvement
Is your feature request related to a problem? Please describe.
One of the transaction consensus rules, whose previous implementation was removed in f607c98 , 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.
The text was updated successfully, but these errors were encountered: