Skip to content

Commit 22d06e5

Browse files
authored
zkWasm Rollup: Rollup Transfer Transactions based on Wasm (w3f#1487)
* draft wasm rollup * specify apache 2.0
1 parent ae26cd3 commit 22d06e5

File tree

1 file changed

+221
-0
lines changed

1 file changed

+221
-0
lines changed
Lines changed: 221 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,221 @@
1+
# Zkwasm Rollups Transfer
2+
3+
- **Team Name:** Zkwasm Rollups Transfer
4+
- **Payment Address:** 0x9061b0787D28d0fDaD845d670F7505EAE5F3B01B (USDT)
5+
- **Level:** 3
6+
7+
## Project Overview :page_facing_up:
8+
9+
We would like to implement transfer rollups by **zkwasm**.
10+
11+
This project enables us high speed and cheap gas fee transfer transactions by **zkwasm**. The structure is similar to **zk rollup** but we use **wasm** as execution environment.
12+
13+
### Overview
14+
15+
Through this grant, we would like to implement rollup L2 envorinment for transfer transactions powered by **zkwasm**. The **zk rollup** allows us high speed and cheap gas fee transfer transactions, and to deposit asset safely. We inherit these features and execute transfer transactions on L2 **wasm** environment, and prove the validity of state transition by zero knowledge proof.
16+
The main differences from **zk rollup** are two things.
17+
18+
#### General purpose rollup
19+
20+
The **zk rollup** is application specific and it can only execute transfer transactions. Supporting **wasm** allows us to extend to other functionalities easily as in [zkevm](https://github.com/privacy-scaling-explorations/zkevm-circuits) and we can reuse the circuit which proves the validity of **wasm** instruction set. By implementing all **wasm** ISA, we can finally prove every kind of state transition.
21+
22+
#### Implement verification function as built-in
23+
24+
The **zk rollup** is smart contract project. Users need to deposit their asset to smart contract on mainchain, transfer asset on chain after deposit is confirmed and withdraw asset from smart contract on mainchain. It's complicated process and needed a lot of developer workload. By implementing verification function as built-in, normal node can be L2, aggregate transfer transactions without any customizing and send it to verification on mainchain directly. This has huge usability benefit because users don't care about anything but just transfering asset as usual.
25+
26+
### Project Details
27+
28+
**zkwasm** depends on `cryptography primitive` and `zero knowledge proof library`.
29+
30+
#### Cryptography Primitive
31+
32+
In **zkwasm** scheme, proof generations needs heavy workload. The prover time is latency when users send transaction and verification time is gas cost for miner. We have two approach to resolve this problem. One is the optimization and the other is outsource. We already implemented curve so we would like to optimize and extend it. We are going to implement and optimize as following.
33+
34+
1. implement `RedDSA`
35+
2. optimize jubjub curve
36+
3. implement client wallet
37+
38+
`RedDSA` allows us to generate one time signing key which has same signature with private key. We can outsource the computation when generating proof by generating proof generation key. There are several ways to optimize jubjub so we are going to apply it to our implementation.
39+
40+
Finally, we are going to implement client libraries.
41+
42+
#### Zero Knowledge Proof Library
43+
44+
We generate the proof to prove the validity of **wasm** execution. To prove validity of execution, we use plonk. The main strategy is that writing circuits for each **wasm** instruction set and generate the proof. The transaction can be divided into sequence of instruction set. To prove each sequence of instruction set are executed correctly, we can prove the validity of transaction. Finally, we aggregate these proof and generate one proof. Users attach it with their transaction and blockchain verify the proof. We are going to implement following libraries to realize this scheme.
45+
46+
1. implement `plookup`
47+
2. implement `recursive proof`
48+
3. implement instruction set circuits
49+
50+
`plookup` allows us to reduce the complexity of instruction set by using lookup table and `recursive proof` allows us to generate one proof by aggregating proof for each instruction set.
51+
52+
### Ecosystem Fit
53+
54+
This **zkwasm** allows us to prove the validity of **wasm** state transition. In the future, we can extend it to general purpose rollup as in smart contract executions. This is totally compatible with **wasm** so every project work on **wasm** can use this library and rollup their transaction.
55+
56+
Our project specializes in working with Substrate and Polkadot, and if we implement cryptographic libraries and optimize these, it would be used for whole network developer.
57+
58+
I think this can be applied for XCMP to prove the validity of state transaction.
59+
60+
61+
## Team :busts_in_silhouette:
62+
63+
### Team members
64+
65+
- Ash Whitehat
66+
- Kirill Karbushev
67+
68+
### Contact
69+
70+
- **Contact Name:** Invers Inc
71+
- **Contact Email:** info@invers.tech
72+
- **Website:** [Invers](https://invers.tech/)
73+
74+
### Legal Structure
75+
76+
- **Registered Address:** 2F・3F Emblem Nishiarai, 3-33-6 Umejima, Adachi City, Tokyo-to 121-0816, Japan
77+
- **Registered Legal Entity:** Invers Inc.
78+
79+
### Team's experience
80+
81+
Our company is working on the blockchain scaling and information hiding technologies. We already delivered several grants and implemented cryptographic primitives which are compatible `parity-scale-codec` as described in [Development Status](https://github.com/zero-network/Grants-Program/blob/**zkwasm**-rollups-transfer/applications/**zkwasm**-rollups-transfer.md#development-status-open_book).
82+
83+
- [zk-rollup](https://github.com/w3f/Grants-Program/blob/master/applications/zk-rollups.md)
84+
- [zk-plonk](https://github.com/w3f/Grants-Program/blob/master/applications/zk-plonk.md)
85+
- [zero-network](https://github.com/w3f/Grants-Program/blob/master/applications/zero-network.md)
86+
87+
### Team Code Repos
88+
89+
- [Zero Network](https://github.com/zero-network)
90+
- [Ash Whitehat](https://github.com/NoCtrlZ)
91+
- [Kirill Karbushev](https://github.com/KiriosK)
92+
93+
### Team LinkedIn Profiles
94+
95+
We are not on LinkedIn.
96+
97+
## Development Status :open_book:
98+
99+
We already implemented cryptographic primitives which are compatible with `parity-scale-codec`.
100+
101+
- [zero-crypto](https://github.com/zero-network/zero/tree/master/primitive/crypto) [![crates.io badge](https://img.shields.io/crates/v/zero-crypto.svg)](https://crates.io/crates/zero-crypto)
102+
- [zero-jubjub](https://github.com/zero-network/zero/tree/master/primitive/jubjub) [![crates.io badge](https://img.shields.io/crates/v/zero-jubjub.svg)](https://crates.io/crates/zero-jubjub)
103+
- [zero-bls12-381](https://github.com/zero-network/zero/tree/master/primitive/bls12_381) [![crates.io badge](https://img.shields.io/crates/v/zero-bls12-381.svg)](https://crates.io/crates/zero-bls12-381)
104+
- [zero-elgamal](https://github.com/zero-network/zero/tree/master/primitive/elgamal) [![crates.io badge](https://img.shields.io/crates/v/zero-elgamal.svg)](https://crates.io/crates/zero-elgamal)
105+
- [zero-pairing](https://github.com/zero-network/zero/tree/master/primitive/pairing) [![crates.io badge](https://img.shields.io/crates/v/zero-pairing.svg)](https://crates.io/crates/zero-pairing)
106+
- [zero-plonk](https://github.com/zero-network/dusk-plonk/tree/acffa2e0af43fdaf40c0f1e4d38b6124c57f5a05) [![crates.io badge](https://img.shields.io/crates/v/zero-plonk.svg)](https://crates.io/crates/zero-plonk)
107+
108+
## Development Roadmap :nut_and_bolt:
109+
110+
Through this grant, we are going to implement the **zkwasm** which supports transfer transactions.
111+
112+
### Overview
113+
114+
- **Total Estimated Duration:** 6 months
115+
- **Full-Time Equivalent (FTE):** 2 FTE
116+
- **Total Costs:** 40,000 USDT
117+
118+
### Milestone 1 | Crypto Primitive
119+
120+
- **Estimated duration:** 1.5 month
121+
- **FTE:** 2
122+
- **Costs:** 10,000 USDT
123+
124+
In `Milestone 1`, we are going to implement `RedDSA`, optimize `Jubjub` curve and client wallet. These can improve usability.
125+
126+
| Number | Deliverable | Specification |
127+
| -----: | ----------- | ------------- |
128+
| 0a. | License | Apache 2.0 |
129+
| 0b. | Documentation | We will provide both `inline documentation` of the code and a `basic tutorial` that explains how users use the wallet and delegate proof generation. |
130+
| 0c. | Testing Guide | Core functions will be fully covered by unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
131+
| 0d. | Docker | We will provide Dockerfiles that can be used to test all the functionality delivered with this milestone. |
132+
| 0e. | Article | We will publish an article/tutorial/workshop that explains |
133+
| 1. | `RedDSA` implementation | We are going to implement `RedDSA`. `RedDSA` implementation allows us to generate one time signing key to encrypt zero knowledge proof witness. One time signing key doesn't have permission to transfer asset. The specification is aligned with zcash [sapling 5.4.6](https://github.com/zcash/zips/blob/main/protocol/sapling.pdf) |
134+
| 2. | `Jubjub` curve optimization | `Jubjub` curve optimization allows us to perform elliptic curve arithmetic quickly. In our scheme, zero-knowledge prover time is latency when users send transaction and verification time is gas cost on chain. Specifically, we implement [Twisted Edwards Curves Revisited](https://iacr.org/archive/asiacrypt2008/53500329/53500329.pdf), [Jacobian Coordinates](https://eprint.iacr.org/2014/1014.pdf) and [wNAF](https://www.scitepress.org/papers/2014/50587/50587.pdf), [pippenger](https://cr.yp.to/papers/pippenger.pdf). |
135+
|3. | Client wallet implementation |We are going to implement client wallet of `RedDSA`. With this wallet, user can generate private key and one time signing key, and delegate their proof generation, in addition to normal wallet functionalities through RPC.|
136+
137+
### Milestone 2 | Plonk Extension
138+
139+
- **Estimated duration:** 1.5 month
140+
- **FTE:** 2
141+
- **Costs:** 10,000 USDT
142+
143+
In `Milestone 2`, we are going to implement `plookup` and recursion on top of [plonk](https://github.com/zero-network/dusk-plonk). These can improve the performance and prove the validity of several circuits separatelly.
144+
145+
| Number | Deliverable | Specification |
146+
| -----: | ----------- | ------------- |
147+
| 0a. | License | Apache 2.0 |
148+
| 0b. | Documentation | We will provide both `inline documentation` of the code and a `basic tutorial` that explains how users implement `plookup` circuit and aggregate proofs. |
149+
| 0c. | Testing Guide | Core functions will be fully covered by unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
150+
| 0d. | Docker | We will provide Dockerfiles that can be used to test all the functionality delivered with this milestone. |
151+
| 0e. | Article | We will publish an article/tutorial/workshop that explains |
152+
| 1. | `plookup` implementation | We are going to implement `plookup` to our [plonk](https://github.com/zero-network/dusk-plonk). `plookup` allows us to use precomputed lookup table in zero knowledge circuit and reduce complexity of circuit.|
153+
| 2. | `recursive proof` implementation | We are going to implement `recursive proof` to our [plonk](https://github.com/zero-network/dusk-plonk). `recursive proof` allows us to generate aggregation circuit and bundle **wasm** ISA proofs to one.|
154+
| 3. | circuit implementation | We are going to implement zero knowledge circuit which supports combination of `plookup` and `recursive proof`. This circuit allows us to implement the circuit for **zkwasm**.|
155+
156+
### Milestone 3 | Zk Wasm Transfer Prover and Verifier
157+
158+
- **Estimated duration:** 1.5 month
159+
- **FTE:** 2
160+
- **Costs:** 10,000 USDT
161+
162+
In `Milestone 3`, we are going to implement `plookup` and `recursive proof` on top of [plonk](https://github.com/zero-network/dusk-plonk). These can improve the performance and prove the validity of several circuits separatelly.
163+
164+
| Number | Deliverable | Specification |
165+
| -----: | ----------- | ------------- |
166+
| 0a. | License | Apache 2.0 |
167+
| 0b. | Documentation | We will provide both `inline documentation` of the code and a `basic tutorial` that explains how users prove the validity of **wasm** ISA execution. |
168+
| 0c. | Testing Guide | Core functions will be fully covered by unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
169+
| 0d. | Docker | We will provide Dockerfiles that can be used to test all the functionality delivered with this milestone. |
170+
| 0e. | Article | We will publish an article/tutorial/workshop that explains |
171+
| 1. | **wasm** circuit implementation | We are going to implement zero knowledge circuit for **wasm** ISA. The transfer transaction consists of **wasm** ISA. We divide it into read and write access to each resource and prove with `plookup` and `recursive proof`.|
172+
| 2. | proof generator implementation | We are going to implement proof generator which generates the proof for **wasm** ISA. The input is execution trace of **wasm** ISA and output is zero knowledge proof. This is implemented on off-chain.|
173+
| 3. | proof verification implementation | We are going to implement proof verification function which verifies the proof. This is implemented on on-chain.|
174+
175+
### Milestone 4 | Zk Wasm Transfer Rollup Node
176+
177+
- **Estimated duration:** 1.5 month
178+
- **FTE:** 2
179+
- **Costs:** 10,000 USDT
180+
181+
In `Milestone 4`, we are going to implement rollup node. This can aggregate transfer transactions and generate proof.
182+
183+
| Number | Deliverable | Specification |
184+
| -----: | ----------- | ------------- |
185+
| 0a. | License | Apache 2.0 |
186+
| 0b. | Documentation | We will provide both `inline documentation` of the code and a `basic tutorial` that explains how users setup the node and send transfer transactions. |
187+
| 0c. | Testing Guide | Core functions will be fully covered by unit tests to ensure functionality and robustness. In the guide, we will describe how to run these tests. |
188+
| 0d. | Docker | We will provide Dockerfiles that can be used to test all the functionality delivered with this milestone. |
189+
| 0e. | Article | We will publish an article/tutorial/workshop that explains |
190+
| 1. | rollup node implementation | We are going to implement rollup node. This allows to setup the execution environment of L2 transfer transactions, generate the proof and commit the state to mainchain.|
191+
| 2. | client transactor implementation | We are going to implement client library to request transfer transactions to rollup node. This is the combination of Redsa wallet and proof generator. |
192+
| 3. | integrate network | We are going to integrate network. There are four actor mainchain, rollup node and transactor, prover. The transactor generates the transaction and delegate proof generation to prover. The prover generates proof and send it back to transactor. The transactor send transaction to rollup node. The rollup node aggregates these transaction and commit the state to mainchain. |
193+
194+
## Future Plans
195+
196+
- Fully zkwasm rollup
197+
- Proof for XCMP
198+
- FHE
199+
- Verifiable hardware
200+
201+
## Additional Information :heavy_plus_sign:
202+
203+
- How did you hear about the Grants Program?
204+
- Announcement by another team
205+
- Work you have already done.
206+
- [zero-crypto](https://crates.io/crates/zero-crypto)
207+
- [zero-jubjub](https://crates.io/crates/zero-jubjub)
208+
- [zero-bls12-381](https://crates.io/crates/zero-bls12-381)
209+
- [zero-elgamal](https://crates.io/crates/zero-elgamal)
210+
- [zero-pairing](https://crates.io/crates/zero-pairing)
211+
- [zero-plonk](https://crates.io/crates/zero-plonk)
212+
- [pallet-plonk](https://github.com/zero-network/zero/tree/master/pallets/plonk)
213+
- [pallet-encrypted-balance](https://github.com/zero-network/zero/tree/master/pallets/encrypted_balance)
214+
- [pallet-confidential-transfer](https://github.com/zero-network/zero/tree/master/pallets/confidential_transfer)
215+
- [above documentation](https://zero-network.github.io/zero/)
216+
- Wheter there are any other teams who have already contributed (financially) to the project.
217+
- No.
218+
- Previous grants you may have applied for.
219+
- [zk-rollup](https://github.com/w3f/Grants-Program/blob/master/applications/zk-rollups.md)
220+
- [zk-plonk](https://github.com/w3f/Grants-Program/blob/master/applications/zk-plonk.md)
221+
- [zero-network](https://github.com/w3f/Grants-Program/blob/master/applications/zero-network.md)

0 commit comments

Comments
 (0)