Skip to content
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

zcash_client_sqlite: Identify shielding transactions in the output of the v_transactions view. #1046

Closed
nuttycom opened this issue Nov 21, 2023 · 1 comment · Fixed by #1461
Assignees
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.

Comments

@nuttycom
Copy link
Contributor

nuttycom commented Nov 21, 2023

The specific ask here is to identify transactions that were created as a result of clicking the "shield funds" button in a wallet (i.e. by calling propose_shielding). These transactions have the following characteristics:

  • Only transparent inputs.
  • Only shielded outputs.
  • Inputs are all from the wallet.
  • Outputs are all to the wallet.
    • i.e. this is a wallet-internal transaction, though for historic wallets the outputs might not have been sent to wallet-internal addresses.
@nuttycom nuttycom added this to the Zashi 1.0 milestone Jan 3, 2024
@nuttycom nuttycom removed this from the Librustzcash Zashi 1.0 milestone Mar 20, 2024
@nuttycom nuttycom modified the milestone: iOS Zashi 1.1 Apr 9, 2024
@str4d str4d modified the milestone: Zashi 1.1 Apr 30, 2024
@daira daira self-assigned this Jun 13, 2024
@str4d
Copy link
Contributor

str4d commented Jul 25, 2024

We can't implement exactly the above in v_transactions:

  • We do not record any details about other inputs beyond what we ourselves have spent.
  • We do record details about other outputs in the sent_notes table, but probably not as reliably as we'd need.

However, we can implement the following check:

  • Only transparent inputs from our wallet.
  • Only shielded outputs to our wallet.

This can be done by adding a count of does_not_match_shielding that we increment when we observe a spent note that is not from the transparent pool, or a received note that is to the transparent pool. Then sum that counter and is_shielding is when the counter is zero. This would also catch transactions that might be shielding but also potentially have other inputs and outputs; these could be eliminated by fetching the raw transaction to confirm directly.

@str4d str4d assigned str4d and unassigned daira Jul 26, 2024
@str4d str4d added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Jul 26, 2024
@str4d str4d closed this as completed in 04e8d0b Jul 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants