{"_id":"@pumpsol/bb","_rev":"3-c946209ec27b1330e680ce391088eea8","name":"@pumpsol/bb","dist-tags":{"latest":"1.0.2"},"versions":{"1.0.0":{"name":"@pumpsol/bb","version":"1.0.0","license":"MIT","_id":"@pumpsol/bb@1.0.0","maintainers":[{"name":"pumpsol","email":"devriki03@gmail.com"}],"bin":{"bb":"dest/node/main.js"},"dist":{"shasum":"dfa41423e8ebf5948c7c7dacde1f0f789d8a00de","tarball":"https://registry.npmjs.org/@pumpsol/bb/-/bb-1.0.0.tgz","fileCount":675,"integrity":"sha512-dcgbfK5kW/pJ4e/RdDpjeK2wjC43M/xBFWarBa2U9vvTxUgxtbfULs2mgA5BhMKTW0PvbNcFcdnKMOvrI8vVuw==","signatures":[{"sig":"MEUCICLe78hGHbXMRyrXWFa6GWFXJa4s2boZgAfGHFaV7aX/AiEAsskJIOTVbEdcR0D3atWWoCW1oG7W0tjJ6owaiiSaFDM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14304267},"jest":{"preset":"ts-jest/presets/default-esm","rootDir":"./src","testRegex":"./src/.*\\.test\\.ts$","transform":{"^.+\\.tsx?$":["@swc/jest",{"jsc":{"parser":{"syntax":"typescript","decorators":true},"transform":{"decoratorVersion":"2022-03"}}}]},"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"extensionsToTreatAsEsm":[".ts"]},"type":"module","types":"./dest/node/index.d.ts","exports":{".":{"browser":"./dest/browser/index.js","default":"./dest/node/index.js","require":"./dest/node-cjs/index.js"}},"gitHead":"f7ae58bc44f6a75c9d828569221fc0602c438f2f","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 generate && yarn build:wasm && yarn build:esm && yarn build:cjs && yarn build:browser","clean":"rm -rf ./dest .tsbuildinfo .tsbuildinfo.cjs ./src/cbind/generated","deploy":"npm publish --access public","generate":"NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 ts-node src/cbind/generate.ts","build:cjs":"tsc -b tsconfig.cjs.json && ./scripts/cjs_postprocess.sh","build:esm":"tsc -b tsconfig.esm.json && chmod +x ./dest/node/main.js","build:wasm":"./scripts/build_wasm.sh","formatting":"prettier --check ./src && eslint --max-warnings 0 ./src","test:debug":"NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules ./node_modules/.bin/jest --no-cache --passWithNoTests --runInBand","simple_test":"NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts","build:browser":"tsc -b tsconfig.browser.json && ./scripts/browser_postprocess.sh","build:bindings":"cd .. && ./scripts/bindgen.sh","formatting:fix":"prettier -w ./src"},"_npmUser":{"name":"pumpsol","email":"devriki03@gmail.com"},"_npmVersion":"11.6.2","description":"Prover/verifier executable and API for barretenberg. Default cli arguments are appropriate for running within Noir project structures.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"pako":"^2.1.0","pino":"^9.5.0","tslib":"^2.4.0","comlink":"^4.4.1","msgpackr":"^1.11.2","commander":"^12.1.0","idb-keyval":"^6.2.1"},"_hasShrinkwrap":false,"packageManager":"yarn@4.5.2","devDependencies":{"jest":"^30.0.0","eslint":"^9.26.0","ts-jest":"^29.4.0","ts-node":"^10.9.1","prettier":"^3.5.3","@swc/core":"^1.10.1","@swc/jest":"^0.2.37","ts-loader":"^9.4.2","typescript":"^5.3.3","@types/jest":"^30.0.0","@types/node":"^22.15.17","@types/pako":"^2.0.3","@jest/globals":"^30.0.0","typescript-eslint":"^8.32.1","@types/detect-node":"^2.0.0","eslint-config-prettier":"^10.1.5","@types/source-map-support":"^0.5.6"},"_npmOperationalInternal":{"tmp":"tmp/bb_1.0.0_1770820902416_0.49817964202619125","host":"s3://npm-registry-packages-npm-production"}},"1.0.1":{"name":"@pumpsol/bb","version":"1.0.1","license":"MIT","_id":"@pumpsol/bb@1.0.1","maintainers":[{"name":"pumpsol","email":"devriki03@gmail.com"}],"bin":{"bb":"dest/node/main.js"},"dist":{"shasum":"2a15fdf23992e9ba0d3b5704f162736e55dae125","tarball":"https://registry.npmjs.org/@pumpsol/bb/-/bb-1.0.1.tgz","fileCount":675,"integrity":"sha512-wruOGXf5/+tJFq/N3JMdR7KWTIEzJWHPQhLmq2o26usHDhrHb0woveIWFgKkVF1nt8ee82G2ReNZZuMvvegMkA==","signatures":[{"sig":"MEUCIQCMWKdAzjh165q3+jH0/JlT8UiQjHxyvoI3426kwnp2KgIgAvztu43CAVQJkCaJlJ9+JBR9DrLc8n7xBdFadpa5rQY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14304275},"jest":{"preset":"ts-jest/presets/default-esm","rootDir":"./src","testRegex":"./src/.*\\.test\\.ts$","transform":{"^.+\\.tsx?$":["@swc/jest",{"jsc":{"parser":{"syntax":"typescript","decorators":true},"transform":{"decoratorVersion":"2022-03"}}}]},"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"extensionsToTreatAsEsm":[".ts"]},"type":"module","types":"./dest/node/index.d.ts","exports":{".":{"browser":"./dest/browser/index.js","default":"./dest/node/index.js","require":"./dest/node-cjs/index.js"}},"gitHead":"7e8d531a978e142390cb3399866a5f868962d7eb","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 generate && yarn build:wasm && yarn build:esm && yarn build:cjs && yarn build:browser","clean":"rm -rf ./dest .tsbuildinfo .tsbuildinfo.cjs ./src/cbind/generated","deploy":"npm publish --access public","generate":"NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 ts-node src/cbind/generate.ts","build:cjs":"tsc -b tsconfig.cjs.json && ./scripts/cjs_postprocess.sh","build:esm":"tsc -b tsconfig.esm.json && chmod +x ./dest/node/main.js","build:wasm":"./scripts/build_wasm.sh","formatting":"prettier --check ./src && eslint --max-warnings 0 ./src","test:debug":"NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules ./node_modules/.bin/jest --no-cache --passWithNoTests --runInBand","simple_test":"NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts","build:browser":"tsc -b tsconfig.browser.json && ./scripts/browser_postprocess.sh","build:bindings":"cd .. && ./scripts/bindgen.sh","formatting:fix":"prettier -w ./src"},"_npmUser":{"name":"pumpsol","email":"devriki03@gmail.com"},"_npmVersion":"11.6.2","description":"Prover/verifier executable and API for barretenberg. Default cli arguments are appropriate for running within Noir project structures.","directories":{},"_nodeVersion":"24.13.0","dependencies":{"pako":"^2.1.0","pino":"^9.5.0","tslib":"^2.4.0","comlink":"^4.4.1","msgpackr":"^1.11.2","commander":"^12.1.0","idb-keyval":"^6.2.1"},"_hasShrinkwrap":false,"packageManager":"yarn@4.5.2","devDependencies":{"jest":"^30.0.0","eslint":"^9.26.0","ts-jest":"^29.4.0","ts-node":"^10.9.1","prettier":"^3.5.3","@swc/core":"^1.10.1","@swc/jest":"^0.2.37","ts-loader":"^9.4.2","typescript":"^5.3.3","@types/jest":"^30.0.0","@types/node":"^22.15.17","@types/pako":"^2.0.3","@jest/globals":"^30.0.0","typescript-eslint":"^8.32.1","@types/detect-node":"^2.0.0","eslint-config-prettier":"^10.1.5","@types/source-map-support":"^0.5.6"},"_npmOperationalInternal":{"tmp":"tmp/bb_1.0.1_1770825928213_0.20329275907066746","host":"s3://npm-registry-packages-npm-production"}},"1.0.2":{"name":"@pumpsol/bb","packageManager":"yarn@4.5.2","version":"1.0.2","license":"MIT","type":"module","types":"./dest/node/index.d.ts","exports":{".":{"require":"./dest/node-cjs/index.js","browser":"./dest/browser/index.js","default":"./dest/node/index.js"}},"bin":{"bb":"dest/node/main.js"},"scripts":{"clean":"rm -rf ./dest .tsbuildinfo .tsbuildinfo.cjs ./src/cbind/generated","build":"yarn clean && yarn generate && yarn build:wasm && yarn build:esm && yarn build:cjs && yarn build:browser","build:wasm":"./scripts/build_wasm.sh","build:esm":"tsc -b tsconfig.esm.json && chmod +x ./dest/node/main.js","build:cjs":"tsc -b tsconfig.cjs.json && ./scripts/cjs_postprocess.sh","build:browser":"tsc -b tsconfig.browser.json && ./scripts/browser_postprocess.sh","build:bindings":"cd .. && ./scripts/bindgen.sh","generate":"NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 ts-node src/cbind/generate.ts","formatting":"prettier --check ./src && eslint --max-warnings 0 ./src","formatting:fix":"prettier -w ./src","test":"NODE_OPTIONS='--loader ts-node/esm' NODE_NO_WARNINGS=1 node --experimental-vm-modules $(yarn bin jest) --no-cache --passWithNoTests","test:debug":"NODE_NO_WARNINGS=1 node --inspect-brk=0.0.0.0 --experimental-vm-modules ./node_modules/.bin/jest --no-cache --passWithNoTests --runInBand","simple_test":"NODE_NO_WARNINGS=1 node ./src/examples/simple.rawtest.ts","deploy":"npm publish --access public"},"jest":{"preset":"ts-jest/presets/default-esm","transform":{"^.+\\.tsx?$":["@swc/jest",{"jsc":{"parser":{"syntax":"typescript","decorators":true},"transform":{"decoratorVersion":"2022-03"}}}]},"moduleNameMapper":{"^(\\.{1,2}/.*)\\.js$":"$1"},"extensionsToTreatAsEsm":[".ts"],"testRegex":"./src/.*\\.test\\.ts$","rootDir":"./src"},"dependencies":{"comlink":"^4.4.1","commander":"^12.1.0","idb-keyval":"^6.2.1","msgpackr":"^1.11.2","pako":"^2.1.0","pino":"^9.5.0","tslib":"^2.4.0"},"devDependencies":{"@jest/globals":"^30.0.0","@swc/core":"^1.10.1","@swc/jest":"^0.2.37","@types/detect-node":"^2.0.0","@types/jest":"^30.0.0","@types/node":"^22.15.17","@types/pako":"^2.0.3","@types/source-map-support":"^0.5.6","eslint":"^9.26.0","eslint-config-prettier":"^10.1.5","jest":"^30.0.0","prettier":"^3.5.3","ts-jest":"^29.4.0","ts-loader":"^9.4.2","ts-node":"^10.9.1","typescript":"^5.3.3","typescript-eslint":"^8.32.1"},"gitHead":"b8c111c241af4d3088779ddf3d71dd27c82df3f7","_id":"@pumpsol/bb@1.0.2","description":"Prover/verifier executable and API for barretenberg. Default cli arguments are appropriate for running within Noir project structures.","_nodeVersion":"24.13.0","_npmVersion":"11.6.2","dist":{"integrity":"sha512-EOnNujohobVVG4X2KOYfHRTfB/bhfLVXG4Xhal8JYh/16j+nvxYJMwobCF0yXaf8YoK0QsIdn/Eurk+0+0jjLA==","shasum":"ed8ada31755793e99b17dc8fd9789dce790d6352","tarball":"https://registry.npmjs.org/@pumpsol/bb/-/bb-1.0.2.tgz","fileCount":675,"unpackedSize":14304392,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCiWE2qfxRJGmRqFmhqZKL9LJ3l0WpHwsPIlYVXrIOkYAIgbcrD6NYb1SeII7g/dGSRXFY5gaMCnJ6aJ7h1q9Xmo/Y="}]},"_npmUser":{"name":"pumpsol","email":"devriki03@gmail.com"},"directories":{},"maintainers":[{"name":"pumpsol","email":"devriki03@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/bb_1.0.2_1770827212323_0.5014467739621005"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-11T14:41:42.243Z","modified":"2026-02-11T16:26:52.986Z","1.0.0":"2026-02-11T14:41:42.949Z","1.0.1":"2026-02-11T16:05:28.674Z","1.0.2":"2026-02-11T16:26:52.870Z"},"license":"MIT","description":"Prover/verifier executable and API for barretenberg. Default cli arguments are appropriate for running within Noir project structures.","maintainers":[{"name":"pumpsol","email":"devriki03@gmail.com"}],"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\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 verification key represented as field 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 */ { 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### Multithreading in browser\n\nMultithreading in bb.js requires [`SharedArrayBuffer`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer) to be enabled. It is only enabled in browsers if COOP and COEP headers are set by the server. Read more [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/SharedArrayBuffer#security_requirements).\n\nYou can configure your server to set these headers for pages that perform proof generation. See [this example project](https://github.com/saleel/gitclaim/blob/main/app/next.config.mjs#L48-L67) that implements multi-threaded browser proving, which contains the below Next.js config:\n\n```typescript\n{\n  ...\n  async headers() {\n    return [\n      {\n        source: '/:path*',\n        headers: [\n          { key: 'Cross-Origin-Embedder-Policy', value: 'require-corp' },\n          { key: 'Cross-Origin-Opener-Policy', value: 'same-origin' },\n        ],\n      },\n    ];\n  },\n}\n```\n\nNote that adding COOP and COEP headers will disable loading of external scripts, which might be required by your application.\n\nYou can enable these headers for specific pages that perform proof generation, but this may be challenging, especially in single-page applications. One workaround is to move the proof generation to a separate page, load it in an invisible iframe within your main application, and then use `postMessage` to communicate between the pages for generating proofs.\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\n## Debugging\n\nGot an unhelpful stack trace in wasm? Run:\n\n```\nNO_STRIP=1 ./script/build_wasm.sh\n```\n\nThis will drop unstripped wasms into the dest folder. Run your test again to get a trace.\n","readmeFilename":"README.md"}