ethereum-oasis-op / baseline-grants

The Baseline Protocol has a yearly grant program for funding various R&D initiatives, implementation developments, and other community projects. This repo is used to track grant applications, bounty ideas, and payment requests for grant work.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[GR4] Writing zero-knowledge circuits using gnark to expand the existing library – Focus on Financial Circuit Development and Approach

BresGit opened this issue · comments

Grant name

Writing zero-knowledge circuits using gnark to expand the existing library – Focus on Financial Circuit Development and Approach

Applicant background

We are a team of three professionals:

Luiz Soares - Participated in the First ConsenSys Academy in 2017, worked as a Solidity developer for Token Foundry in 2018 and after leaving ConsenSys, worked as a blockchain developer and code auditor.

Amal Amchtal - currently a Senior at Union College majoring in Computer Science and a recent General Assembly bootcamp graduate with experience in developing full stack web applications.

Boris Breslav - Hands on Technical Business Analyst/Product Manager, working in the financial industry as a full time and independent consultant for 20+ years. In the last few years followed/researched blockchain technology.

Motivation and overview

Overview

Develop/research financial circuits which will include working and tested code, diagrams, document method/approach to extend functionality.

The proposal is to build circuits for baselining over-the-counter (OTC) Corporate Bonds (Vanilla & Exotic Bonds) trades . Presently corporate bonds are traded between broker-dealers who are acting on their clients behalf. In many instances the Bloomberg platform is used as a price discovery tool, trade execution platform, reference data etc.

High level current process

Bonds are recognized by broker dealers in Bloomberg often on behalf of clients and trades executed. Banks middle office complete/verifie/reconcile trade details.
At the time of the trade the following attributes are private: Party, Counter party, Trade details, yield, instrument traded etc. Trade details need to be made available in the TRACE (FINRA’s Trade Reporting and Compliance Engine) in 15 minutes after the trade. Please keep in mind 15 minutes in trade processing is a long time.

Proposed Circuits in gnark - Financial Circuits

Develop circuits for baselining over-the-counter (OTC) Corporate Bonds:

  • Vanilla Bonds
  • Exotic Bonds - Callable, Puttable, Perpetual
  • FRN Bonds
  • Credit Derivatives - stretch

The circuits will be built in such a manner that they will keep the details of the trade private for 15 minutes. After that per regulatory requirement the information of the trade will become transparent to the regulators, trade participants and the general public.

Motivation

Strong belief that Baseline protocol on public blockchain will set a new direction for participants and financial regulators that want/need to coordinate multi party business processes with privacy and without putting sensitive enterprise information on the blockchain.
We as a team with diverse technical and business backgrounds are eager to contribute to the growth, development and adoption of the Baseline Protocol.

Specific expected project benefits:

  • Research and build financial circuits using gnark. Steps and challenges to build this application will be documented and made available.

  • Building a Baselined – private, cost effective and regulatory conforming trade circuits/confirmation process, for OTC instruments in scope.
    Presently users need to pay for TRACE data and for services to complete EOD trade reconciliation with Front Office Blotters.

  • Gives a chance/opportunity to smaller participants who can’t afford Bloomberg service and require a safe, inexpensive, audited and baselined/confirmation process.

Execution risks

gnark has not been fully audit yet and is provided “as-is” we might encounter some challenges/blockers that will require assistance from the gnark/ConsenSys team.

We might find limitations in gnark circuit development, that might require more time to build than initially planned.

Assumption is we will be using BR-2, as of April 15 BR-2 is still work in progress.

Downsides

It might take us longer to build the circuits than what we originally planned for, we will mitigate that by providing transparency from the start and manage it.

Tasks and schedule (milestones if applicable)

Iteration Topic Time
Iteration 1 Vanilla Bonds - Base 3 weeks
Iteration 2 Vanilla Bonds  - Complete 1 week
Iteration 3 Exotic Bonds - Base 1 week
Iteration 4 Exotic Bonds 1 week
Iteration 5 Exotic Bonds  - Complete 1 week
Iteration 6 FRN Bonds 1 Week

Budget and justification

Iteration Topic Time Cost
Iteration 1 Vanilla Bonds - Base 3 weeks $3,600
Iteration 2 Vanilla Bonds  - Complete 1 week $1,200
Iteration 3 Exotic Bonds - Base 1 week $1,200
Iteration 4 Exotic Bonds 1 week $1,200
Iteration 5 Exotic Bonds  - Complete 1 week $1,200
Iteration 6 FRN Bonds 1 Week $1,200

Total $9,600

The R&D involved in attempting this alone will be very useful. Important not to 'require' any proprietary packages, though proprietary components may be used if compartmentalized and easily replaced by other components.

As discussed and requested in TSC Meeting on 4/28/2021, adding a comment on scope clarification: The project scope is to demonstrate working circuits in gnark with ability to be used/replaced also with other zero knowledge libraries.

Here is the code for 1st and 2nd iteration: https://github.com/fosgate29/financialcircuit/

The circuits will be built in such a manner that they will keep the details of the trade private for 15 minutes. After that per regulatory requirement the information of the trade will become transparent to the regulators, trade participants and the general public.

How will the details of the trade be exposed after 15 minutes? Would this be done automatically through the bond circuit logic?

The regulators require the initiating party release all trade details for OTC Bonds to a Trace file (Trade Reporting and Compliance Engine – TRACE). The initiating party will do it as they perform it currently. The TRACE requires more information of the trade and ref data that we currently capture in the circuit.