14 releases

0.9.0 Feb 10, 2021
0.8.0 Sep 22, 2020
0.8.0-rc5 Jul 24, 2020
0.8.0-alpha.5 Mar 24, 2020

#9 in #instantiate

Download history 114/week @ 2024-07-21 144/week @ 2024-07-28 110/week @ 2024-08-04 182/week @ 2024-08-11 107/week @ 2024-08-18 113/week @ 2024-08-25 104/week @ 2024-09-01 113/week @ 2024-09-08 105/week @ 2024-09-15 123/week @ 2024-09-22 144/week @ 2024-09-29 18/week @ 2024-10-06 59/week @ 2024-10-13 73/week @ 2024-10-20 102/week @ 2024-10-27 74/week @ 2024-11-03

309 downloads per month

Apache-2.0

31KB
698 lines

This crate provides means to instantiate and execute wasm modules.

It works even when the user of this library executes from inside the wasm VM. In this case the same VM is used for execution of both the sandbox owner and the sandboxed module, without compromising security and without the performance penalty of full wasm emulation inside wasm.

This is achieved by using bindings to the wasm VM, which are published by the host API. This API is thin and consists of only a handful functions. It contains functions for instantiating modules and executing them, but doesn't contain functions for inspecting the module structure. The user of this library is supposed to read the wasm module.

When this crate is used in the std environment all these functions are implemented by directly calling the wasm VM.

Examples of possible use-cases for this library are not limited to the following:

  • implementing smart-contract runtimes that use wasm for contract code
  • executing a wasm substrate runtime inside of a wasm parachain

License: Apache-2.0

Dependencies

~5–14MB
~195K SLoC