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 transaction builder #33

Open
howardwu opened this issue Jul 22, 2019 · 6 comments
Open

Zcash transaction builder #33

howardwu opened this issue Jul 22, 2019 · 6 comments
Assignees
Labels
enhancement New feature or request
Projects

Comments

@howardwu
Copy link
Owner

Summary

  • Implement Zcash transaction builder
  • Implement test suite for Zcash transaction builder
@howardwu howardwu added the enhancement New feature or request label Jul 22, 2019
@howardwu howardwu added this to Open in v0.7.0 via automation Jul 22, 2019
@raychu86 raychu86 self-assigned this Aug 11, 2019
@raychu86
Copy link
Contributor

raychu86 commented Aug 21, 2019

Implementation WIP in feature/zcash-transactions.

  • t-addr -> t-addr
  • t-addr -> z-addr
  • z-addr-> t-addr
  • z-addr -> z-addr

Note: All z-addresses refer to sapling addresses.

@jakinyele
Copy link
Contributor

Looking forward to z-addr -> t-addr/z-addr! Well done @raychu86 @howardwu!

@raychu86
Copy link
Contributor

raychu86 commented Sep 4, 2019

Current implementation generates sapling spends and outputs with valid proofs.

Shielded outputs have been tested with real transactions (successfully broadcasting the crafted transaction hexes), however shielded spends have not. This is because sapling spends require a the latest state of the sapling tree state in order to determine a valid anchor and nullifier.

Further research is underway regarding tests for real sapling spends.

Testing proposal:

  1. Run a zcash node
  2. Extract a serialize sapling tree state or note witnesses using GDB or LLDB.
  3. Import the serialized value into wagyu transaction builder
  4. Generate the transaction hex
  5. Broadcast the transaction via zcash-cli

@raychu86
Copy link
Contributor

Preliminary implementation for Zcash transaction builder is complete with real transaction tests.

NOTE:
Sending real transactions with sapling spends require the most recent sapling tree state (current tests use gdb/lldb dives into the Zcash node to retrieve this information). gdb/lldb scraping for state information was only used for testing and future development will be require a separate stateful client.

Current scraping techniques only allows us to obtain the commitment tree witnesses and anchor separately, however the ideal implementation should obtain the full tree or the incremental witnesses.

@jakinyele
Copy link
Contributor

Thanks again @raychu86! This is fantastic!

One question about sapling witnesses: couldn't you extract the commitment tree witnesses and anchors from the light client? The client includes a sqlite DB for the most recent witnesses. See: https://github.com/str4d/librustzcash/blob/preview/zcash_client_backend/src/sqlite.rs

Would this help?

@raychu86
Copy link
Contributor

Thanks for the pointer! That would most likely work.

I'll look into that avenue and do some testing to see if I can further simplify/untangle the transaction building process.

@howardwu howardwu moved this from Open to In Progress in v0.7.0 Sep 18, 2019
@howardwu howardwu moved this from In Progress to Closed in v0.7.0 Apr 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
v0.7.0
  
Closed
Development

No branches or pull requests

3 participants