DEX

所属分类:加密解密
开发工具:TypeScript
文件大小:411KB
下载次数:0
上传日期:2018-06-22 13:31:54
上 传 者sh-1993
说明:  去中心化加密货币到菲亚特交易所
(Decentralized Crypto-to-Fiat Exchange)

文件列表:
Smart Contracts (0, 2018-06-22)
Smart Contracts\Contracts To Create Escrow Contract (0, 2018-06-22)
Smart Contracts\Contracts To Create Escrow Contract\CallerContract.sol (573, 2018-06-22)
Smart Contracts\Contracts To Create Escrow Contract\Deployed Contracts (0, 2018-06-22)
Smart Contracts\Contracts To Create Escrow Contract\Deployed Contracts\CallerContract.txt (143, 2018-06-22)
Smart Contracts\Contracts To Create Escrow Contract\Deployed Contracts\Escrow Contract Created Using The Contract.txt (150, 2018-06-22)
Smart Contracts\Contracts To Create Escrow Contract\EscrowContract.sol (7798, 2018-06-22)
Smart Contracts\Contracts To Create Escrow Contract\IEscrowContract.sol (1328, 2018-06-22)
Smart Contracts\DEX-Main (0, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract-v2.sol (6590, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract-v3.sol (6614, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract-v4.sol (6871, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract-v5.sol (7093, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract-v6.sol (7099, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract-v7.sol (8119, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract-v8.sol (8617, 2018-06-22)
Smart Contracts\DEX-Main\DEX_MainContract.sol (6117, 2018-06-22)
Smart Contracts\DEX-Main\EscrowContract-v2.sol (8856, 2018-06-22)
Smart Contracts\DEX-Main\EscrowContract-v3.sol (10183, 2018-06-22)
Smart Contracts\DEX-Main\EscrowContract-v4.sol (10294, 2018-06-22)
Smart Contracts\DEX-Main\EscrowContract.sol (7572, 2018-06-22)
Smart Contracts\Escrow Contracts (0, 2018-06-22)
Smart Contracts\Escrow Contracts\Deployed Contract Addresses (0, 2018-06-22)
Smart Contracts\Escrow Contracts\Deployed Contract Addresses\DeployedContractAddress (230, 2018-06-22)
Smart Contracts\Escrow Contracts\FINAL-MULTISIGESCROW-V1-USING-0_4_24.sol (7221, 2018-06-22)
Smart Contracts\Escrow Contracts\FINAL-MULTISIGESCROW-V2-USING-0_4_10+commit_f0d539ae_Emscripten_clang.sol (7147, 2018-06-22)
Smart Contracts\Escrow Contracts\MULTISIGESCROW-V3-USING-0_4_24.sol (7678, 2018-06-22)
Smart Contracts\Escrow Contracts\MULTISIGESCROW-V4-USING-0.4.24.sol (8303, 2018-06-22)
Smart Contracts\Escrow Contracts\MULTISIGESCROW-V5-USING-0_4_24.sol (8516, 2018-06-22)
Smart Contracts\Escrow Contracts\MULTISIGESCROW-V6-USING-0.4.24.sol (7419, 2018-06-22)
Smart Contracts\Escrow Contracts\MULTISIGESCROW-V7-USING-0.4.24.sol (7692, 2018-06-22)
Smart Contracts\Escrow Contracts\MULTISIGESCROW-V8-USING-0.4.24.sol (8856, 2018-06-22)
Smart Contracts\Escrow Contracts\MULTISIGESCROW-V9-USING-0.4.24.sol (10183, 2018-06-22)
Smart Contracts\FinalizedContracts (0, 2018-06-22)
Smart Contracts\FinalizedContracts\DEX_MainContract_v1.0.sol (9056, 2018-06-22)
Smart Contracts\FinalizedContracts\EscrowContract_v1.0.sol (10885, 2018-06-22)
Smart Contracts\FinalizedContracts\IDEX_MainContract_v1.0.sol (114, 2018-06-22)
Smart Contracts\FinalizedContracts\IEscrowContract_v1.0.sol (237, 2018-06-22)
... ...

# DEX Decentralized Crypto-to-Fiat Exchange DEX is divided into two phases first phase is Crypto-to-Fiat focusing on Ethereum based escrow service and the second phase is Crypto-to-Crypto exchange using atomic swaps and related technologies. Phase 1 Trade: BTC <-> Fiat/Crypto: With respect to the user's journey, first of all, the user will be asked to set up the software. He will need to create new addresses or enter his own addresses with private keys. The second part of the journey would be to show the current market rates to the users. This can be done using any api which is providing the desired results. The last part consits of trade. Trade includes: 1)Order Placing (P2P -> Broadcasting) 2)Order Locking or Order matching 3)Escrow deposit to the address (also include HTLC) 4)Verification 5)Payout using multisig 1) Order Placing: The order book will be completely decentralized. All nodes or computers will be connected with a P2P network. At startup every trader will load all offers for his selected national currency from the P2P network peers he connects to. These offers will fill up the order book visible to the user. If the users want to trade with a new offer, they will have to broadcast a message that will contain the details of the trade as well as the arbitrator that they have chosen. The details of the trade include name of the currencies, amount they want to buy or sell, rate at which they are buying and selling and lastly the payment methods they want to use for fiat currency. This message will be signed so that the authenticity of the offer can be maintained. There will be a time to live for the broadcasted message that will tell that the offer is still valid. 2) Order Locking: The user which is accepting the offer will validate the offer and he will also have to check that the order is still valid. Furthermore, he will also have to agree with that the arbitrator chosen. 3) Deposit Transaction: A deposit transaction is created using a 2-of-3 multi-signature to fund the escrow address. The deposit transaction is passed for completion and signing between the traders over the messaging channel. Finally it is published to the blockchain by the offerer. The deposit transaction to the escrow address contains: -Input from Buyer: Security deposit + mining fee to send to buyer address from escrow + trading fees -> fix mining fee (Slow, Fast, Medium) -Input from Seller: Security deposit + mining fee to send to escrow + trade amount + trading fees -Input from arbitrator: Security deposit -Output to escrow address: 3*Security deposit + mining fee to send to buyer address from escrow + trade amount + 2*trading fees 4) Verification: Once the deposit transaction is broadcasted a countdown will start in which the buyer will have to pay fiat currency to the seller using the selected payment method. The seller wil have to wait for the buyer to send the fiat amount. If the amount is arrived according to the parameters defined in the contract, then the seller will proceed to the payout using multisig. And if not then there will be a case of dispute. 5) Payout using multisig: The payout transaction contains: -Input: Funds from multisig escrow address, signed by buyer -Output to buyer: Security deposit refund + release of payment to Alice -Output to seller: Security deposit refund -Output to arbitrator: Security deposit refund + trading fee/2 -Output to exchange: trading fee + trading fee/2 Phase 2 Trade: Crypto <-> Crypto: For doing crypto to crypto we will need to implement atomic swap mechanisms. We will be writing HTLC (Hashed timelock contracts) on every chain. We may not be needing to download whole blockchains. We can use the same network as above to recieve and validate transactions. Ref and motivation: - https://github.com/KomodoPlatform/KomodoPlatform/wiki/BarterDEX-%E2%80%93-A-Practical-Native-DEX - https://github.com/KomodoPlatform/KomodoPlatform/wiki/barterDEX-Whitepaper-v2

近期下载者

相关文件


收藏者