PageSourceSearch

https://noir-lang.org/docs/assets/js/efff273b.1a32197c.js

js noir-lang.org collected 2026-10-03 22:50:09 UTC 7,092 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[396],{66770(e,n,r){r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>l,default:()=>h,frontMatter:()=>s,metadata:()=>t,toc:()=>c});const t=JSON.parse('{"id":"getting_started_manually","title":"Getting Started Manually","description":"Create and run your first Noir project manually.","source":"@site/processed-docs/getting_started_manually.md","sourceDirName":".","slug":"/getting_started_manually","permalink":"/docs/dev/getting_started_manually","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/docs/getting_started_manually.md","tags":[],"version":"current","frontMatter":{"title":"Getting Started Manually","description":"Create and run your first Noir project manually."},"sidebar":"sidebar","previous":{"title":"Getting Started with AI","permalink":"/docs/dev/getting_started_with_ai"},"next":{"title":"Installation","permalink":"/docs/dev/installation"}}');var i=r(74848),o=r(28453);const s={title:"Getting Started Manually",description:"Create and run your first Noir project manually."},l=void 0,a={},c=[{value:"Installing Nargo",id:"installing-nargo",level:2},{value:"Creating a project",id:"creating-a-project",level:2},{value:"Executing the project",id:"executing-the-project",level:2},{value:"Proving the execution",id:"proving-the-execution",level:2},{value:"Verifying the proof",id:"verifying-the-proof",level:2}];function d(e){const n={code:"code",em:"em",h2:"h2",li:"li",ol:"ol",p:"p",pre:"pre",...(0,o.R)(),...e.components};return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(n.h2,{id:"installing-nargo",children:"Installing Nargo"}),"\n",(0,i.jsx)(n.p,{children:"The Nargo CLI tool provides you the ability to create, compile, execute and test Noir programs from the terminal."}),"\n",(0,i.jsx)(n.p,{children:"Install Nargo by running this in your terminal:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"curl -L https://raw.githubusercontent.com/noir-lang/noirup/refs/heads/main/install | bash\nnoirup\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This installs ",(0,i.jsx)(n.code,{children:"noirup"}),", the installation script, and runs it to install the latest version of Nargo."]}),"\n",(0,i.jsx)(n.h2,{id:"creating-a-project",children:"Creating a project"}),"\n",(0,i.jsxs)(n.p,{children:["Create a new Noir project named ",(0,i.jsx)(n.em,{children:"hello_world"}),":"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"nargo new hello_world\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This command creates a new ",(0,i.jsx)(n.em,{children:"hello_world"})," project directory, in which contains ",(0,i.jsx)(n.em,{children:"src/main.nr"})," that hosts a simple Noir program asserting ",(0,i.jsx)(n.em,{children:"x"})," does not equal ",(0,i.jsx)(n.em,{children:"y"}),"."]}),"\n",(0,i.jsx)(n.h2,{id:"executing-the-project",children:"Executing the project"}),"\n",(0,i.jsxs)(n.p,{children:["Change directory into your ",(0,i.jsx)(n.em,{children:"hello_world"})," project:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"cd hello_world\n"})}),"\n",(0,i.jsxs)(n.p,{children:["Generate a ",(0,i.jsx)(n.em,{children:"Prover.toml"})," input file for specifying input values:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"nargo check\n"})}),"\n",(0,i.jsxs)(n.p,{children:["This command generates a ",(0,i.jsx)(n.em,{children:"Prover.toml"})," file that hosts input values to be used when executing your Noir program."]}),"\n",(0,i.jsxs)(n.p,{children:["Specify valid values in the ",(0,i.jsx)(n.em,{children:"Prover.toml"})," file, for example:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-toml",children:"x = 1\ny = 2\n"})}),"\n",(0,i.jsx)(n.p,{children:"Then compile and execute your Noir program:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"nargo execute\n"})}),"\n",(0,i.jsx)(n.p,{children:"This command:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Compiles the Noir program into the ",(0,i.jsx)(n.em,{children:"target/hello_world.json"})," circuit, and"]}),"\n",(0,i.jsxs)(n.li,{children:["Executes the Noir program with the specified inputs, and generates the ",(0,i.jsx)(n.em,{children:"target/hello_world.gz"})," witness"]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Both to be used when proving your Noir program."}),"\n",(0,i.jsx)(n.h2,{id:"proving-the-execution",children:"Proving the execution"}),"\n",(0,i.jsx)(n.p,{children:"Noir is designed to be proving backend agnostic, which means you can choose to use different proving backends to prove and verify your Noir programs, hence the corresponding workflows could differ."}),"\n",(0,i.jsxs)(n.p,{children:["Using Barretenberg as an example, first install ",(0,i.jsx)(n.code,{children:"bb"})," its CLI tool:"]}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"curl -L https://raw.githubusercontent.com/AztecProtocol/aztec-packages/refs/heads/next/barretenberg/bbup/install | bash\nbbup\n"})}),"\n",(0,i.jsx)(n.p,{children:"Prove the execution of your Noir program:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"bb prove -b ./target/hello_world.json -w ./target/hello_world.gz --write_vk -o target\n"})}),"\n",(0,i.jsx)(n.p,{children:"This command:"}),"\n",(0,i.jsxs)(n.ol,{children:["\n",(0,i.jsxs)(n.li,{children:["Proves the valid execution of your Noir program and generates the zero-knowledge proof ",(0,i.jsx)(n.em,{children:"target/proof"}),", and"]}),"\n",(0,i.jsxs)(n.li,{children:["Generates the verification key of your Noir program ",(0,i.jsx)(n.em,{children:"target/vk"})]}),"\n"]}),"\n",(0,i.jsx)(n.p,{children:"Both to be used when verifying your proof."}),"\n",(0,i.jsx)(n.h2,{id:"verifying-the-proof",children:"Verifying the proof"}),"\n",(0,i.jsx)(n.p,{children:"Verify your proof:"}),"\n",(0,i.jsx)(n.pre,{children:(0,i.jsx)(n.code,{className:"language-sh",children:"bb verify -p ./target/proof -k ./target/vk\n"})}),"\n",(0,i.jsx)(n.p,{children:"This command verifies validity of the zero-knowledge proof, and returns a success message if valid."}),"\n",(0,i.jsx)(n.p,{children:"In typical workflows, the prover who generates the proof and the verifier who verifies the proof are usually two different parties, where the verifier could verify the validity of the prover's proof without knowing the prover's private inputs, hence zero-knowledge."})]})}function h(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,i.jsx)(n,{...e,children:(0,i.jsx)(d,{...e})}):d(e)}},28453(e,n,r){r.d(n,{R:()=>s,x:()=>l});var t=r(96540);const i={},o=t.createContext(i);function s(e){const n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function l(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(i):e.components||i:s(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.