header-langage
简体中文
English
Tiếng Việt
Scan to Download the APP
Partnered With:

ZigZag InvisibL3: Privacy Preserving DEX

Read this article in 8 Minutes
ZK Rollup customized specifically for applications, while retaining fast transactions while maintaining anonymity on the chain
Original title: "ZigZag InvisibL3—Privacy-Protecting DEX"
Original source: ZigZag Exchange


  Harry Potter wearing an invisibility cloak  


< p>This article technically introduces our new application, an Order Book Token Exchange Platform. It uses an application-specific ZK Rollup called InvisibL3, which combines privacy protection while retaining fast transactions, allowing users to take advantage of the full scalability of ZK Rollups while maintaining on-chain Anonymity.   


The importance of privacy


Although the blockchain addresses may appear anonymous to the uninitiated, but they allow anyone to see all of your transactions. Once a pseudonym for an address is tied to an individual, there's basically nowhere to hide it. While existing solutions, such as Tornado Cash, are great options, they lack a lot of utility.


InvisibL3 will offer some completely unique features. Our trading platform will allow users to trade assets anonymously while keeping the amounts they trade confidentially hidden. Our view is that privacy should not be an option, but an industry standard. A world where anyone can browse bank statements anonymously is not an actual vision for cryptocurrency development. Our exchange is not only designed to compete with existing privacy solutions such as Aztec Protocol or Tornado Cash, but also with traditional centralized and decentralized exchanges. Some of the benefits of a privacy-anonymous trading platform are:


Allows institutional traders to enter DeFi as privacy is one of their main concerns (legal or otherwise) )


· Help reduce the "vicious" MEVs we are all too familiar with in AMM mode, such as sandwich attacks


· Allows professional traders to keep their strategies private


Privacy DEX without compromising security or scalability 


The question is how to achieve privacy in permissionless transactions while maintaining security and scalability. Probably the simplest answer that comes to mind is to leverage the power of ZK proofs to prove that state transitions were performed correctly without revealing any inputs (amounts or addresses). At the end of the day, this isn’t a huge improvement over traditional centralized exchanges. Not only do you hand over your funds to a centralized trading platform, but you also have to trust another centralized organization to ensure the availability and privacy of your data.


The second option is to design a system where all hidden transactions are public: no amount can be seen or sent unless the correct private key is provided By. This allows anyone to reconstruct the state and use their private key to create proof that they actually own their funds.


How are funds hidden?


Hiding your funds requires you to commit to the amount traded, and like all other commitment schemes, this needs to be binding b> (cannot be displayed later as a different value) and obscurity (do not reveal any information about hidden data).


A common choice might be a hash function, but InvisibL3 will use something called a  Pedersen Commitment which has an additional Additional property of homomorphism:


C(a + b) = C(a) + C(b) 


We will explain why this is important later.


To construct these commitments, we multiply an elliptic curve point by the amount we want to hide. Don't worry, if you're not familiar with elliptic curves, all you need to know is that it's hard to deduce x from x*G, where G is the known generating point.


However, since the amount a is always within the given range, we need to structure the promise as follows:


C(a) = xG + aH 


where x is a random blinding factor known only to the owner to prevent someone from brute-forcing all Common amount values and find the value you sent.


How is your identity hidden?


In order to hide your identity, a feature called subaddresses (popularized by Monero) will be built. Each user starts with a set of two private keys — a private view and a spending key — and as the name implies, one will be used to find or disclose notes the user owns, and the other to spend them. Users can arbitrarily generate many sub-addresses from the private key that cannot be linked back to the original address, and use these sub-addresses to interact with market makers or other users.


However, to prevent multiple notes from being sent to the same address or to generate a new address for each exchange (this may reveal how much exchanges, and can be used to identify larger market makers or institutional traders), we have also added a one-time address feature.


Instead of sending a string of information to the actual address, the sender generates a random one-time address with a secret random seed, which is shared between the user and the market maker shared privately. The user can then prove with their private key that they own this string of information at the one-time address without revealing their address or even their subaddress.


More technical details on how we will use subaddresses and one-time addresses can be found in Appendix A .


What if I lose my private key?


Generating new information with a new address for each exchange is an unnecessary hassle, so in practice the wallet provider and exchange (us) will be in an encrypted format Store your data so you can easily retrieve your information using your private key.


However, this does not mean that you are relying on third parties to provide this data. All transactions and corresponding information needed to recreate the state and look up the information sent to you are stored on-chain as calldata and can be retrieved using your private key.


See Appendix B for details on refactoring promises.


How does redemption happen?


The most important part now is that the exchange is done in a way that both the market maker and the user agree to. Let's look at an example of token exchange. Suppose user A wants to exchange X amount of ETH for USDC. Users must first prove that they have sufficient information to carry out this exchange. That's where the Pedersen promise comes in.


Assume that C1, …, Cn are the inputs that the user wants to spend and Co1, …, Com are the outputs that the user is generating. Due to the homomorphic nature of these commitments, we can easily check that the sum of the input information is equal to the sum of the output information without revealing the quantities. In practice, there is an extra step of producing intermediate commitments to sum to zero, but this is not necessary to understand the general architecture. See Appendix C for details on verifying committed amounts.


When making an exchange, you provide a hash of the inputs: the amount you want to trade, the input and output asset types and asset prices, and a return address signature stuff. The return address signature is what ties the maker and taker transactions together. This allows you to prove that you know the private key to the one-time address generated by the transaction private key (the random seed you and the market maker share), and prevents the market maker from sending your funds to an arbitrary address they control or that you accidentally provide Bad address (if you put in the correct 64 character hex string, you don't need to quadruple check).


Summary and Conclusion


In summary, each exchange consists of two transactions (market maker and transaction parties), where the exchange is only considered valid if:


1. The information entered is present in the state;


2. The sum of the input and output information of the two transactions is zero;


3. The information used and spent by both parties The corresponding private key signed the expected transaction hash;


4. The exchanged Token and amount match the signature of the counterparty;


5. The destination address matches the return address signature.


The first one to three output messages will usually be sent to the market maker who accepts your order, another message will be sent to the trading platform as a fee, and the rest will be returned to you as a refund.


If you are curious about the existing technology that drives our research and this blog post, we encourage you to check out the original Monero White Paper and original ZCash White Paper.


Appendix A) Subaddresses and One-Time Addresses


Every user from Start with a set of two private keys: a private view key (kv) and a private spend key (ks), from which the master public key is generated:


Kv = kv*G and Ks = ks*G


then user generated His subaddress private key, as follows:


ksi = ks + H(kv, i) ; kvi = kv*(ks + H(kv, i))
< p id="f433" box-sizing:="" inherit;="" margin:="" 2em="" 0px="" -0.46em;="" font-weight:="" 400;="" color:="" rgb(41,="" 41,="" 41);="" word-break:="" break-word;="" font-family:="" charter,="" georgia ,="" cambria,="" "times="" new="" roman",="" times,="" serif;="" line-height:="" 32px;="" letter-spacing :="" -0.003em;="" font-style:="" italic;="" font-size:="" 21px;"="">

and the corresponding public keys Ksi and Kvi are as above.

< br>

For the computation of one-time addresses, the sender and receiver share a private transaction key r (random seed computed using FSH on the private input).

< br>

The sender knows one of the receiver's addresses ((Ksi, Kvi) pair) and can compute a one-time address:


Ko = H(r*Kv)G + Ksi


Then, the user can calculate the private key of this address :


ko = H(r*Kv) + ksi


and use said private key to prove that they do have that information


Appendix B) Restoration Promise


In addition to your private key, when spending a note, you need to know the amount of commitment and the blinding factor to be able to reconstruct the note. Below is a scheme describing how these are calculated, so you can always retrieve notes issued to you.


The sender uses the transaction private key r and the sender Kv to construct:


Blinding factor;


x = H(「commitment_mask」, H(rKv))


Hidden amount;


Ah = a XOR8 H(「amount_mask」, H( rKv))


· rG,rKv,


With every transaction on chain rG, rKv and Ah are provided to the receiver to be able to recreate the commitment.

< br>

Receiver Receive rG, rKv and Ah:


· The user first checks that rG * kv == rKv using the private view key; if so, the annotation is sent to the user;


The user can then calculate the blinding factor;


x = H(「commitment_mask」, H(rKv))


· and amount.


a = Ah XOR8 H(“amount_mask”, H(rKv))


Therefore, please note:


C(a) = xG + aH


Appendix C) Verify Commitment Amount


The sum of input commitments is:


C1 + …+ Cn = x1G + a1H + … xnG + anH = (x1+…+xn)*G + (a1+…+an)*H


Sum of sum output:


Co1 + … + Con = y1G + b1H + … ymG + bmH = (y1+…+ym)*G + (a1+…+bm)*H


where


(a1+…+an) == ( b1+…bm)


But


(x1+…+xn) /= (y1+…+ym)


So


(C1 + …+ Cn) /= ( Co1 + …+ Com)


To make the sums equal, we need to generate intermediate commitments for each input note so that the new blinded sum matches the output blinded:


C』i = x』i*G + a*H and (x』1+…x』n) == (y1+…+ym)


and


(C』1 + …+ C』n) == (Co1 + …+ Com)


< p id="9b64" box-sizing:="" inherit;="" margin:="" 2em="" 0px="" -0.46em;="" font-weight:="" 400;="" color:="" rgb(41,="" 41,="" 41);="" word-break:="" break-word;="" font-family:="" charter,="" georgia ,="" cambria,="" "times="" new="" roman",="" times,="" serif;="" font-style:="" normal;="" line-height :="" 32px;="" letter-spacing:="" -0.003em;="" font-size:="" 20px;="" font-variant-ligatures:="" font-variant-caps: ="" orphans:="" 2;="" text-align:="" start;="" text-indent:="" 0px;="" text-transform:="" none;="" white -space:="" widows:="" word-spacing:="" -webkit-text-stroke-width:="" background-color:="" rgb(255,="" 255,="" 255 );="" text-decoration-thickness:="" initial;="" text-decoration-style:="" text-decoration-color:="" initial;"=""> difference zi = (xi— x′i) is called the intermediate commitment private key, which is then included in the signature to prove that the amounts in Ci and C′i are the same.


This article is from a contribution and does not represent the views of BlockBeats  


Original link


Welcome to join the official BlockBeats community:

Telegram Subscription Group: https://t.me/theblockbeats

Telegram Discussion Group: https://t.me/BlockBeats_App

Official Twitter Account: https://twitter.com/BlockBeatsAsia

举报 Correction/Report
Choose Library
Add Library
Cancel
Finish
Add Library
Visible to myself only
Public
Save
Correction/Report
Submit