Skip to content

Feat: add an endpoint that uses dir-go wasm to generate a proof. - #2

Closed
0xMugen wants to merge 5 commits into
mistcash:mainfrom
0xMugen:main
Closed

Feat: add an endpoint that uses dir-go wasm to generate a proof. #2
0xMugen wants to merge 5 commits into
mistcash:mainfrom
0xMugen:main

Conversation

@0xMugen

@0xMugen 0xMugen commented Jan 10, 2026

Copy link
Copy Markdown

This pull request introduces a new Go-based Groth16 proof generation feature for the SDK, including a custom React hook, integration and unit tests, development environment setup, and workspace configuration. The most important changes are grouped below by theme:

Go Proof Generation Feature

  • Added the useGoProof React hook in react/src/useGoProof.ts, which loads a Go WASM prover, exposes a generateProof function, and manages prover state. This includes TypeScript interfaces for Groth16 proof structures and witness data. ([react/src/useGoProof.tsR1-R133](https://github.com/mistcash/sdk/pull/2/files#diff-1a693f65e9b66cd69559a4aaf723f5e598f28a56b022d43320c64292f4158989R1-R133))
  • Exported the new useGoProof hook from react/src/index.ts for use in external projects. ([react/src/index.tsR2](https://github.com/mistcash/sdk/pull/2/files#diff-16ffa9feb0208f3a8b311e206274cc227173b52477e6bc8fda8c011c814cd613R2))

Testing

  • Added a comprehensive integration test in react/tests/useGoProof.integration.test.js to validate real Groth16 proof generation using actual WASM and witness data. ([react/tests/useGoProof.integration.test.jsR1-R111](https://github.com/mistcash/sdk/pull/2/files#diff-55c78bee1b107d5e43ee712e1e89886297c9dd60147455c3e0af94b1bde75479R1-R111))
  • Added a unit test suite in react/tests/useGoProof.test.tsx to mock and verify the behavior of the useGoProof hook, including error handling and state management. ([react/tests/useGoProof.test.tsxR1-R156](https://github.com/mistcash/sdk/pull/2/files#diff-a5796c69730677357dd399b64bee9d1b216170b4fad60f3d9ca88abb51d142aeR1-R156))

Development Environment & Workspace

  • Introduced flake.nix to provide a reproducible Nix-based development environment with Node.js and pnpm for the SDK. ([flake.nixR1-R24](https://github.com/mistcash/sdk/pull/2/files#diff-206b9ce276ab5971a2489d75eb1b12999d4bf3843b7988cbe8d687cfde61dea0R1-R24))

Nix is niec of dependency management.

Testing Configuration

  • Updated jest configuration. Tbh this is the only way I could get the testing to work. I'm not familiar with jest

@shramee

shramee commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

Closing in favor of #3

@shramee shramee closed this Jan 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants