Miniswap V2.0

Miniswap Lab
4 min readSep 16, 2020

The MiniSwap Research Lab

Lab@MiniSwap.org

1 MiniSwap 2.0: Scaling MiniSwap at Layer 2

MiniSwap 2.0 is an entirely new generation of interoperable decentralised exchange service, with breakthroughs on the scalability and trans-fee-efficiency. MiniSwap 2.0 achieves the interoperability by extending the MiniSwap Global protocol.

To provide better scalability guarantee and reduce the transaction fees on Ethereum, MiniSwap 2.0 relies on a new layer 2 protocol, called concurrent and non-interactive succinct verification of aggregated states (CNiSVAS). CNiSVAS is layer 2 protocol leveraging non-interactive proof of carrying data (PCD) [1– 4] with high concurrency. CNiSVAS also aims at reducing or even eliminating the high gas consumption of swapping operations, and achieves it by moving all expensive operations to the layer 2.

The layer 2 chain is a fully functional chain that is almost identical to Ethereum. The MiniSwap service is available as a contract on the layer 2 chain. In particular, MiniSwap 2.0 deploys a layer 2 chain to support all operations of MiniSwap, such as swaping between assets, providing liquidity, and hybrid mining (i.e. trans-fee-mining and liquidity mining).

1.1 Layer 2 management

The layer 2 protocol is maintained by a committee, where the members are selected based on a delegated proof-of-stake (DPoS) protocol. Loosely speaking, nodes are nominated to maintain the layer 2 protocol by using the DPoS protocol. Each selected committee member locks a large amount of Mini token on the Ethereum main chain, which will be used to punish the potential misbehaviors, if any.

The committee uses a t-n threshold signature scheme. That is, the committee has a common public key PK, such that if at least t out of n members of the committee have signed a message, then the message can be verified by using the common public key. The committee monitors both the Ethereum chain and the layer 2 chain. They also share the transaction fees from all layer 2 users.

1.2 Joining Layer 2

Let Alice be a MiniSwap user who wants to join the MiniSwap 2.0 layer 2 protocol with x amount of token X. Alice transfers these tokens to the committee’s common public key together with a small amount of joining fee. OnceMiniSwap v1.1.a this is confirmed on the Ethereum blockchain, the committee sends x amount of M ini i X to Alice’s address on the layer 2 chain, where M ini i X is the stable coin of token X on layer 2. Now Alice is on the layer 2 protocol with her key that is identical to the main chain.

1.3 Operations on Layer 2

As MiniSwap on layer 2 is fully functional and can be considered identical to the main chain, Alice can excute operations on layer 2 in the same way. However, there is no need to pay any gas fee, as the committee will not charge for it on the layer 2. Thus, MiniSwap 2.0 eliminates the expensive fee imposed by the gas consumption on Ethereum. Note that the 0.03% transaction fee for swaping is still required, as in MiniSwap for trans-fee-mining.

The price oracle on layer 2 follows the same mechamism as MiniSwap.

For mining on layer 2, the new coins are generated in the same rule as Miniswap. On the Ethereum main chain, the MiniSwap 2.0 contract automatically generates the maximum allowed amount of MINI per day. So that there are enough MINI being mined to cover the “virtual” mining on layer 2.

1.4 Quit Layer 2

Users can quit from layer 2 and claim all their assets on the main chain. To do so, the user, say Alice, needs to send the layer 2 assets to a special burn address with a small amount of claiming fee to the committee. Once this is done, the committee will transfer the according amount of assets to Alice on the main chain.

1.5 Accountability

If a member of the committee misbehaves, then the member’s asset will be distribuetd to other honest members through a special punishment transaction.

References

1. Chiesa, A., Tromer, E.: Proof-carrying data and hearsay arguments from signature cards. In: Yao, A.C. (ed.) Innovations in Computer Science — ICS 2010, Tsinghua University, Beijing, China, January 5–7, 2010. Proceedings. pp. 310–331. Tsinghua University Press (2010)

2. Bitansky, N., Canetti, R., Chiesa, A., Tromer, E.: Recursive composition and bootstrapping for SNARKS and proof-carrying data. In: Boneh, D., Roughgarden, T.,Feigenbaum, J. (eds.) Symposium on Theory of Computing Conference, STOC’13,Palo Alto, CA, USA, June 1–4, 2013. pp. 111–120. ACM (2013)

3. Ben-Sasson, E., Chiesa, A., Tromer, E., Virza, M.: Scalable zero knowledge via cycles of elliptic curves. In: Garay, J.A., Gennaro, R. (eds.) Advances in Cryptology — CRYPTO 2014–34th Annual Cryptology Conference, Santa Barbara, CA, USA, August 17–21, 2014, Proceedings, Part II. Lecture Notes in Computer Science, vol. 8617, pp. 276–294. Springer (2014)

4. Chiesa, A., Ojha, D., Spooner, N.: Fractal: Post-quantum and transparent recursive proofs from holography. In: Canteaut, A., Ishai, Y. (eds.) Advances in Cryptology — EUROCRYPT 2020–39th Annual International Conference on the Theory and Applications of Cryptographic Techniques, Zagreb, Croatia, May 10–14, 2020, Proceedings, Part I. Lecture Notes in Computer Science, vol. 12105, pp. 769–793. Springer (2020)

--

--