An open API service indexing awesome lists of open source software.

https://github.com/ringsnetwork/rings-proof-demo

This repo contains the demo of Rings WASM SNARK, which is based on Nova, Rings SNARK, and can running inside browser based p2p network (Rings Network). This repo shows detail about how Rings Node and Rings SNARK works.
https://github.com/ringsnetwork/rings-proof-demo

Last synced: 12 months ago
JSON representation

This repo contains the demo of Rings WASM SNARK, which is based on Nova, Rings SNARK, and can running inside browser based p2p network (Rings Network). This repo shows detail about how Rings Node and Rings SNARK works.

Awesome Lists containing this project

README

          


Rings Network

# Rings WASM SNARK
==================

This repo contains the demo of Rings WASM SNARK, which is based on Nova, Rings SNARK, and can running inside browser based p2p network (Rings Network).

This repo shows detail about how Rings Node and Rings SNARK works.

### Screenshot

![Snark workflow](https://raw.githubusercontent.com/RingsNetwork/asserts/main/imgs/snark_demo.png)

### TL;DR

Rings SNARK is a SNARK proof system based on NOVA. It automates the process of transferring circuits written in `circom` language to the [bellpepper proof system](https://github.com/lurk-lab/bellpepper) used by Rings SNARK. Additionally, it leverages Nova for folding operations. This is beneficial for breaking down large zkSNARK computations and enabling parallel processing.

### Workflow

The following diagram illustrates the core logic of Rings SNARK. The top side represents the input from `circom`, including the compiled r1cs and wasm. The right side shows the circuit's input, including public and private input.

![Snark workflow](https://raw.githubusercontent.com/RingsNetwork/asserts/main/imgs/snark.png)

#### WASM Reader

Rings SNARK includes a loader module for [Circom](https://github.com/iden3/circom) Witness Calculator (Wasm). It uses wasmer for reading wasm and transforms it into a Circuit compatible with Nova standards.

#### RICS Loader

Rings SNARK can read r1cs generated by circom and convert them to the [bell pepper proof system](https://github.com/lurk-lab/bellpepper). This is based on the work of [Circom-Scotia](https://github.com/lurk-lab/circom-scotia) and further adds support for browsers.

#### Nova Folder

Through Nova, Rings SNARK performs folding computations on circuits. A set of recursive circuits can be folded into two Relax R1CS-based circuits. This allows Rings SNARK to arbitrarily split the circuit list and distribute it across nodes via the Rings Network.

#### Recursive SNARK

Rings SNARK supports most recursive circuits. It requires that the number of inputs and outputs in a circuit be equal. The output from one step becomes the input for the next, thus creating a recursive process. For circuits not originally designed for recursive SNARK, simple modifications may be necessary. For instance, auxiliary variables can be used to make inputs and outputs recursive, or internal loops can be rewritten as recursive structures. For more details, refer to the merkle tree example in the examples section.

## Build

First, run the development server:

```bash
npm run dev
# or
yarn dev
# or
pnpm dev
# or
bun dev
```

Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.