Git Product home page Git Product logo

protokit-spymaster's Introduction

Protokit Spy Master

This repository is a monorepo aimed at kickstarting application chain development using the Protokit framework.

The repository contains the solution to Challenge 3 of the Learn & Earn challenge series, which is part of the Mina Navigator program.

Protokit & Privacy

Because of the hybrid execution module we can have private computation being done off chain, with a proof of that being sent on chain.

  • The general approach would be:

    • Perform off chain computation with private inputs to create a proof , and a public output.
    • Submit the proof to the sequencer as part of the transaction
    • The runtime module can verify the proof
    • The proof's public output can be used on chain for further business logic.
  • In the case of the spy master AppChain, a privacy solution would be:

    • Store the states in initialize as usual.
    • agentID and securityCode are public states to assert the integrity of the agent details
      • These states can be hashed to add a layer of privacy.
    • In order to process the messages privately
      • Generate a proof off-chain for the messasge where the agentID & securityCode are publicInputs checked against the stored state.
      • The subject(main message) is a privateInput that is verified on-chain to prove that's is correct.

Quick start

The monorepo contains 1 package and 1 app:

  • packages/chain contains everything related to your app-chain
  • apps/web contains a demo UI that connects to your locally hosted app-chain sequencer

Prerequisites:

  • Node.js v18
  • pnpm
  • nvm

If you're on windows, please use Docker until we find a more suitable solution to running the @proto-kit/cli. Run the following command and then proceed to "Running the sequencer & UI":

docker run -it --rm -p 3000:3000 -p 8080:8080 -v %cd%:/starter-kit -w /starter-kit gplane/pnpm:node18 bash

Setup

git clone https://github.com/proto-kit/starter-kit my-chain
cd my-chain

# ensures you have the right node.js version
nvm use
pnpm install

Running the sequencer & UI

# starts both UI and sequencer locally
pnpm dev

# starts UI only
pnpm dev -- --filter web
# starts sequencer only
pnpm dev -- --filter chain

Running tests

# run and watch tests for the `chain` package
pnpm run test --filter=chain -- --watchAll

Navigate to localhost:3000 to see the example UI, or to localhost:8080/graphql to see the GQL interface of the locally running sequencer.

protokit-spymaster's People

Contributors

maht0rz avatar shigoto-dev19 avatar turbobot-temp avatar rpanic avatar asimaranov avatar

Stargazers

baturaλp avatar

Watchers

 avatar

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.