groth16 property

BuGroth16Api get groth16

Groth16 proof verification (BLS12-381 + BN254, e.g. Sui zkLogin).

Rust backend only (FFI on the VM, WASM in the browser): there is no pure-Dart pairing implementation. Throws BuError unless a native backend was selected via setRustApi.

Implementation

BuGroth16Api get groth16 {
  final bu = _backend;
  if (bu == null) {
    throw BuError(
      DefaultErrorType.unsupported,
      'Groth16 needs the Rust backend: call '
      'blockchainUtils.setRustApi() (VM: BU_BACKEND=ffi, browser: wasm) '
      'before verifying proofs.',
    );
  }
  return bu.groth16;
}