@tokamak-zk-evm/synthesizer-web
v2.1.2
Published
Browser-facing Tokamak zk-EVM synthesizer package with bundled subcircuit library assets.
Readme
Tokamak zk-EVM Synthesizer Web App
@tokamak-zk-evm/synthesizer-web is the browser-facing package for running the Tokamak zk-EVM synthesizer from uploaded files or application-provided payload objects.
When to use this package
Use @tokamak-zk-evm/synthesizer-web when you need a browser-facing synthesis API that accepts payload objects or uploaded files and uses bundled subcircuit-library assets at runtime.
Install
npm install @tokamak-zk-evm/synthesizer-webRuntime Model
- The published build bundles the subcircuit library JSON and WASM artifacts at build time.
- Callers only provide the transaction/state/block/code payload.
- No extra subcircuit fetch or file upload step is required at runtime.
Quick start
import { loadSynthesisInputFromFiles, saveSynthesisOutputToFiles, synthesize } from '@tokamak-zk-evm/synthesizer-web';
const payload = await loadSynthesisInputFromFiles({
previousState,
transaction,
blockInfo,
contractCodes,
});
const output = await synthesize(payload);
saveSynthesisOutputToFiles(output);Pass { outputSupplement: true } to include supplementary analysis outputs:
saveSynthesisOutputToFiles(output, { outputSupplement: true });
await postSynthesisOutput(url, output, undefined, { outputSupplement: true });Input Shape
synthesize(input) expects one transaction payload with:
previousStatetransactionblockInfocontractCodes
The package also provides:
loadSynthesisInputFromFiles(...)loadSynthesisInputFromUrls(...)saveSynthesisOutputToFiles(...)postSynthesisOutput(...)
Output helpers expose primary outputs by default. Supplementary outputs use logical keys such as supplement/step_log.json and supplement/placements.json when { outputSupplement: true } is provided.
Transaction Support
This package uses the shared Synthesizer transaction-support boundary. It is not limited to simple token or native transfers, but contract-call support depends on whether execution stays within the opcode set, call flows, storage/memory/log handling, and runtime model currently supported by Tokamak zk-EVM.
For the full consumer-facing answer, see the workspace transaction support FAQ.
Notes
- Build-time dependency metadata is exported as
buildMetadata. - The same metadata is also written to
build-metadata.jsonin the published package root. buildMetadata.dependencies.subcircuitLibrary.buildVersionandbuildMetadata.dependencies.tokamakL2js.buildVersionrecord the exact versions bundled into the published web package.- This package targets browser-style runtimes and ESM consumption.
- Node CLI usage belongs to
@tokamak-zk-evm/synthesizer-node. - Workspace overview: ../README.md
- Repository changelog: https://github.com/tokamak-network/Tokamak-zk-EVM/blob/main/CHANGELOG.md
