Giter VIP home page Giter VIP logo

yagna-zksync's Introduction

zkSync in Yagna

This repository is a collection of docs and examples to help implement zkSync into Yagna

  • Yagna is: An open platform and marketplace for distributed computations
  • zkSync is: scaling and privacy engine for Ethereum

Introduction

Yagna, as a marketplace, would like to use zkSync as a means of value transfer.

The main reasons are:

Compared to other tools investigated:

  • Native support for ERC20 tokens
  • Quick exit possible ( 10 min ) src
  • Security like the main chain src

Happy user flow ( no yagna )

Provider

  • set signing key ( how-to )
  • monitor incoming payments( how-to - TODO: better way then check balance? )
  • withdraw to any(?) mainnet address( how-to )

Requestor

  • set signing key( how-to )
  • deposit funds to zkSync contract( how-to )
  • send payments when computations are accepted( how-to )
  • withdraw to any(?) mainnet address( how-to )

Happy user flow with yagna

  • Account unlocked -> check if signing key is set -> set signing key
  • Requestor
    • Before allocation is created, funds need to be deposited in zkSync contract
    • Make allocation required for posting demand, options for allowance:
      • Can be a "virtual" safe only inside Yagna ( current )
      • Can be a safe inside the zkSync contract ( nice to have )
      • Can be the funds deposited in zkSync ( not feasable )
    • Send zkSync transaction on each debit note and invoice
  • Provider
    • Withdraw funds to any(?) mainnet ethereum wallet
      • out of the box only own wallet seems possible ( TODO check )
      • transaction fees will be payed from the withdrawn funds
        • Example: withdraw 10$ in value, pay 0.05$ to the network, receive 9.95$ in ethereum wallet

Components

zkSync exists of the following components:

  • Client library
  • Contracts
  • Provider

Client library

The client library is the gateway between yagna and the zkSync network. It is currently written in JavaScript, but the Rust version is on the roadmap ( At GF or ML ) The library providers easy to use methods to call the Provider.

Contracts

The contracts are used to produce the blocks and govern the network. The Main contract handles new blocks, deposits/withdraws and exists The Gov contract handles what ERC20 tokens are available and management of validators

Provider

The provider is a server that serves the API's for the clients to use. It also serves as a back-bone for the zkSync network: collecting transactions, creating and validation of blocks. In the best case scenario we could run these Providers on the Golem network. But for now we can start with ML's infrastructure and upgrade to GF infrastructure when required.

Steps

  • Describe happy user flow abstract and from yagna
  • Describe zkSync components and their applicability to yagna
  • Write examples to use the javascript library like yagna would use it
  • Write rust client library for zkSync
  • Write examples to run a full local dev environment
  • Describe worse case scenario exit strategy

Remarks

  • Decide on what provers we will use ( Matter Labs or Golem Factory)

yagna-zksync's People

Contributors

bidzyyys avatar kmazurek avatar maaktweluit avatar mateuszsrebrny avatar mfranciszkiewicz avatar wiezzel avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

yagna-zksync's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.