---
# System prepended metadata

title: Decentralising Debt Allocation

---

# Decentralising Debt Allocation

### Scope

[SACHA] and I have decided to tackle together an old project that I had for decentralising yearn vaults' debt allocations. (see https://github.com/jmonteer/ystarkdebtallocator)

This is a prod PoC where we test the usage of verifiable computation and incentives for "useful work". 

**The objective of the project is to decentralise Yearn Vaults Debt Allocation.** The main idea behind it is to use zk-tech (Starkware's Cairo Programs) to verify that an account has proposed a valid solution, which have been computed off-chain (due to optimisation costs and code privacy concerns). 

As the contract only verifies validity of the solution (and not optimality), it could accept non-optimal solutions (even if they abide by the rules and is valid). This is not a problem thanks to the incentives mechanism. As the rewards go to the proposer, proposers will post a better solution if there is room for it. This mechanism will incentivise players to always post the optimal solution or risk someone else to take it (and take the rewards). As there is only 1 optimal solution, the system will tend to equilibrium (until market conditions change).

The project has 2 parts: 
- Verifier contract that receives the proposed solutions and verify their correctness by using Cairo Programs and Starkware's verifier
- Incentives mechanism that creates a stream with rewards to the best proposed solution

This project was started by @jmonteer but was abandoned due to the early stage that Cairo and Starknet had at the moment. At that time, the tech spec had been written and code was started and had good progress for L1 (Solidity).

Some months later, [SHACHA] and I met and after an interesting discussion we decided that he was in a better position to tackle the Cairo part as he was part of another project building on top of Starknet. 

### Plan
The plan is the following: 
- Create PoC with dummy inputs and dummy strategies that show that we can save a new solution on-chain using the result of an off-chain computation
- Extend PoC with real inputs but dummy strategies that show that we have the right mechanism to snapshot L1
- Extend PoC to use real inputs and real strategies with the real usecase of a small vault.
- Add a simple mechanism of incentives for useful work: a stream that is sent to the current optimal solution proposer.

### Deadline
2022-10-31

### People
- Sacha
- jmonteer

### Money
100% of the budget will go to Sacha using a stream

### Amount
5000 DAI for 1.5 months of work
Starkware will be matching with 5000DAI

### Wallet address
0x114E6997a17D6964C1e42B575bc1e60ca2202CD5

### Reporting
yes
