Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

backend selection in o1js #2090

Open
Trivo25 opened this issue Mar 20, 2025 · 3 comments
Open

backend selection in o1js #2090

Trivo25 opened this issue Mar 20, 2025 · 3 comments

Comments

@Trivo25
Copy link
Member

Trivo25 commented Mar 20, 2025

we should support both the new native backend as well as provide a fallback to the old wasm backend for the nodejs envrionment - tbd on how to do this

a potential solution would be to provide a new o1js package for this purpose (if we package both wasm and the native artefacts we almost double our package size - not good) - something like import { ... } from '@o1js/node-native' and import { ... } from '@o1js/node-wasm'

@mitschabaude
Copy link
Contributor

it might be nicer to create an API where not all of o1js has to be split in two packages, but most of the current TS is still just o1js and the bindings are injected later:

import { setBindings } from 'o1js'
import nativeBindings from '@o1js/native-bindings'
setBindings(nativeBindings);

// normal code uses 'o1js' imports

@mitschabaude
Copy link
Contributor

^ should work because AFAIK there's no state kept on the Rust side initially, at least in beginning

@dfstio
Copy link

dfstio commented Mar 22, 2025

There are many cases when proving is not needed, for example, signature verifications, Poseidon hash calculations, tx building (NOT proving). It would make sense to keep the o1js library small to handle such cases and load big proving backend only if needed.

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

No branches or pull requests

3 participants