Skip to main content
Version: 2.15.0

setBackend

function setBackend(backend: Backend): void;

Defined in: lib/backend.ts:34

Set the backend to use for cryptographic operations such as proving.

Must be called before initializeBindings(). The default backend is 'wasm'.

Note: In browser environments, only the 'wasm' backend is available. Attempting to set the backend to 'native' in such environments will result in a no-op with a console warning.

Parameters

backend

Backend

Returns

void

Example

import { setBackend, initializeBindings } from 'o1js';

setBackend('native');

// must be called after setBackend, most of the o1js functions do this internally
await initializeBindings();