#tetcoin #framework #wasm-module #blockchain #crypto

no-std tp-sandbox

This crate provides means to instantiate and execute wasm modules

Show the crate…

2 releases

0.8.2 Apr 3, 2021
0.8.1 Apr 2, 2021
0.0.0 Mar 13, 2021

#38 in #tetcore

Download history 13/week @ 2024-04-14 18/week @ 2024-04-21 7/week @ 2024-04-28 11/week @ 2024-05-05 14/week @ 2024-05-12 6/week @ 2024-05-19 17/week @ 2024-05-26 10/week @ 2024-06-02 13/week @ 2024-06-09 7/week @ 2024-06-16 13/week @ 2024-06-23 4/week @ 2024-06-30 11/week @ 2024-07-07 20/week @ 2024-07-14 3/week @ 2024-07-21 17/week @ 2024-07-28

51 downloads per month
Used in 9 crates (via noble-contracts)

Apache-2.0

350KB
7K SLoC

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 tetcore runtime inside of a wasm parachain

License: Apache-2.0

Dependencies

~3–12MB
~127K SLoC