Court V2 Integration Sneak Peek

Kleros Integrations Manager, Guangmian Kung brings us an update of the most significant updates to the Court v2 functionalities for new and existing integrations.

Court V2 Integration Sneak Peek

For those of your who have been following Kleros for sometime, you might have heard of the significant upgrade to the Kleros protocol that is Kleros V2. It brings with it a whole suite of new functionalities to the table:

  1. Cross-Chain support: Kleros V2 allows Kleros Court to go cross-chain, supporting Arbitrable DApps across numerous EVM chains (e.g. Arbitrum, Polygon, BSC).
  2. Simplified Integration: Integrations with Kleros Court V1 (especially evidence handling and appeal management) was a complex endeavour for developers. Integrations will become greatly simplified in V2.
  3. Modularity: The modular architecture of V2 allows for the introduction of new functionalities and features without the need for changes to the core contract.
  4. Fork-Friendliness: Kleros v2 also includes a Forking Court system, which involves a final voting round in case of multiple appeals, where all PNK holders can participate to decide on joining a fork.
  5. Lower (gas) cost of juror participation: Kleros v2 will have its main court deployed on Arbitrum, where gas cost is significantly lower than on Ethereum.
  6. User-Friendly Interface: Kleros V2 comes with a redesigned, user-friendly interface, making the experience more intuitive and accessible for both jurors and parties involved in disputes.

As the launch of Kleros V2 is finally just around the corner, it’s about time for us to show a sneak peak into how integrations will work differently than in V1!


How integrations work in V2

There are two roles that DApps can play in the Kleros ecosystem:

  1. Arbitrators, which are DApps that receive, resolve and rule on disputes, such as the Kleros Court.
  2. Arbitrables, which are DApps that depend on the Arbitrators for dispute resolution or subjective oracle services.

While there are hundreds of minute differences in how V1 and V2 function under the hood, today we will focus only on the main differences that are most relevant from the perspective of the Arbitrables.

1. Handling of policies and jury choices

In Kleros V1, the dispute policy, description and jury choices are all stored in a single JSON file called the MetaEvidence, which looks something like this and is stored on IPFS to save gas and storage space.

In V2, the MetaEvidence is known as the Dispute Template, and will be stored on a chain-specific singleton [templateRegistry contract](https://github.com/kleros/kleros-v2/blob/dev/contracts/src/arbitration/DisputeTemplateRegistry.sol).

  • The dispute question, policy and choices are logged as dispute templates by calling setDisputeTemplate() on the deployed TemplateRegistry contract which then emits the contents in a DisputeTemplate event.
    • There will be one unique instance of the TemplateRegistry contract on each chain that Kleros V2 supports.
  • Arbitrator UIs will then use the data mappings in conjunction with the relevant dispute template to render the scenario for each new dispute.

2. Dispute creation

The Dispute Creation process doesn’t change, as the Arbitrable will be calling createDispute() on the Arbitrator contract in both V1 and V2. The only change is in the [extraData](<https://github.com/kleros/kleros-v2/blob/dev/contracts/src/arbitration/KlerosCore.sol#L471>) parameter, which will be expanded in V2 to include also information about the so-called ‘Dispute Kits’, which allows Arbitrables to use new arbitration features such as only selecting jurors from a Sybil-resistant pool. More information will be shared soon.

3. Arbitration fee payment

In V1, dispute fees (and hence juror rewards) were only payable in the native currency that the chain is on (e.g. ETH for Ethereum and xDai on Gnosis). In V2, we plan to support a set of whitelisted (stablecoin and native chain) ERC20 tokens, allowing for more ways of paying for more convenient and predictable ways of estimating and paying the arbitration costs on Kleros Court.

4. Handling of dispute evidence

Evidence handling has been a rather complicated task for Arbitrables in the Kleros V1 ecosystem. Besides having to create functions on their contracts to log and index evidences, developers also had to build the UI components to submit and display them properly.

In V2, the evidence submission is entirely handled by the Court. Arbitrable Developers will no longer have to worry about it at all.

5. Handling of appeals and appeal crowdfunding

The appeal system of Kleros is one of its core features that ensures its resilience against (economic) attacks.

The logic to do so in Kleros V1 was handled within the Arbitrables, which greatly increased smart contract and UI complexity for integrating partners. Furthermore, it is often ideal to allow for appeals to be crowdfunded to allow for multiple individuals to defend the court against well-funded but allegedly incorrect appellants, but supporting that further increases the complexity of this task. Solutions to reduce this complexity in V1 do exist (such as the Arbitrable Proxy integration method), but it was not a perfect solution and introduced other tradeoffs in security.

Fortunately in V2, the entire logic of appeals and crowdfunding will be handled by the Court (Arbitrator) itself, meaning that Arbitrable developers need not have to worry about it at all.

6. Ruling

Rulings are communicated back from the Arbitrator to the Arbitrables in the same way in V1 and V2 - through the calling of rule()on the Arbitrables.

Here is a summary table showing all the above points:


Conclusion

Kleros V2, with its user-friendly interface, modular design, and cross-chain functionality, aims to address the numerous suggestions and feedback received from our community and partners over recent years. The platform is currently in the testing phase, engaging community jury members on Arbitrum Sepolia. We are excited to continue sharing updates on upcoming features in the coming period, such as the SDKs and Dispute Preview UI, that promise to streamline integrations development. These advancements are expected to greatly simplify partnerships and facilitate building on lower-cost chains, and we are eagerly looking forward to see what our community will build with it.

Stay tuned for more updates!


For more detailed information on the Kleros V2 roadmap, feel free to follow the updates on the Kleros Blog.