Coder Social home page Coder Social logo

microbecode / noname Goto Github PK

View Code? Open in Web Editor NEW

This project forked from zksecurity/noname

0.0 0.0 0.0 1.89 MB

Noname: a programming language to write zkapps

Home Page: https://zksecurity.github.io/noname/

JavaScript 6.42% Rust 58.49% CSS 6.26% HTML 28.82%

noname's Introduction

Screenshot 2024-07-17 at 2 14 40 PM

Noname is a high-level programming language inspired by Rust and Golang to write zero-knowledge applications. The language can support multiple constraint systems, and currently compiles down to R1CS (for SnarkJS) and Plonk (for kimchi).

fn main(pub public_input: Field, private_input: Field) -> Bool {
    let xx = private_input + public_input;
    assert_eq(xx, 2);
    let yy = xx + 6;
    return yy == 8;
}

Important

Noname is currently in Beta, and there are a large number of known limitations. Please check the issues if you find something that doesn't work, or if you want to start contributing to this project!

You can run the above example with the following command:

$ noname test --path examples/public_output_bool.no --private-inputs '{"private_input": "1"}' --public-inputs '{"public_input": "1"}' --debug

On particularity of noname is the --debug option that shows you how the code relates to the compiled constraints:

Screen Shot 2022-11-11 at 11 01 45 PM

Quick Start

To get started with no strings attached, you can use the Noname Code Playground to write and run your code in the browser. Alternatively, you can install the compiler on your system.

You need to install the compiler from source using cargo. You can do this by running the following command:

$ cargo install --git https://www.github.com/zksecurity/noname

Then simply write noname in the console to get access to the CLI. See the Usage section for more information on usage.

$ noname

More Resources

We have a lot of resources to learn and understand how noname works:

Usage

Once noname is installed on your system, use noname new to create a project in a new directory, or noname init to initialize an existing directory. For example:

$ noname new --path my_project

This will create a Noname.toml manifest file, which contains the name of your project (which must follow a Github user/repo format) as well as dependencies you're using (following the same format, as they are retrieved from Github).

This will also create a src directory, which contains a main.no file, which is the entry point of your program. If you want to create a library, pass the --lib flag to the new or init command of noname, and it will create a lib.no file instead.

$ tree
.
├── Noname.toml
└── src
    └── main.no

You can then use the following command to check the correctness of your code (and its dependencies):

$ noname check

or you can test a full run with:

$ noname test

which will attempt to create a proof and verify it. See the examples section to see how to use it.

noname's People

Contributors

mimoo avatar katat avatar eightfilms avatar prabhat1308 avatar cristiantroy avatar erhant avatar lognorman20 avatar mohamedelqdusy avatar finiteprods avatar martinondejka avatar binadamu-isiyoonekana avatar dmpierre avatar vuvoth avatar muhtasimtanmoy 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.