InstantDEX

From SuperNET Wiki
Jump to: navigation, search

Largely outdated. Needs update.

InstantDEX (iDEX) is a core service for SuperNET. It will allow near-real-time exchange of one cryptocurrency to another, in a decentralized way. It utilizes NXT's decentralized asset exchange as well as BitcoinDark's tradebot and privacy technology.

The MMatrix as well as tradebots are essential elements of InstantDEX that overlap with its technology.

1 What it is[edit]

InstantDEX is meant to be an easy to use tool for both advance and new users. It can automate exchange and deposit between crypto-currencies for new comers through the use of vanilla tradebots, as well as allow NY stock exchange level complex trades, all under the same platform.

The SuperNET already is building the infrastructure to connect cryptocurrencies to fiat currencies, however iDEX is focused particularly on the exchange of participating first crypto-coins.

Among its calls to fame, it will allow for the submission of bids and asks as well as their cancellation at no cost.

If an offer that is too far from current market prices is set, than it will wait in the Market Maker order book until a MMatrix node pics it up.

2 How it works[edit]

The ability to make instant decentralized exchanges between crypto-currencies is enabled by an ecosystem of technologies including the Multigateway, MMatrix nodes, Ramchains, Finhive (Skynet) as well as BitcoinDark and NXT.

2.1 Index currencies and low exchange spreads[edit]

To be able to have instant exchanges, without losing 5 to 20 % on trades (such as is currently the case in the NXT AE). high amounts of transactions per time intervals are needed. This is very difficult to do if all participating coins are trading against each other.

For example, Dogecoin to Blackcoin trades might be far less likely than Dogecoin to Bitcoin trades, and Blackcoin to Bitcoin trades.

In the above example, Bitcoin would be considered the 'index' currency, such as is the US dollar in the foreign exchange markets and the DOW Jones in NY's stock exchange.

In the case of SuperNET, there will be two index currencies which will serve as two sides of the same coin.

On the cryptocurrency and privacy side of things is BitcoinDark. All exchanges between non NXT-asset, cryptocurrencies will be traded for BTCD first and then to the intended coin. This will be done automatically and in the background. Enabling BitcoinDark's privacy features will come at an extra albeit negligible cost.

On the NXT asset exchange side of things will be JLH (JL777hodl), an NXT asset which will function as reference exchange for theNXT AE side trades.

2.2 Multigateway[edit]

To enable 1:1 convertibility between NXT coin assets and cryptocurrencies, such as BTC and mgwBTC, the Multigateway was created. This is a server technology that allows 3 parties or more to each host a node solely responsible for signing their share of multisignature withdraws.

Users deposit to multisignature addresses. Transactions are validated by the corresponding blockchains and then deposited to the MGW server clusters. MGW then releases the corresponding mgwCOIN asset to the rightful owner as specified during the initial stage of the transaction. This is all accessible only through the decentralized NXT platform and its asset exchange. Though the SuperNET client will use some of this technology in the background.

Thus, MGW clusters hold both cryptocurrencies and NXT coin assets.

Hosts of MGW clusters and their corresponding nodes are developer teams from participating cryptocurrency communities as well as companies such as Coinomal, and or (when necessary) members of the SuperNET team, as in the case of Bitcoin.

Clusters can host a variety of cryptocurrencies, such that each coin supported by the cluster can also be a host of one of the closer nodes.

For example, during the SuperNET v1 Beta release on February 2015, 5 new coins join the party, including Opal, Vericoin and VPNcoin. Opal and Vericoin are also two of the 3 cluster hosts.

The code is open source and anyone interested can host their own cluster, though they will not necessarily receive credibility at face value from the SuperNET community. Buyer beware. As of February 2015, only NXT and SuperNET community hosted MGW clusters are known exist.

Current MGW clusters function with 2 of 3 multisignature accounts for coins that support multisignature transactions, though there is no technical reason this can not be scaled to up to 15 parties.

Currently the only difficulty in doing this is finding parties to host the servers. As the MGW code as well as the platform get more popular, supporters expect it to become more profitable to run MGW nodes, as well as easier, further decentralizing this exchange.

It is wroth noting that this may be the most transparent and decentralized, or rather 'distributed' exchange between cryptocurrencies to date, since most cryptoexchanges hold on to vast amounts of information about how they secure their coins. With some temporary exceptions which depend on the release of NXT's multisignature capacity or Phasing.

2.2.1 NXT Phasing[edit]

Phasing is NXT's version of multisignature, unlike competition, NXT does not yet support multisig. This of course is a challenge when trying to apply the MGW model to the mirror assets on the NXT side. In other words, the storage of the mgwCOINs is not as decentralized as the coins them selves, yet.

This comes with the regular risks of centralized exchanges. Lets take mgwBTC as an example.

There are 21 million possible btc units, and as such there are 21 million mgwBTC units. Since most if not all of those coins are not in circulation yet, many of them having yet to be mined, than their mgw version must also stay out of circulation.

If, even 5 % of those coins were to be dumped on the market by the SuperTEAM, then this would be a significant theft, likely large enough to empty the liquidity in the MGW exchange at current time.

To solve this, the assets will be turned into multisignature accounts as soon as possible, and eventually into DACs, which will control these funds according to what the community considers fair.

This problem also applies to all SuperNET assets, and as such, the SuperNET is openly in Beta, until the Phasing arrives and the storage of these assets is decentralized.

2.3 MMatrix Nodes[edit]

Market makers or MMatrix nodes are computers that run the standard SuperNET client, as well as copies of the blockchain of every participating coin. These members of the community are similar to miners or stakers in that they specialize in providing a unique service to all crypto-currency users by enabling decentralized instant exchanges.

To do this, they must host the software on high ram servers, and the corresponding blockchains, as well as any tradebots they can get their hands on that will optimize their exchange ratios. Among the most important of this ratios is the amount of fees paid to the InstantDEX NXT asset.

The ratios or standards by which the success of MMatrix is determined mainly by the total fees they pay, but also by volume traded, and perhaps in the future other measures of reliability.

All MMatrix nodes work together, sharing trade offers done by users. however, the ones with the most fees paid get the first shot at choosing which trades to execute and which to pass along to the next, and so forth.

As such, the incentives to be the best trader and provide the most value to users as well as asset holders are set. To rise to the top and enter the competition, new players can pay a donation to the InstantDEX holders and raise their ranking, similar to google ads.

As of March 2015, James clarified that there will be no limit to how many nodes can be MMatrix nodes, any node with tradebots can participate and compete.

2.4 Finhive & Skynet[edit]

Finhive is a company owned by SuperNET who's sole purpose is to create a source of rich financial data for trading, as well as the InstantDEX tradebots that can leverage it. They are not the only tradebot designers and data providers, its a free market, but they are one of the most notizible players.

MMatrix hosts can purchase tradebots from Finhive or make their own.

Finhive uses complex statistics and cutting edge artificial intelligence to provide the most relevant information to its custiomers. Learn more about Finhive's roadmap and development process as well as their contract with SuperNET at their website or on the NXT forum.

 

3 Sources of revenue[edit]

InstantDEX Revenue Distribution.png

InstantDEX asset holders 50%, Bitcoindark stakers 5%, MGW asset holders 5%, Tradebots asset holders 15%, Affiliates (ie Jay) 20%, Lotto Fund 5%

3.1 NXTventure[edit]

InstantDEX owns 40% of NXTventure. So any dividends paid out by NXTventure flow to InstantDEX. Any such dividends are than distributed to InstantDEX asset holders.

3.2 MMatrix[edit]

MMatrix nodes are responsible for optimizing the instant exchanges that occurs on the decentralized platform. Incentives are set so that nodes which pay the most fees to InstantDEX, benefit from having fist pick of trade offers. Similar to Google ad rankings, the best participants are at the top, but new players can pay to rise and be seen. This way, they get a good chance at competition.

This technology is still under development and its exact approach is likely to change and evolve. As of March 2015, James said that there will be no limit to who is an MMatrix node or a difference between them an normal nodes. Essentially, anyone running tradebots will be a valid player.

All fees earned are paid to InstantDEX and are distributed according to standard distribution.

4 Installation[edit]

We're currently using the pad at http://pad.supernet.org/testing-instantdex as a living document. As the process becomes more streamlined we should move the guide over to this wiki.

5 Testing[edit]

Testing IDEX on linux:

1. start nxt with ./run.sh in nxt folder

2. clone BitcoinDark from https://github.com/jl777/btcd cd btcd/libjl777 make dependencies make onetime

3. edit SuperNET.conf in btcd/lib777 e.g.

{

   "userdir":"<your home directory>",
   "secret":"<your nxt secret>",
   "prices":[
       {"exchange":"poloniex","key":"<your key>","secret":"<your secret>"},
       {"exchange":"bittrex","key":"<your key>","secret":"<your secret>"}
   ]

}

4. start BitcoinDark with ./m_unix in btcd/lib777 folder

5. clone btcd-web-wallet from https://github.com/BTCDDev/btcd-web-wallet

6. clone idex from https://github.com/CryptoSleuth/InstantDEX/ and copy it to /btcd-web-wallet/public/IDEX

7. start btcd-web-wallet with node app.js in btcd-web-wallet folder

8. open 127.0.0.1:8080/IDEX/index.html in browser

Testing InstantDEX on Windows:

  • Make sure to have "server=1" in bitcoindark.conf (to find this file, you can type %appdata%/BitcoinDark in Windows Explorer)
  • NXT blockchain and BTCD blockchain have to be up to date before SuperNET commands will work.
  • Download NXT blockchain: http://peerexplorer.com/ (bottom right)

1) Download the server (where to put the files? ) https://www.mediafire.com/?gpubgum7o73pt33 or https://github.com/CryptoSleuth/CryptoSleuth/tree/master/snserver

2) Download the BTCD qt with SuperNET enabled. https://mega.co.nz/#!0l9iHYiI!F4E5lekWkKnhVcZOReXGIVewqW4aNPbU9WvY8EoNE6o

  • Create a file called "SuperNET.conf" in the unzipped folder and put this into it:

{

   "secret":"<pass of the NXT account you wish to use, dont use your real account!>",
   "UPNP":0                                                 

}

3) Download InstantDEX - https://github.com/CryptoSleuth/InstantDEX

4) Download the 2.7.10 python (this should be 1st step) - https://www.python.org/downloads/

5) Extract snserver, and in the snserver folder modify server.conf:

       -rpcuser and rpcpass must be the same as the rpcuser and rpcpass in /Users/AppData/Roaming/BitcoinDark/BitcoinDark.conf
       -user and pass are the username and password used to access the server

6) If you changed the user and pass fields in server.conf you need to modify the InstantDEX GUI

       -open the idex.ajax.js file in InstantDEX/js/idex.ajax.js
       -change the lines var windowsServerUsername = "user"; and var windowsServerPassword = "pass";
       to the user and pass you chose in server.conf

7) Run NXT, Run BTCD, and from the command prompt run "python server.py" in the snserver folder

8) Doubleclick index.html in the InstantDEX folder.

6 References[edit]