Smart contract infrastructure to allow arbitrable dapps on xDAI to use Kleros on Ethereum as arbitrator.
+----------------+
+--------------------->+ Cross Chain |
v | Arbitrable |
+----------+----------+ +----------------+
| Home Arbitration |
| Proxy |
+----------+----------+
^
xDAI |
+----------------------|---------------------------------------------+
v
+-----------+-------------------------------+
| xDAI/Ethereum AMB +----------------+ |
| | Oracle | |
| +----------------+ |
| +----------------+ +----------------+ |
| | Oracle | | Oracle | |
| +----------------+ +----------------+ |
+-----------+-------------------------------+
^
+----------------------|---------------------------------------------+
Ethereum |
v
+----------+----------+
| Foreign Arbitration |
| Proxy |
+----------+----------+
^ +------------+
+--------------------->+ Kleros |
+------------+
- Home Proxy: proxy on xDAI/Sokol.
- Foreign Proxy: proxy on Ethereum Mainnet/Goerli.
- Plaintiff: the dispute requester, interested in changing the current arbitrable outcome.
- Defendant: the user interested in keeping the current arbitrable outcome.
- Users willing to request a dispute SHOULD watch the arbitrable contract on the Home Network to know when requesting dispute is possible.
- However, if there is a time limit for when the dispute can be requested, the Arbitration Proxies CANNOT guarantee the dispute request will be notified in time. This is due to the asynchronous nature of cross-chain communication.
- Once the dispute is created, its lifecycle will happen entirely on Ethereum.
- Arbitrable contracts MUST register themselves in the Home Proxy before any dispute can be created.
- Contracts CAN register the dispute params (namely
metaEvidence
, andarbitratorExtraData
) at a contract level or on a per-item basis or a mix of both.
- Contracts CAN register the dispute params (namely
- The Home Proxy MUST forward the params to the Foreign Proxy.
At this point users CAN request a dispute for that given arbitrable item.
- In order to request a dispute, the plaintiff MUST pay for the current arbitration cost beforehand.
- The dispute request MUST be relayed to the Home Proxy.
- The Home Proxy MUST check if the Arbitrable contract accepts the dispute.
- The arbitrable contract CAN accept or reject the request according to its own rules.
- If the dispute request is accepted, the information MUST be relayed to the foreign proxy, which will proceed to create the dispute.
- The home proxy MUST inform the arbitrable contract of the dispute request.
- The foreign proxy MUST now wait for the defendant to pay for the arbitration cost up to
feeDepositTimeout
seconds.- If the defendant pays the due amount in time, then the dispute SHOULD be created.
- If the dispute could be created
- Then the foreign proxy MUST relay that information to the home proxy.
- Once the final ruling is recived, it MUST be relayed to the home proxy.
- The home proxy MUST rule over the arbitrable item.
- Otherwise, if the dispute creation fails
- Then the foreign proxy MUST relay that information to the home proxy.
- The home proxy MUST inform the arbitrable contract that the dispute could not be created.
- Then the foreign proxy MUST relay that information to the home proxy.
- If the dispute could be created
- Otherwise, the plaintiff MUST be considered the winner
- The foreign proxy MUST forward the ruling to the home proxy.
- The home proxy MUST rule over the arbitrable item.
- If the defendant pays the due amount in time, then the dispute SHOULD be created.
- Otherwise, the rejection MUST also be relayed to the foreign proxy.
- The plaintiff MUST be reimbursed of any deposited fees.
- The arbitration request process CAN be restarted.
(I) Means the initial state.
[condition] Means a guard condition.
Receive Request +----------+
+-------------------->+ Rejected |
| [Rejected] +-----+----+
| |
| |
| | Relay Rejected
+-(I)--+ |
| None +<----------------------+
+--+---+ |
| |
| | Receive Dispute Failed
| |
| Receive Request +-----+----+ +--(F)--+
+-------------------->+ Accepted +-------------------->+ Ruled |
[Accepted] +----------+ Receive Ruling +-------+
(I) Means the initial state.
(F) Means a final state.
[condition] Means a guard condition.
[Defendant did not pay]
|
+-(I)--+ Request Dispute +-----------+ +----------------+ | +--(F)--+
| None +-------------------->+ Requested +----------------->+ DepositPending +---------------->+ Ruled |
+------+ [Registered] +-----+-----+ [Accepted] +-------+--------+ +---+---+
A | | ^
| | | |
| | [Rejected] | [Defendant Paid] |
| | | | Rule
| | | |
| | | +---------+ |
+------------------------------+--------------------------------+--------->+ Ongoing +---------+
| | +---------+
| |
[Create Dispute Failed] [Create Dispute Created]
Used by arbitrable contracts which expect a binary ruling for dispute.
Home Proxy:
- Sokol:
<none>
- xDai:
<none>
Foreign Proxy:
- Goerli:
<none>
- Mainnet:
<none>
yarn install
yarn test
yarn build
yarn lint
yarn fix