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

Proposals for integrating ZK-Snarks #14

Closed
ch4ot1c opened this issue Jan 18, 2018 · 9 comments
Closed

Proposals for integrating ZK-Snarks #14

ch4ot1c opened this issue Jan 18, 2018 · 9 comments

Comments

@ch4ot1c
Copy link

ch4ot1c commented Jan 18, 2018

Proposals for integrating ZK-Snarks into Electrum ~

1. Full -

Wrap libsnark (c++) in some way so we can use it from the Electrum client code (python). This will allow us to generate and broadcast shielded transactions, both within the Electrum client.
https://github.com/pybind/pybind11
http://pybind11.readthedocs.io/en/master/basics.html
Boost.Python and this (PyBind11) are my 2 best results from research. Pybind11 looks better.

We are attempting to write high-assurance code so tests will be needed to ensure we do it right - but this binding will let us avoid doing 'translations' from c++ to python - that's high assurance.

In terms of implementation:
https://github.com/scipr-lab/libsnark
and the even more low-level:
https://github.com/scipr-lab/libff
need to generally replace:
https://github.com/BTCP-community/electrum-zcl/blob/master/lib/bitcoin.py#L739
https://github.com/BTCP-community/electrum-zcl/blob/master/lib/bitcoin.py#L885
and more. Defining which functions to swap is a significant part of the research.

Helpful libsnark tutorial:
https://github.com/howardwu/libsnark-tutorial

2. Not fully 'lite' but legitimate -

First, we need to test and verify (on any node) that 1) can we configure zcashd to run with wallet support and 2) confirm z_* send methods and their shielded txn generation steps are both working on it. We should select the latest (linux) release of zcashd, and make a shell script to fetch, build, and install it during Electrum installation. From there, as @csulmone proposed, we can use it as an unplugged-but-specialized generator for all things shielded. (At the end of this dev cycle we will also build zcashd for all platforms ofc)

We can begin one or both of these routes, as development progress is becoming urgent. I have received guidance that option 2 is preferred if it proves significantly faster or easier - I think the first is worth a try though.

@nxsofsys
Copy link
Collaborator

nxsofsys commented Jan 18, 2018

There is problem with building libsnark for windows - only cygwin build available, and it may be problematic to use python bindings with python, which built with MS Visual Studio.

I prefer libff at this moment. Instead of python bindings there may cython used.

@ch4ot1c
Copy link
Author

ch4ot1c commented Jan 19, 2018

Transparent addresses are now sending and receiving funds. Some enhancements need to be made to wallet management, but we are now at a reasonable point to begin working on this item.

@thomasuno
Copy link

thomasuno commented Jan 19, 2018

Is someone working on this @ch4ot1c ?
I have a developer that could work on 1. Full but he wants a bounty.
Thomas

@ch4ot1c
Copy link
Author

ch4ot1c commented Jan 20, 2018

@thomasuno we have a team of around 5 working on it. He's welcome to join and there is a bounty, his contributions can entitle him to a split

@ch4ot1c
Copy link
Author

ch4ot1c commented Feb 7, 2018

Please see the wiki for our followup notes: https://github.com/BTCP-community/electrum-zcl/wiki

@tazeat
Copy link

tazeat commented Feb 23, 2018

With less than a week until the BTCP fork, will shielded z addresses be supported before the fork?

Without this support, no one can claim their BTCP if it is currently in a shielded wallet as far as I can tell as this is the only officially supported wallet so far for BTCP (and this function is necessary for the "Private" part of the coin name to make any sense). If the feature is not to be implemented, everyone holding ZCL must first move our balances to unshielded addresses before the fork to claim them immediately after fork. Will there be an official announcement one way or the other?

@vitsalis
Copy link

We have already created a wrapper for libff using Cython. Perhaps it could be useful.

@sulmone
Copy link
Collaborator

sulmone commented Mar 1, 2018

There is a full node wallet that supports shielded transactions. Implementing shielding in electrum is difficult in many places.

@ch4ot1c ch4ot1c moved this from ToDo to Done in Shielded Transactions Mar 3, 2018
@ch4ot1c
Copy link
Author

ch4ot1c commented Mar 5, 2018

Closing; this is under development (method 2).

@ch4ot1c ch4ot1c closed this as completed Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

6 participants