Skip to content

Conversation

@querolita
Copy link
Member

@querolita querolita commented Jan 23, 2026

CHANGES

  • plonk_wasm is now kimchi_wasm. This affects bindings files as well.
  • plonk_napi is now kimchi_napi.
  • moved napi conversion files onto a native folder inside bindings
  • created napi-ffi.ts with common helpers to improve readability of the conversion layer, and add type safety. Examples are asArrayLike, arrayFrom and constructors for classes expected on the rust side.
  • whenever both wasm and napi types are involved in a file (such as bindings.ts), we reimport the types and alias them prefixing with either wasm or napi to improve understanding
  • created napi-wrappers.ts as a workaround that redefines the types coming from Napi in a TS-friendly syntax to enable type safety at compile time. That is, this prevents us from using as any and unknown in several locations of the conversion code, as opposed to what we had earlier. If there's a cleaner way to achieve this please do share in the comments, I would love to hear.
  • moved specific types to napi-wrappers.ts to centralize where the conversion types are defined to avoid verbosity in the core/proof/verifier-index/oracles files.
  • deleted unnecessary indirections that were used before while debugging other features in the PoC such as toNodeBuffer
  • deleted try-catch blocks that were added while debugging, also unused runInTryCatch
  • used ? syntax more extensively to define or access optional fields
  • unified tsBindings to contain a single rustConversion and srs elements that get instantiated differently at runtime using the function getConversionBundle
  • for convenience, created a backend type to differentiate at runtime whether it is wasm or napi while keeping type safety at compilation time. This one relies on the global variables defined in node_backend.js on the mina repo.
  • some functions in bindings.ts to facilitate the logic such as getKimchiBackend
  • created a type RustConversion that depends on a generic BackendKind. This is used to determine what conversion type must be used
  • unified output format of both buildWasmRustConversion and buildNapiRustConversion functions in case we want to further unify the wasm and napi conversion cores in the future
  • The conversion bundle returns all the information that could be relevant for the conversion layer, adapted to a specific backend: that is, the actual backend kind, the whole rust namespace obtained from the bindings (whether wasm-styled or napi-styled at runtime), a specific conversion mechanism, and the specific srs type.

Partially addresses #2710 and #2711

o1js: #2741
mina: MinaProtocol/mina#18354
proof-systems: o1-labs/proof-systems#3447

@querolita querolita marked this pull request as ready for review February 2, 2026 15:11
@querolita querolita requested review from a team as code owners February 2, 2026 15:11
@querolita querolita requested review from Shigoto-dev19 and ymekuria and removed request for a team February 2, 2026 15:11
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