zkp development
zkp development

Subscribe to strawberry

Subscribe to strawberry
Share Dialog
Share Dialog



Niftyzk tutorials 1
This is the start of the tutorial series on Niftyzk and will go over installation and the basic commands as of NiftyZK 0.1.4 https://github.com/NiftyZk/niftyzk Niftyzk is a scaffolding tool and circom development framework with first class support for CosmWasm. Installation You can find the documentation on the github repository. The project depends on Circom to be installed which depends on Rust. You also need NPM to install niftyzk the CLI.For the circom installation instructions, visit : h...

NiftyZK - Sparse Merkle Trees
The new version of NiftyZK is available, v0.2.0, which contains a long awaited feature, sparse merkle trees (SMT)$ niftyzk --version 0.2.0 The previous implementation of Merkle Trees in NiftyZk were fixed merkle trees which can be used with commit-reveals and EdDSA schemes. The fixed trees allow for inclusion proofs and are always fully populated and never contain zeroes in the leaves. The fixed tree must be computed and updated off-chain and the updated root is created with arbitrary verific...

Niftyzk tutorial 2, The Commit-reveal scheme
This tutorial will contain information about the generated code. this is the continuation of the previous tutorial, niftyzk tutorial 1. You should read that one first. So let’s scaffold a new project using niftyzk init we will select a commit-reveal scheme with poseidon hash and add 2 inputs for tamper proofing, address and amount.$ niftyzk init Setting up your current directory ? What project do you want to scaffold? Commit-Reveal Scheme ? Choose the hashing algorithm to use: poseidon ? Do y...

Niftyzk tutorials 1
This is the start of the tutorial series on Niftyzk and will go over installation and the basic commands as of NiftyZK 0.1.4 https://github.com/NiftyZk/niftyzk Niftyzk is a scaffolding tool and circom development framework with first class support for CosmWasm. Installation You can find the documentation on the github repository. The project depends on Circom to be installed which depends on Rust. You also need NPM to install niftyzk the CLI.For the circom installation instructions, visit : h...

NiftyZK - Sparse Merkle Trees
The new version of NiftyZK is available, v0.2.0, which contains a long awaited feature, sparse merkle trees (SMT)$ niftyzk --version 0.2.0 The previous implementation of Merkle Trees in NiftyZk were fixed merkle trees which can be used with commit-reveals and EdDSA schemes. The fixed trees allow for inclusion proofs and are always fully populated and never contain zeroes in the leaves. The fixed tree must be computed and updated off-chain and the updated root is created with arbitrary verific...

Niftyzk tutorial 2, The Commit-reveal scheme
This tutorial will contain information about the generated code. this is the continuation of the previous tutorial, niftyzk tutorial 1. You should read that one first. So let’s scaffold a new project using niftyzk init we will select a commit-reveal scheme with poseidon hash and add 2 inputs for tamper proofing, address and amount.$ niftyzk init Setting up your current directory ? What project do you want to scaffold? Commit-Reveal Scheme ? Choose the hashing algorithm to use: poseidon ? Do y...
<100 subscribers
<100 subscribers
Niftyzk is a circom development tool and framework that targets CosmWasm ecosystem supporting groth-16 proofs with bn128 curve.
Initialize a new project niftyzk init and select from the available templates, the generated code can be configured based on the verification schemes selected. There is support for Poseidon, Pedersen, MiMC and MiMCSponge hashing functions and additional circuit inputs. Niftyzk generates code instead of cloning a repository, so you get the benefit of configuration.
A library will be generated for you with all functions required to interact with the circuits and merkle tree. The javascript is isomorphic and typed using JSDoc so you can run it in the browser and server without modification and use it with Typescript.
Develop your circom circuits using hot reload. niftyzk devIterative development allows you to debug and update your circuits without recompiling them each time which is time consuming. The circuits are rebuilt and the outputs are asserted. Niftyzk expects the circuit inputs and output asserts defined in an input.js file, which allows you to keep your business logic to generate inputs neat and fully tested during development.
The powers of tau ceremony is essential for zero knowledge proof circuits for security. niftyzk ptaufilesThe phase 1 ceremony is reusable hence we can use the Polygon Hermez ceremony files. The files are available to download from the CLI with a simple command
niftyzk compile uses circom compiler for compilation and so depends on Rust and requires circom to be installed. It wraps and abstracts away complex commands and makes compiling straight forward
The compiled circuits require the exporting of verification keys, these keys are used for testing in deployment. niftyzk vkey
The built in ceremony server allows you to host a phase-2 ceremony.Invoking the command niftyzk ceremony will start up a server that hosts a contribution page.The contribution is anonymous and the contributors are queued using websockets. The project at this stage can be deployed on a VPS using Git and the ceremony can be hosted there.The ceremony server only supports smaller PTAU files due to the netwoking, each client needs to download it to make a contribution.Only a single contributor to the phase-2 ceremony needs to be honest for the process to work.
After the ceremony we can finalize the circuit, this means we can’t update our circuits anymore and it will be ready for deployment. niftyzk finalize expects a --beacon argument which is our random beacon used for finalization. The process wraps snarkjs and simplifies the commands used there. If you want to learn more about it, you can read the snarkjs documentation. After finalization, you will need to export a new vkey
And finally we can generate a CosmWasm verifier contract for the circuit. niftyzk gencontact You can generate it before finalization for testing your smart contracts, it requires passing unit tests and the verification key to generate the contract.The gencontract command expects an argument for the Rust library used, which can be Arkworks or Bellman. The Bellman requires an adapter which will be generated in javascript for you.Check the readme for verifying cosmwasm contracts.
All generated code contains full test coverage, including the CosmWasm contracts. Niftyzk supports test based development and runtime assertions.
You can support this project by using it. Open a issue if you encounter any errors. This is a public good and available for quadratic funding in the Atom Economic Zone, you can contribute Atom on dorahacks
https://dorahacks.io/buidl/14323
Niftyzk is a circom development tool and framework that targets CosmWasm ecosystem supporting groth-16 proofs with bn128 curve.
Initialize a new project niftyzk init and select from the available templates, the generated code can be configured based on the verification schemes selected. There is support for Poseidon, Pedersen, MiMC and MiMCSponge hashing functions and additional circuit inputs. Niftyzk generates code instead of cloning a repository, so you get the benefit of configuration.
A library will be generated for you with all functions required to interact with the circuits and merkle tree. The javascript is isomorphic and typed using JSDoc so you can run it in the browser and server without modification and use it with Typescript.
Develop your circom circuits using hot reload. niftyzk devIterative development allows you to debug and update your circuits without recompiling them each time which is time consuming. The circuits are rebuilt and the outputs are asserted. Niftyzk expects the circuit inputs and output asserts defined in an input.js file, which allows you to keep your business logic to generate inputs neat and fully tested during development.
The powers of tau ceremony is essential for zero knowledge proof circuits for security. niftyzk ptaufilesThe phase 1 ceremony is reusable hence we can use the Polygon Hermez ceremony files. The files are available to download from the CLI with a simple command
niftyzk compile uses circom compiler for compilation and so depends on Rust and requires circom to be installed. It wraps and abstracts away complex commands and makes compiling straight forward
The compiled circuits require the exporting of verification keys, these keys are used for testing in deployment. niftyzk vkey
The built in ceremony server allows you to host a phase-2 ceremony.Invoking the command niftyzk ceremony will start up a server that hosts a contribution page.The contribution is anonymous and the contributors are queued using websockets. The project at this stage can be deployed on a VPS using Git and the ceremony can be hosted there.The ceremony server only supports smaller PTAU files due to the netwoking, each client needs to download it to make a contribution.Only a single contributor to the phase-2 ceremony needs to be honest for the process to work.
After the ceremony we can finalize the circuit, this means we can’t update our circuits anymore and it will be ready for deployment. niftyzk finalize expects a --beacon argument which is our random beacon used for finalization. The process wraps snarkjs and simplifies the commands used there. If you want to learn more about it, you can read the snarkjs documentation. After finalization, you will need to export a new vkey
And finally we can generate a CosmWasm verifier contract for the circuit. niftyzk gencontact You can generate it before finalization for testing your smart contracts, it requires passing unit tests and the verification key to generate the contract.The gencontract command expects an argument for the Rust library used, which can be Arkworks or Bellman. The Bellman requires an adapter which will be generated in javascript for you.Check the readme for verifying cosmwasm contracts.
All generated code contains full test coverage, including the CosmWasm contracts. Niftyzk supports test based development and runtime assertions.
You can support this project by using it. Open a issue if you encounter any errors. This is a public good and available for quadratic funding in the Atom Economic Zone, you can contribute Atom on dorahacks
https://dorahacks.io/buidl/14323
No activity yet