Files
erhant 98725e6946 example: Bun + SHA256 (#102)
* added bun example

* add cmdline docs

* added witness test

* add path check to workflows
2024-10-25 22:48:53 +03:00
..
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00
2024-10-25 22:48:53 +03:00

Circomkit with Bun

In this example, we use Bun with the SHA256 circuit.

Installation

Simply do:

bun install

Usage

You can see an example within src/index.ts. Run it with:

bun start

For the CLI, you can test the entire flow as follows:

  1. Compile circuit: bunx circomkit compile sha256_32
  2. Prove with default input: bunx circomkit prove sha256_32 default
  3. Verify the proof: bunx circomkit verify sha256_32 default
  4. Create contract: bunx circomkit contract sha256_32
  5. Create calldata: bunx circomkit calldata sha256_32 default

Notice that we use bunx instead of npx to use Bun!

Testing

Run tests with:

bun test