You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 2 Next »

Status
IN PROGRESS
Stakeholders
Outcome
Due date
Owner

Background

DEX is planned to be implemented as Iroha 2.0 module.

Action items

Problem

Decentralized exchange provides an ability to transfer assets between accounts in exchange for other assets. Let's use a simple case as an example:

PlantUML diagram

@startuml
Buyer -> Iroha: Place Exchange Order(20XOR, 100USD)
Seller -> Iroha: Place Exchange Order(100USD, 20XOR)
Iroha -> Iroha: Transfer 20XOR from Seller to Buyer
alt Success:
  Iroha -> Iroha: Transfer 100USD from Buyer to Seller
end
@enduml

So Iroha should secure peer to peer exchanges across the ledger from malicious actions. In this case Iroha does a good job, the only thing it should check is an ability to transfer assets from and to accounts.

But there are more corner cases when we deal with exchanges via bridge:

  • Cross blockchain rates should be taken into consideration
  • Iroha should prevent double spent of assets 
  • Additionally to transferring assets, Iroha should mint and demint them

Solution

Introduce a new module "DEX" with a dependency on "Bridge" module with additional set of Iroha Special Instructions and Queries and new Abstractions like Order (Combination of a Trigger and Asset with a predefined Asset Definition). Implement Triggers.

Decisions

Alternatives

Concerns

Assumptions

Risks

Additional Information


  • No labels