2

Does wasmi only function as an interpreter that changes the rust code to wasm?

Wasmi is not related to the function of Polkadot, such as scale codec(encode, decode extrinsics) or signing and signature etc..?

wasmi github : https://github.com/paritytech/wasmi

1 Answer 1

6

wasmi is a Wasm executor that uses interpretation rather than compilation.

Whenever the node software needs to execute some Wasm binary, it needs to use a Wasm executor like wasmi or wasmtime. This can be the Wasm runtime, Wasm smart contracts, or any other Wasm you can think of for your blockchain node (like an offchain worker or in the future SPREE).

Does wasmi only function as an interpreter that changes the rust code to wasm?

No. By the time you use wasmi, it you already have a compiled WebAssembly blob, so wasmi does not see Rust at all. It simply changes Wasm into actual machine code.

Wasmi is not related to the function of Polkadot, such as scale codec (encode, decode extrinsics) or signing and signature etc..?

The Wasm executor is obviously an important part of Substrate and Polkadot, but no, it is not directly related to things like SCALE codec, signing, or anything like that. The project is built independent of a specific blockchain purpose, and is simply a general Wasm executor. You could include this into other projects like a web browser if you wanted.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.