We want bb.js to expose a unified interface that delegates to either wasm or native, depending on the context (web vs node). The updated bb.js should also provide the CLI entrypoint for proving and verifying during Noir development, replacing native bb, and provide a simplifying interface similar to that of noir-js-backend-barretenberg.
Benefits:
Iterate the CLI on bb.js instead of cpp
Provide an easier unified programmatic interface to clients
Consolidate code currently spread across bb.js, noir-js-backend-bb, and aztec's bb-prover
Transparently change how we communicate with native bb by keeping it hidden behind bb.js (we can go from calling the native CLI into calling a long-running process via a nicer binary interface)
Simplify the installation process for the user (downloading the native extension would be handled by the npm package)
This will involve first defining the shared interface, and then move code out of noir-js-backend-bb and bb-prover to implement it. The shared interface will be a coarse one to correspond to the one exposed by the native CLI. We can later make it more fine-grained when we replace the native CLI as a means to communicate from bb.js to native bb, but since the native bb CLI is stateless, we want to run operations in bulk as much as we can for now.
We want bb.js to expose a unified interface that delegates to either wasm or native, depending on the context (web vs node). The updated bb.js should also provide the CLI entrypoint for proving and verifying during Noir development, replacing native bb, and provide a simplifying interface similar to that of noir-js-backend-barretenberg.
Benefits:
This will involve first defining the shared interface, and then move code out of noir-js-backend-bb and bb-prover to implement it. The shared interface will be a coarse one to correspond to the one exposed by the native CLI. We can later make it more fine-grained when we replace the native CLI as a means to communicate from bb.js to native bb, but since the native bb CLI is stateless, we want to run operations in bulk as much as we can for now.
See this hackmd for initial discussions.