Neon Exchange-NEX Decentralized Exchange

Posted: November 22, 2017 by Tyler Swope

Neon Exchange-NEXh1>

Introduction

There was no big NEO announcement a few days ago, the news was Microsoft was a co-sponsor of the NEO Dev competition…this news was leaked on Friday. Well unfortunately that big news got overshadowed by the shit show put on by Malcolm and FredAfrica. Again we are waiting for a response from core members….looking at you over there DA
Well there was other big things that happened on the NEO front over the weekend that also got overshadowed. THE NEX whitepaper was released, and boy does this show the professionalism of the City of Zion and the open-soure NEO community. I am stunned…lets dive into this right now!

Neon Exchange–NEXh2>

In the beginning of the whitepaper, the city of zion dives into the two smart contract platform that NEX will be operating with…NEO and Eth. So eth is based on an account mode, where user’s balance of Eth is stored as a number in the Ethereum Virtual Machine and can be easily sent of received by smart contract logic.
However NEO and GAS are based on a UTXO model, where funds are sent a recived through a chain of spent transactions ids on the networks. The whitepaper dives into the positives and negatives of each platform. In Eth, it is easy for a smart contract to interact with a user’s balance, but difficult for a node to prove that the transaction has taken place without syning the full chain and running the EVM. In NEO it is asy for third parties to verify that a transaction has taken place on chain, but more difficult for smart contracts to interact with a users NEO or Gas balance.

How To Succeed?

The whitepaper exclaims for the Neon Exchange to succeed, smart contracts on NEO need to programattically interact with NEO and Gas and other global assets. Their answer to this problem is a payment service layer that converts global assets such as neo an gas into smart contract tokens, which can easily interact with smart contracts on the NEO network.
The other major differences are the way calls are made between smart contracts. In Eth a smart contracts can dynamically call any other smart contract. Neo, however enforces that all calls between smart contracts be declared statically in advance. Another difference, as most of you know is the consensus of the two protocols. NEO dbft allows for much higher transactional input( up to 1000 currentely) while Eth uses proof of work which limits them to 25 tps.

Guts of the NEX

Now lets get into the guts of the NEON Exchange-The System will consist of 3 main components: an off-chain trade matching engine, a smart contract where trades are executed, and a payment service where global assets can be converted to tokens that can be transferred directly by smart contracts.

The off-chain matching engine

The off-chain matching engine allows NEX to benefit from the performance advantages of centralized exchanges, while still maintain an decentralized user account model. Orders are singed and sent from user addresses to the matching engine, where they areing quickly processed using high-performance hardware.
Lets take a look at this picture to illustrate how it will work.

First one user authorizes a trade to exchange token A for Token B and sends the order to the matching engine. Next the second user authorizes and submits a trade for token b in the exchange for token A. The engine matches the orders, and then submits a smart contracts for execution. Because a single invocation transaction on NEO can contain many smart contract calls, the engine can batch a set of matched orders in one-on chain transaction. Assuming 1000 transaction per second, NEX could potential execute more than 100,000 trades per second on the chain. This is something big from the whitepaper…IN the future , such batches could adopt match-rings to further enhance liquidity…..LOOOPRIIIINNNGNG. Unlike existing decentralized exchanges, which only support point-2-pint orders. NEX will support many more complex trades such as limit, market, and margin orders.

Smart Contracts for Token Exchange

The next component of the Neon Exchange, is the smart contracts for token exchanges. The Neon Exchange matching engine communicates with a smart contract that commits trades between users. The Smart contract contains logic powered by the NEP-5 token standard. THE NEX exchange SC accepts two parameters: a string indicating the operation performed and a byte array containing serialized data about the usage in the method. The output of the call will be retured as a byte array, with the first byte indicating a success or failure of the call.
The security of the SC is sound to ensure that no-thrid party can execute a fradulate trade, the trade method of the exchange SC will only accept orders signed by a private key held by the matching engine.

NEX Payment Service

Now the final component of the Neon Exchange—Payment Service. The NEX payment service allows NEO smart contracts to interact with assets that live outside the NEO Virtual machine. Example, a user might use the payment service to make transactions across chains, sending eth to a NEO smart contracts that then distributes it among their friends NEO addresses.

NEX’s payment service layer allows NEO smart contracts to interact with UTXO based global assets such as NEO and GAS. In this pic, a user deposits NEO in the Neon Exchange payment service smart contract, creating a balance of XNEO that can be transferred between smart contracts (1). The user authorizes a third-party smart contract to access their XNEO (2a). The user then calls that contract (2b), which sends some of the XNEO to another user and authorizes a second smart contract to use the rest (2c). The first smart contract then calls the second smart contract (2d). Finally, the users and second smart withdraw NEO from the payment service, zeroing their XNEO balances (3).

Conclusion

The final piece, and a very important one, the long-term vision of the decentralized exchange would lead to decentralized banking. The Neon Exchange enables a long term vision of decentralized banking through a smart contract based funds management service. (1) Users buy assets from conventional services, (2) then interact with them on the NEO blockchain through the NEX smart contract. (3) These assets can also be traded on NEX through NEP-5 pairs, to enable cross-chain exchange. (4) Funds stored in the management contract have access to other services such as indexed investment accounts or peer-to-peer lending.

Now Let’s look at the Utility of the Neon Exchange token. The token allows holder to claim a share of fees, generated by the payment services and exchange. By staking their NEX in a smart contract via the stake method, which records the starting block and amount sent, the user can make periodic claims on the contract to retrieve their share of the NEX profits. There will be a total 50 million token issued, and the token sale will be held in quarter one of 2018. 25 million of the 50 million will be sold to the public.

No Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

X