感谢您对YouDEX ICO感兴趣。您可以通过下面的订阅表格加入白名单，并获得高达75％的奖励。或者您可以直接将您的加入请求发送至 firstname.lastname@example.org。 很快，我们将宣布YouDEX公众令牌销售。
Coin direct exchange protocol (CDX protocol) is an open source protocol for direct exchange of tokens and cryptocurrencies across blockchains.
The protocol is based on Ethereum blockchain and its sidechain Youdex. It works as an interblockchain interface. The algorithms themselves are stored in preloaded on Ethereum and Youdex smart contracts and on oracle nodes. The code of both is licensed under MIT license (opensource) and available to the public on https://github.com/YouDex. At the network level security is taken care of by the p2p protocol alongside with the Ethereum and Youdex consensus algorithms, while at the application level it is handled by the algorithms in smart contracts and client DApps.
CDX protocol was heavily influenced by the following ideas: Twin accounts technology , Plasma platform proposed by V. Buterin and D. Poon , BTC-relay smart contract , Oraclize , Interledger protocol [5 ], 0x protocol , DYDX protocol  and others.
Secure tokens and coins direct exchange requires a minimum number of transactions carried out without intermediaries. Ideally, the process should be limited to two transactions, one in each exchange direction. Only this transaction-light method gives maximum speed and minimum overhead.
However, this usually comes at the cost of safety. Due to the inconsistent number of transactions throughput on different blockchains, there is a constant threat of “double waste” and fraud.
The use of multi-signature transactions does not solve the problem in its entirety, overcomplicates and slows down the exchange speed, not to mention the increased costs. As for the centralized services, that although seem to solve the speed issue, unfortunately, it undermine the whole paradigm of security and safety through decentralization.
CDX protocol offers the solution to the problem, securing only single transactions in a form of a pledge (escrow).
At the core of the crosschain services is a pair of identical twin smart contracts – YODA (ERC20 token) and Teleport smart contract. One on Ethereum blockchain and the other on Etherium sidechain Youdex (Ethereum fork). The crosschain transactions are fueled by YODA tokens present in both blockchains, acting as a linking device between the two ledgers.
The key concept behind blockchain linking is a pair of identical “twin accounts”. YODA tokens are transferred (teleported) from Ethereum blockchain to its sidechain Youdex and vice versa.
As can be seen from the diagram below (fig. 1), at any given time the user should hold a certain number of YODA tokens. Some of them are on Ethereum, and some are on Youdex. Tokens are identical on both blockchains. Depending on where the tokens are to be used inside Youdex or on Ethereum, they can be transferred at any given time to either of the twin accounts. This is the “twin accounts” concept. More details on the Twin Accounts are in the section .
A special DApp (cross-chain oracle called Plasmoid) controls the transfer between blockchain and sidechain. It is a node with the set of logic with state control and error handling, that translates signed transactions, requests and responses among nodes on blockchain and sidechain. Plasmoid generates a necessary number of transactions between escrow accounts and user accounts and uses Teleport script to teleport tokens.
To transfer YODA tokens from blockchain to Youdex, DApp node initiates transfer by running the predefined script. First, YODA tokens on Ethereum are transferred from Ethereum-side account to the escrow account of Teleport smart contract. Then, on the sidechain the same amount of YODAs are transferred from the escrow account to the Youdex-side user account. To transfer tokens back from sidechain to Ethereum the same steps are taken but in reverse order.
The protocol is synchronous, transactions in the blockchain and sidechain are initiated in turn, one by one, to prevent “double spend” attack. In the event of transaction errors, there is a rollback functionality.
Plasmoid is not the owner of the escrow account. Each Plasmoid has a record in Teleport smart contract. The smart contract and service logic source codes are licensed under MIT license (opensource). In order to bring competitiveness and incentives in the line of decentralization, Plasmoids are paid fees for the cross-chain transactions they process.
Plasmoids will have an open API and SDKs for the integration with third-party services and applications.
The method of interblockchain linking described above brings following advantages:
– almost total decentralization;
– single address space identical in both blockchains;
– use of one pair of keys for both blockchains stored on a given client device;
– identical smart contracts;
– lightweight logic;
– insured transaction security;
– DApps that are connected simultaneously/alternately to blockchain and/or sidechain;
– limitless expandability due to the integration with third-party services.
Below is the detailed outline of direct and cross-chain exchanges of cryptocurrencies, YODAs, ETH, ERC20 tokens on Ethereum supported by the CDX protocol.
The availability of teleported YODA tokens allows one to organize a secure, inexpensive and fast exchange of ERC20 tokens. Each party and transaction is secured by a smart contract pledge. The two main ingredients of the exchange are DEx smart contract and DExT script (decentralized exchange of tokens).
To minimize transaction fees and accelerate the exchange pledges are made on Youdex sidechain. Exchange parties must have a sufficient number of YODA tokens already stored on their Youdex accounts. Otherwise, the missing amount of YODAs must be teleported from the main blockchain.
The process of exchange goes as follows. Alice’s DApp (order maker) broadcasts onto the p2p network his proposed bid for the exchange of v1 of Token1 to v2 of Token2 with a unique id. Bob’s DApp (order taker) responds to the bid and initiates the exchange. Plasmoid crosschain oracle calculates the size of the pledge in YODA tokens based on the current cross-rates of tokens and YODA.
It is assumed that tokens exchange cross-rate is automatically agreed beforehand. Service oracles propose the cross-rate based on the data gathered from the outside markets(The cross-rate negotiation protocol is currently under development).
Plasmoid implements DExT script and Depo function of DEx smart contract according to the following algorithm.
The protocol is synchronous. First, the pledge is formed though transactions on the sidechain. Then, the exchange takes place via transactions on the main blockchain. Afterwards, the pledged deposit is withdrawn via transactions on the sidechain. Simultaneous transactions on the blockchain and sidechain are forbidden.
Thus, at the core of the CDX protocol are:
– blockchain Ethereum;
– sidechain Youdex;
– smart contracts: YODA (ERC20 token), Teleport, DEx smart contract;
– Plasmoid crosschain oracle.
The basic CDX protocol implementation also provides a secure direct exchange of ERC20 to ETH on Ethereum. Plasmoid uses another script – DexT-ETH, which differs from the DexT script, mentioned previously. The rest of the functionality and logic is similar to the previous algorithm with pledges. The only difference is that instead of a single call to the smart contract transfer function, a signed ETH transfer transaction is broadcasted to Ethereum.
The difference between coins and tokens can be found here
In case of cryptocurrencies crosschain direct exchange, CDX basic implementation for ERC20 tokens should be supplemented by cryptocurrency connectors. Connectors are the extension modules for Plasmoids. Their purpose is to ensure the cryptocurrency’s native blockchain support.
The cryptocurrencies exchange itself is managed by Plasmoid (crosschain oracle) and DExC script (decentralized exchange of cryptocurrency coins – modified version of DExT). This coins exchange algorithm is similar to the algorithm of secure ERC20 tokens exchange, mentioned in part 4. The first and third steps are identical to those described earlier (step 1 and step 3 – formation and cancellation of pledges). The difference is in the second step (step 2 – the execution of transactions in the blockchains). Fig. 2 illustrates DExC algorithm in case of BTC-ETH exchange .
CDX protocol requires two transactions, one in each exchange direction, secured by the pledge. This should minimise transaction time and fee while ensuring security at the same time.
In rare occurrences, the exchange of coins and tokens may be interrupted (accidentally or intentionally) in such a way that one of the parties will suffer damage. DEx smart contract maintains an exchange log. The protocol is designed with arbitration functionality that voluntarily adjusts balance sheets of the parties. Balances will be automatically adjusted in YODA coins equivalent at the expense of pledges in the case the consent is not achieved.
In the case of probable incidents, it is always possible to trace back the teleporting process. This will help restore the correct course of operations should there be any deviation from the norm.
Another part of secure cross-chain communication is Plasmoid cross-chain oracle controlled by smart contracts. Plasmoid is authorized to operate only with a sufficient number of YODA tokens hold on the account.
At the network level security is dealt with by the Youdex consensus algorithm.
Programmer, smart contract developer, innovator. Founder and creator of CityChain – corporate and government voting blockchain for municipal initiatives. The designer of Coin Direct Exchange Protocol. Lecturer on the blockchain.
Expert on information security, compliance, networks, product development, agile and customer development practitioner. Managed and designed distributed facility management system for the largest bank in Russia. Project manager, developer of prototypes.
Serial entrepreneur and CEO in the fields of systems software development and IoT for financial and aviation industries. The designer of mathematical crypto investment models, portfolio and risk management strategies.