{"_id":"@demox-labs/aztec-bb.js","_rev":"7-1cc4175386478a103da622022da06566","name":"@demox-labs/aztec-bb.js","dist-tags":{"latest":"0.12.0"},"versions":{"0.12.0":{"name":"@demox-labs/aztec-bb.js","version":"0.12.0","license":"MIT","_id":"@demox-labs/aztec-bb.js@0.12.0","maintainers":[{"name":"fulltimemike","email":"mike@demoxlabs.xyz"},{"name":"evanmars","email":"evan@demoxlabs.xyz"}],"homepage":"https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg/ts","bin":{"aztec-bb.js":"dest/node/main.js"},"dist":{"shasum":"a9d1d00264a508fff37a820a9f6e41dd8c027732","tarball":"https://registry.npmjs.org/@demox-labs/aztec-bb.js/-/aztec-bb.js-0.12.0.tgz","fileCount":525,"integrity":"sha512-Zc6tvEje4wmfr6o/uLPPxjnMFHByyJr7fVG6buhIY3ldpTZ4W+coji9xyZmfUkMFAtqNVPhPxJOOX3RhdcXm+w==","signatures":[{"sig":"MEQCIDFvkfky6Ru/Sqri986kRCeXwT8Ho9Ea4JRQfJsTZQQPAiBTMKhHvYOEVn6E4y5KnXEkFbq+V1FVjpTxi8nsbb6tuA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":14796301},"jest":{"preset":"ts-jest/presets/default-esm","rootDir":"./src","testRegex":"./src/.*\\.test\\.ts$","transform":{"./src/.*\\.ts":["ts-jest",{"useESM":true}]},"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"}},"type":"module","types":"./dest/node-cjs/index.d.ts","exports":{".":{"browser":"./dest/browser/index.js","default":"./dest/node/index.js","require":"./dest/node-cjs/index.js"}},"gitHead":"a87abb99f41c668690b40677ff8f80f525a18d5c","scripts":{"test":"NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests","build":"yarn clean && yarn build:wasm && yarn build:esm && yarn build:cjs && yarn build:browser","clean":"rm -rf ./dest .tsbuildinfo .tsbuildinfo.cjs","deploy":"npm publish --access public","prepack":"yarn build","build:cjs":"tsc -b tsconfig.cjs.json && ./scripts/cjs_postprocess.sh","build:esm":"tsc -b && chmod +x ./dest/node/main.js","build:wasm":"./scripts/build_wasm.sh","formatting":"prettier --check ./src && eslint --max-warnings 0 ./src","test:debug":"NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests --runInBand","simple_test":"NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts","build:browser":"webpack","build:bindings":"cd .. && ./scripts/bindgen.sh","formatting:fix":"prettier -w ./src"},"_npmUser":{"name":"fulltimemike","email":"mike@demoxlabs.xyz"},"_npmVersion":"8.12.1","description":"Prover/verifier executable and API for barretenberg. Default cli arguments are appropriate for running within Noir project structures.","directories":{},"_nodeVersion":"18.4.0","dependencies":{"debug":"^4.3.4","tslib":"^2.4.0","comlink":"^4.4.1","commander":"^10.0.1"},"_hasShrinkwrap":false,"devDependencies":{"jest":"^29.5.0","buffer":"^6.0.3","eslint":"^8.35.0","ts-jest":"^29.1.0","ts-node":"^10.9.1","webpack":"^5.82.1","prettier":"^2.8.4","ts-loader":"^9.4.2","idb-keyval":"^6.2.1","typescript":"^5.0.4","@types/jest":"^29.4.0","@types/node":"^18.7.23","webpack-cli":"^5.1.1","@types/debug":"^4.1.7","@jest/globals":"^29.4.3","worker-loader":"^3.0.8","@types/detect-node":"^2.0.0","webpack-dev-server":"^4.15.0","copy-webpack-plugin":"^11.0.0","html-webpack-plugin":"^5.5.1","eslint-config-prettier":"^8.8.0","@types/source-map-support":"^0.5.6","@typescript-eslint/parser":"^5.54.1","resolve-typescript-plugin":"^2.0.1","@typescript-eslint/eslint-plugin":"^5.54.1"},"_npmOperationalInternal":{"tmp":"tmp/aztec-bb.js_0.12.0_1699393729713_0.11369948676017838","host":"s3://npm-registry-packages"}}},"time":{"created":"2023-11-07T21:48:49.563Z","modified":"2025-11-04T19:41:31.948Z","0.12.0":"2023-11-07T21:48:50.082Z"},"license":"MIT","homepage":"https://github.com/AztecProtocol/aztec-packages/tree/master/barretenberg/ts","description":"Prover/verifier executable and API for barretenberg. Default cli arguments are appropriate for running within Noir project structures.","maintainers":[{"email":"mike@demoxlabs.xyz","name":"fulltimemike"},{"email":"evan@demoxlabs.xyz","name":"evanmars"},{"email":"john@demoxlabs.xyz","name":"johndonavon"},{"email":"dennis@demoxlabs.xyz","name":"dagarcia"},{"email":"kevin@demoxlabs.xyz","name":"krwang4094"},{"email":"julian@demoxlabs.xyz","name":"julian-demox"}],"readme":"# bb.js\n\nProver/verifier executable and API for barretenberg. Default cli arguments are appropriate for running within Noir\nproject structures.\n\n## Performance and limitations\n\nMax circuit size is 2^19 gates (524,288). This is due to the underlying WASM 4GB memory limit. This should improve\nwith future proving systems, and/or introduction of wasm64.\n\nIf running from node, or within browser where you can set shared memory COOP/COEP headers, multithreading is enabled.\nNote there are two independent WASM builds, one with threading enabled and one without. This is because the shared\nmemory flag is set within the WASM itself. If you're running in a context where you can't have shared memory, we want\nto fallback to single threaded performance.\n\nThe following output is from `bench_acir_tests.sh` script.\n\nTable represents time in ms to build circuit and proof for each test on n threads.\nIgnores proving key construction.\n\n```\n+--------------------------+------------+---------------+-----------+-----------+-----------+-----------+-----------+\n| Test                     | Gate Count | Subgroup Size |         1 |         4 |        16 |        32 |        64 |\n+--------------------------+------------+---------------+-----------+-----------+-----------+-----------+-----------+\n| sha256                   | 38799      | 65536         |     18764 |      5116 |      1854 |      1524 |      1635 |\n| ecdsa_secp256k1          | 41049      | 65536         |     19129 |      5595 |      2255 |      2097 |      2166 |\n| ecdsa_secp256r1          | 67331      | 131072        |     38815 |     11257 |      4744 |      3633 |      3702 |\n| schnorr                  | 33740      | 65536         |     18649 |      5244 |      2019 |      1498 |      1702 |\n| double_verify_proof      | 505513     | 524288        |    149652 |     45702 |     20811 |     16979 |     15679 |\n+--------------------------+------------+---------------+-----------+-----------+-----------+-----------+-----------+\n```\n\n## Using as a standalone binary\n\n### Installing\n\nTo install the package globally for running as a terminal application:\n\n```\nnpm install -g @aztec/bb.js\n```\n\nAssuming `$(npm prefix -g)/bin` is in your `PATH`, you can now run the command `bb.js`.\n\n### Usage\n\nRun `bb.js` for further usage information, you'll see e.g.\n\n```\n% bb.js\nUsage: bb.js [options] [command]\n\nOptions:\n  -v, --verbose               enable verbose logging (default: false)\n  -h, --help                  display help for command\n\nCommands:\n  prove_and_verify [options]  Generate a proof and verify it. Process exits with success or failure code.\n  prove [options]             Generate a proof and write it to a file.\n  gates [options]             Print gate count to standard output.\n  verify [options]            Verify a proof. Process exists with success or failure code.\n  contract [options]          Output solidity verification key contract.\n  write_vk [options]          Output verification key.\n  proof_as_fields [options]   Return the proof as fields elements\n  vk_as_fields [options]      Return the verifiation key represented as fields elements. Also return the verification key hash.\n  help [command]              display help for command\n```\n\n## Using as a library\n\n### Installing\n\nTo install as a package to be used as a library:\n\n```\nnpm install @aztec/bb.js\n```\n\nor with yarn\n\n```\nyarn add @aztec/bb.js\n```\n\n### Usage\n\nTo create the API and do a blake2s hash:\n\n```typescript\nimport { Crs, Barretenberg, RawBuffer } from './index.js';\n\nconst api = await Barretenberg.new(/* num_threads */ 1);\nconst input = Buffer.from('hello world!');\nconst result = await api.blake2s(input);\nawait api.destroy();\n```\n\nAll methods are asynchronous. If no threads are specified, will default to number of cores with a maximum of 32.\nIf `1` is specified, fallback to non multi-threaded wasm that doesn't need shared memory.\n\nSee `src/main.ts` for larger example of how to use.\n\n### Browser Context\n\nIt's recommended to use a dynamic import. This allows the developer to pick the time at which the package (several MB\nin size) is loaded and keeps page load times responsive.\n\n```typescript\nconst { Barretenberg, RawBuffer, Crs } = await import('@aztec/bb.js');\n```\n\n## Development\n\nCreate a symlink to the root script `bb.js-dev` in your path. You can now run the current state of the code from\nanywhere in your filesystem with no `yarn build` required.\n\nIf you change the C++ code run `yarn build:wasm` to rebuild the webassembly.\n\nTo run the tests run `yarn test`.\n\nTo run a continuous \"stress test\" run `yarn simple_test` to do 10 full pk/proof/vk iterations. This is useful for\ninspecting memory growth as we continuously use the library.\n","readmeFilename":"README.md"}