Code Monkey home page Code Monkey logo

kzg-ceremony-client's Introduction

KZG Ceremony Client

EIP4844 aka proto-danksharding, utilizes KZG proofs to ensure blob availablility. KZG proofs relies on a trusted setup to generate a Structured Reference String (SRS) that is required during the proof verification phase. The goal is to have as many people contribute their 'randomness' to the trusted setup and as long as one participant has done the setup corrrectly, ie. discard their randonmess (toxic waste), the entire trusted setup is deemed to be safe.

Motivation

Most existing KZG client implementations are written in rust or golang. We wrote a KZG client in C# in hope of providing more language diversity to the existing clients.

Our Approach

We utlize C bindings for blst library to perform our group operations

How to use

Installing and executing

Download the zip file according to your OS and architecutre from the release page.

Unzip your file and in your terminal, test the cli by running:

./kzg --help

You should be seeing something like this:

Description:
  Contribute to Ethereum's KZG Ceremony

Usage:
  kzg [command] [options]

Options:
  --file <file>          File containing randomness
  --url <url>            Url of KZG ceremony sequencer [default: 
                         https://seq.ceremony.ethereum.org]
  --interval <interval>  Polling time interval in ms [default: 30000]
  --version              Show version information
  -?, -h, --help         Show help and usage information

Commands:
  ethereum  Contribute using Ethereum address
  github    Contribute using Github handle

For mac users, you may be prompted a message saying 'Apple cannot check it for malicious software.'. Refer to this by Apple to resolve the issue

Passing in sequencer url

By default. the cli points to https://seq.ceremony.ethereum.org . To change that, you will be able to pass the sequencer url through a flag.

eg.

./kzg github --url https://kzg-ceremony-sequencer-dev.fly.dev

Passing in randomness

By default, the randomness is generated in the cli. Randomness is generated using the RNG in System.Security.Cryptography

To pass in custom randomness, you may use the following command:

./kzg github --file my_randomness.txt

Contributing via Ethereum address or Github

The cli expects an option or either ethereum or github.

To contribute using an Ethereum address:

./kzg ethereum

To contribute using a Github account:

./kzg github

Obtaining sessionId

After selecting your contibution method, you will be prompted a url as such:

Visit this link and enter your session Id below.
https://github.com/login/oauth/authorize?response_type=code&client_id=xxxxxxx&redirect_uri=https%3A%2F%2Fkzg-ceremony-sequencer-dev.fly.dev%2Fauth%2Fcallback%2Fgithub

Copy and paste the link to your browser and authorized the kzg ceremony sequencer to connect to your account. It will then return our a json containing the session Id.

{"id_token":{"exp":18446744073709551615,"nickname":"xxxx","provider":"Github","sub":"git|yyyy|xxxx"},"session_id":"my_session_id"}

Copy and paste the session_id in the cli running the kzg client

Enter Session id: 

my_session_id

Wait, contribute & Success ๐ŸŽ‰

After which, the cli will query the sequencer to wait for our turn to contribute. The polling interval is 30seconds.

If successful, you will see something like:

Waiting for our turn to contribute...
Yes! Our time to contribute!
Updating Powers of Tau
Sending contribution...
Contribution completed 
Contribution written to /Users/contribution.json
ContributionReceipt written to /Users/contributionReceipt.json

You may then check your contribution and contribution receipt in the file path mentioned above.

Congratulation!!

Build from this repo

Ensure you have downloaded the .Net 7.0 Sdk. Git clone this repo and at the root directory, run:

dotnet publish Nethermind.KZGCli/Nethermind.KZGCli.csproj -c Release -o .
# or just
make

An executable file named kzg will appear.

You will then invoke command as such:

./kzg github

kzg-ceremony-client's People

Contributors

chee-chyuan avatar flcl42 avatar jmederosalvarado avatar

Stargazers

Ravikant avatar

Watchers

Ravikant 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.