...
...
Prototype: https://github.com/soramitsu/iroha2-wasm-prototype
pros | cons |
---|
- Well known and established in Blockchain space (Polkadot, Kusama, other Substrate based networks)
- Well known and developing fast in web programming space
- Officially supported by Rust compiler as a target
- Rust core team is contributing to wasmtime
- It might be required for bridging Substrate based networks
- We have experience in it within our team and teams closely working to us
- Developed by wide community
- Execution can be easily limited with `fuel` (approximate of number of assembly instructions that any script is allowed to execute at most)
| - Requires nightly* for the smart contracts themselves
- Difficult to limit memory further than 3GB in wasmtime (needs more research)
- No Interface Types Support - so it has to be simulated through passing serialized bytes or mapping memory
|
*- Nightly Rust means that some of it its features are unstable and may be removed or changed in the later versions of the language.
Rust - eBPF
Language: Rust
Assembly: eBPF
Runtime: solana_rbpf rbpf
pros | cons |
---|
- Might be faster than alternatives
- Simple low level instruction set (simpler than wasm)
- More mature than wasm and battle tested in linux kernel and in other blockchains
- Developed by wide community
- Officially supported by rust team
- Has static analyzers and it is possible to easily make specific one
- Execution can be easily limited with `fuel` (approximate of number of assembly instructions that any script is allowed to execute at most)
| - Runtime for Rust is supported only by one specific blockchain company
|
Needs more research
Lua
Language: Lua
Runtime: rlua
pros | cons |
---|
- Well established as scripting language for game engines and many other tools
- easily embedded
| - has gc and would be slower than alternatives
|
Needs more research
Rhai
Language: Rhai
Runtime: cutsom custom
pros | cons |
---|
- Minimalist
- Easy interoperability with Rust types at the first glance
- Looks similar to Rust but simpler
- Interpretable (no jit)
| - Developed by small community
|
Needs more research if deemed necessary
...
Risks
Additional Information
Useful links:
https://www.w3.org/TR/wasm-core-1/#control-instructions%E2%91%A0
https://learnxinyminutes.com/docs/wasm/
https://blog.dbrgn.ch/2019/12/24/testing-for-no-std-compatibility/