Loopring Internship Weekly Report 6/8/18

Starting at Loopring

This is quite an exciting week for me as I have recently arrived in China and it was my first week at Loopring. The environment of the office is quite relaxed and casual and it was quite easy to get used to the work life at Loopring. I started off being tasked with gaining an understanding of Loopring inside and out, starting with the whitepaper. I thought the whitepaper was pretty self-explanatory and I was finding that with a little bit of extra research on the outside, using YouTube and various articles, I was able to get a real grasp on what they are doing here. I have read other whitepapers before, and I see that Loopring has one of the more substantially thought-out and technically supported whitepapers. I was finding the more I read about Loopring, the more I was signing onto what they are doing here, and the more I was wanting to help them out. Along with reading and understanding Loopring, I also read about the Mt. Gox scandal, and limit, stop, and market price orders. This helped me get a feel for why Loopring was formed, and the special features of Loopring’s protocol. I also defined what a relay, relay-mesh, and off-chain is in relation to Loopring, which I won’t include here but it helped me understand them a lot more. The last thing I did was translate the glossary of the Relay API document from Chinese to English, which helped me understand the Relay a lot more from a technical perspective. In this update, I will do my best to give my view on what Loopring is and how it works.

What is Loopring to me?

Loopring to me is the future protocol that cryptocurrency exchanges will run on. In its purest form, Loopring can be described as a company that is looking to share their code and software with the world to help it have decentralized cryptocurrency exchanges as the main way of trading, instead of a centralized exchange. Loopring, and the crypto community itself, have identified many different problems with how centralized exchanges currently operate, and Loopring is here to solve these problems in the best way possible. This is by sharing their revolutionary protocol that will be able to transform current exchanges, and help build new decentralized exchanges. Their protocol uses a new way of exchanging tokens called ring-matching, which I will go in-depth on later. Lastly, they are able to integrate with any platform that is using smart contracts, and have already been working on integrating with Ethereum, NEO, and Qtum.

What Loopring will solve, and how they differ from everyone else

First of all, Loopring will offer increased security over centralized exchanges. This is by making it so the exchanges aren’t holding any of the users’ actual funds, and just transferring the funds from the users’ personal wallet. A user typically also hands over their personal keys to the centralized exchange in order to make these orders, leaving the ability for hacking. Loopring will solve transparency problems with the current exchanges because no longer will a user have to trust that the exchange will be able to get them their money quickly. With no reserves of funds in the exchange, the coins and money is coming and going straight from their own wallet. Loopring will solve the lack of liquidity that is currently plaguing centralized exchanges, through the eyes of the user and exchange. The current problems are that the exchange with the higher number of trading pairs, or pairs of coins that are able to be transferred to each other, usually wins because users want all their trading to be done in one place. Also, the exchange with the largest trade volume or order book usually wins because the prices or bid-ask spreads are more desirable, turning off newcomers that need to build up the liquidity. Their is also room for improvement in user experience in that they are limited in the trading pairs, size of order books, and fair bid-ask wins. They typically can’t trade one coin directly for another due to lack of pairs. Loopring will attempt to solve these liquidity problems with their ring-matching software that lets multiple coins be traded through multiple users at once, leaving out the need to change coins multiple times. Also, the bid-ask prices are always at or above what the user wanted and everyone benefits from it in the end. Loopring will encourage more cooperation in bringing liberation to trading that will make it more fair and favorable for the user with being able to get exactly what they want from any exchange, no matter the size. The exchanges will then benefit because they are safe from attack and need not to spend so much money on trying to monitor these funds and transfers themselves. They will also benefit because they will get a higher user growth and higher user satisfaction.

How it works

How I understand it, Loopring is able to allow traders to transfer funds directly from their original wallet and not have to deposit money into any exchanges.This makes it so the exchange doesn’t have to hold and manage users funds so they aren’t at risk of losing users’ money. The funds are also not locked when the money is being transferred so the user can initiate the transfer and move on, and even make another transfer immediately after the first order. Loopring also focuses to connect buyers and sellers directly with a large order book. They use limit orders a

Ordering

When ordering, you must use the loopr.io wallet, the one linked to ethereum’s blockchain. Basically you sign off on the order with your private key and the order is sent off-chain to relay nodes that post in the order book and send to the ring-miners, while also sending it to the smart contracts on Loopring’s network to get permission to send funds. They only use limit orders and this prevents slippage when buying and selling coins.

Ring-Matching

How the transfer of funds works is say person 1 wants to trade amountS1 of coin D for amountB1 of coin C, person 2 wants to trade amountS2 of coin C for amountB2 of coin A, and person 3 wants to trade amountS3 of coin A for amountB3 of coin D. This is what’s known as a ring, where all parties are put together and their coins are exchanged between each other. This could be as little as 2 people, and up to about 10 parties at one time. This makes the trading of coins so much faster. Here, there are three coins that will be transferred between them and the rates they will be transferred are set by the rate at which they list the two coins, or AmountS/AmountB, however the rate is determined based on which coin is fixed as the asset for price quotations. For each person there may be a different exchange rate, but in a ring, the exchange rate a person is looking for will never end up being worse than what they asked for, but it may be better. This order will fill completely when the exchange rates are acceptable for all parties, being the protocol has already matched these three people together because the exchange rates were equal or better. Something I noticed however was that there is no ability to transfer USD or fiat to crypto coins at the moment, something that could hopefully come in the future. Anyway, if not all orders are filled in one ring of coins, another ring is formed, all the way until the original order is filled. It is important to note that if there is not sufficient funds in someone that creates an order’s account, the order is filled as much as possible and then paused to wait on more funds, instead of simply cancelling an order. A party is allowed to cancel their own order at any time, however.

Ring-Miners

Ring-miners are responsible for making sure the orders get completely or partially filled. The ring-miners are able to choose how they are compensated for the order they complete. This is either through a split margin on the final purchasing amount, or a fee in LRC. A miner can choose because occasionally one may be larger than the other and because it will incentivize a miner to choose the best exchange rate in order to get the better split margin of the profit.

Fee Model

How the fee model is setup is when the user creates an order, he is able to specify the max amount of LRC that will be paid to the miner, as well as a percentage of the margin the miner is able to make on the order. The ring-miner can then choose which one he will accept at the end and that will be the only fee that is paid by the user.

Filling an order

Once an order ring is completed, Loopring’s smart contract will verify that the order will be fulfilled and then sends the coins automatically from one wallet to the other.

Understanding the ecosystem

I want to show here that I understand each step and piece of Loopring’s protocol ecosystem and how it operates. The first being the wallet. This wallet is it’s very own loopring wallet, but it doesn’t seem as though you need coins in the wallet to be able to transact on the loopring network because you should be able to send coins from one coin wallet to another. I may be a little confused on this but I know that when you are transacting on the network your funds are not frozen and you are able to continue making more transactions. The Relay-mesh network is made to process blocks in 1-2 seconds and trims old history to make room for new data. When a node runs Loopring’s software, they can join an existing network and share liquidity, making it faster, however, a node is not required to join one and can run alone. Relays are nodes that receive orders and broadcast them to miners and off-chain relays and order books. They maintain the transaction history and broadcast the public order books. Relays with the ring-mining feature turned on are called “ring-miners,” as they are not required to run on it. The LPSC is what checks the orders fulfilled from ring-miners are accurate and what submits the transaction to the order books. It settles transactions trustlessly and automatically through sending coins from one wallet to another. ATS is what allows traders access to funds not directly transferable on Loopring’s network. This includes fiat currency and blockchains that aren’t paired with Loopring’s.

Dual-Authoring

Loopring has recently come up with, applied, and filed for patents for this new idea called dual-authoring. Dual-authoring is what Daniel came up with to solve the problem of front-running on Loopring’s protocol. Front-running is an illegal action that involves taking advantage of advance knowledge of people taking orders. Loopring’s main forms of front-running include ring-filch and order-filch. Order-filch is when a front-runner steals a pending ring settlement transaction, and ring-filch is when an entire pending ring is stolen from the transaction. How the front-running seems to work is when the order is in submitorderring pending, a front-runner can simply replace the mineraddress with his own filcheraddress, then re-sign to replace the signature. He can then set a higher gas price and submit a new transaction and get another miner to pick it up in the next block rather than the original submitring transaction. The solution is to allow ring miners to reserve ring hashes before submitting the actual rings. The protocol then checks to see if the hash has already been submitted or reserved by another miner and if so, the transaction fails. How dual authority works is there is a pair of keys randomly generated, authaddress and authprivatekey, and put the pair into the order itself. Next, all fields are signed but authprivatekey, the wallet will send the order and the miner checks that the pairs of keys match and the order’s signature is valid. When a ring is found, the miner uses each order’s private key to sign the ringhash, miningaddress, and all mining procedures. Authprivate keys are not part of the on-chain transaction and therefore remain unknown to everyone except for the relay. Lastly, the Loopring Protocol will verify the suthsigniture matches up with the authaddress for each order and then reject if any authsignature is invalid.

LEAF

LEAF is basically a fund that rewards contributors for helping Loopring and the community. It supports all different types of contributions except for ones that are paid. It’s primary purposes are to invest in DEX related projects and companies to be involved in the space and work on getting partnerships, and to incentivize community contributors of all types, if they submit monthly reports to the company. It supports things like; design work, translation of documents, creation of Loopring artwork, running of Loopring’s telegrams, and the rewriting of the whitepaper. It has 4 funds and 3 sub-funds that include LRC, NEO, Ethereum, and Qtum to reward contributors with. This is a very cool project that can foster a lot of growth with Loopring, however I feel as though it is not marketed enough and isn’t very established yet since it is so new. Some of the projects needed with this are things I really believe I can do for this company.

Conclusion

Through this week, I have learned so many important aspects of Loopring and believe I now have a great understanding to be able to try and convince developers to help with our project. I am very excited to see what I will be reporting on next week and I can’t wait for more responsibility in this company. I think Loopring is doing a great thing here and I believe their protocol will definitely succeed down the road.

Resources used

https://cryptocurrencyfacts.com/market-limit-stop-orders-cryptocurrency/
file:///C:/Users/ashto/Documents/temp/en_whitepaper.pdf
https://coincentral.com/loopring-beginners-guide/
http://docs.loopring.org/English/overview/
http://fortune.com/2017/09/29/cryptocurrency-exchanges-hackings-chaos/
https://www.wired.com/2014/03/bitcoin-exchange/

Sort:  

Go here https://steemit.com/@a-a-a to get your post resteemed to over 72,000 followers.

Coins mentioned in post:

CoinPrice (USD)📉 24h📉 7d
ETHEthereum597.711$-1.58%4.01%
LRCLoopring0.499$-4.89%-1.22%
NEONEO52.535$-2.32%-3.05%
QTUMQtum13.202$-3.79%-4.44%

Coin Marketplace

STEEM 0.04
TRX 0.32
JST 0.077
BTC 63918.14
ETH 1660.03
USDT 1.00
SBD 0.42