Connecting Nash to the blockchain: State channel smart contracts - Nash.io

Connecting Nash to the blockchain: State channel smart contracts

Connecting Nash to the blockchain

The heart of Nash is our matching engine, which we described in this article as a multi-chain state channel manager. The matching engine provides speed by processing trades off the blockchain, but it will never update a user’s balances unless they have signed orders.

Of course, the matching engine must also interact with the blockchains supported by Nash. This is where our Blockchain Integrations team comes in: smart contracts store user funds for trading and can interact with both the matching engine and users’ personal wallets.

Manual withdrawal from our contracts is possible at all times, even if the Nash platform and matching engine are unavailable. Users have the option of interacting directly with our smart contracts to withdraw funds. Nash can potentially block trades on the matching engine, but since we do not have users’ private keys, we cannot issue trades or interact with smart contracts on their behalf. Furthermore, the matching engine cannot be exploited to steal user funds from our smart contracts. Even if the matching engine were somehow compromised, user balances would remain untouched.

The matching engine itself is a complex, modular system, but our smart contracts are designed to be simple and portable. This means we can easily adapt them to chains with differing VM runtimes, such as EOS and Cardano. By taking this approach, we ensure that Nash will be able to add new chains as fast as possible. What’s more, when the matching engine becomes fully decentralized, no changes to our smart contract design will be necessary.

At launch, Nash will support both the Ethereum and NEO blockchains. Our smart contracts for these platforms have now been finalized and approved for deployment! This video shows both contracts passing a variety of tests:

The tests for ETH and NEO start out by deploying our exchange smart contracts onto a development chain and creating a few sample NEP-5 and ERC-20 tokens for trading. In the video, you can see the following and more:

  • After whitelisting a set of assets and users, a number of tests are run to verify that deposits of any type of token are processed in the proper manner.
  • Important tests then verify that syncing balances between the matching engine and the exchange smart contracts works as expected. These also prove that both a user and the matching engine must sign requests, ensuring we remain fully non-custodial.
  • For all operations on the contracts, we simulate possible malicious behavior to make sure that they act properly when extra bytes, extremely large numbers or other unexpected parameters are passed in.
  • A final set of tests verifies the withdrawal of assets from the exchange contract to the user and checks that all balances for the user and the contract are as expected.

While the tests in the video play an important role in ensuring that our contracts operate as they should in a simulated blockchain environment, they are only one small part of our testing infrastructure aimed at guaranteeing the safety of users’ funds.

We are already working on second-layer strategies to incorporate chains not capable of smart contracts, in particular Bitcoin. These solutions should be in place shortly after the launch of our MVP. As with smart contract–capable chains, systems developed for Bitcoin will be adaptable for related technologies, such as Litecoin.

Centralized exchanges do not have to build sophisticated integration systems of this kind. They are not concerned with issues of custody and are happy controlling users’ assets. By developing fully non-custodial, decentralized solutions, Nash aims to bring decentralized finance to everyone with no compromises on security.


Nash will be unveiling our new website and exchange launch program at NEO DevCon in Seattle on 17 February. Keep watching @nashsocial for more updates!

Tom
Read more posts by this author.
All Posts

Compliance and Registration

Nash was the first Crypto Platform in Europe registered by the Financial Market Authority (FMA) of Liechtenstein. Nash is also registered with the De Nederlandsche Bank N.V. (DNB).
Icon illustration representing a book with transparent background.

Industry Leading Security

Nash’s Crypto Platform and Investment App uses state-of-the art, audited security measures and is fully non-custodial.
What makes Nash so safe
Icon illustration of a shield representing security on a transparent background.
Trustpilot logo icon
YouTube logo iconTwitter logo iconTelegram logo iconLinkedIn logo iconInstagram logo iconFacebook logo icon
Rates may vary over time. Crypto-powered earnings on Nash are not covered by any deposit guarantee schemes like bank savings accounts and involve risks unique to the underlying technologies: (i) Exploitations of the smart contracts used; (ii) Forex fluctations between your national currency and the US dollar, which underlies crypto earnings assets; (iii) USD stablecoins losing their peg. 
Nash is a trademark of Neon Exchange Aktiengesellschaft. Neon Exchange Aktiengesellschaft is an exchange bureau registered with the FMA of Liechtenstein (TT Exchange Service Provider Nr. 261096 as defined by the Token- und VT-Dienstleister-Gesetz / TVTG, 3 October 2019)
Nash Exchange B.V. is registered with De Nederlandsche Bank N.V. (DNB) as a provider of crypto services. DNB conducts supervision and monitors Nash Exchange B.V.’s compliance with the Money Laundering and Terrorist Financing Prevention Act and the Sanctions Act 1977. Nash Exchange B.V. is not under the prudential supervision of DNB nor under business conduct supervision of the AFM. This means there is no supervision of financial requirements or business risks and no specific consumer financial protections.
Neon Exchange Aktiengesellschaft is a partner of Modulr Finance B.V., a company registered in the Netherlands with company number 81852401, which is authorised and regulated by the Dutch Central Bank (DNB) as an Electronic Money Institution (Firm Reference Number: R182870) for the issuance of electronic money and payment services. Your account and related payment services are provided by Modulr Finance B.V. Your funds will be held in one or more segregated accounts and safeguarded in line with the Financial Supervision Act – for more information please see this link.
Neon Exchange Aktiengesellschaft also provides fiat-crypto exchange services. These are separate and unrelated to the account and payment services you receive from Modulr Finance B.V.