Write a Rust crate to enable WebAssembly function pass through complex data structure as parameters and result

[Updated in Apr 2022] This article is obsoleted. Please click the following links for the detail

I am working on a small Proof of Concept on my confidential computing / trusted computing idea. You can read my previous blog posts to get the basic idea. WebAssemly is one of the most important parts of my solution. Due to its high security and isolation, I would like to run crucial logic inside a Wasm module. However, due to the limitation of the data types (i32, i64, f32, f64) and single return value, it makes almost impossible to write any useful logic.

WASI is the “official” solution on this kind of issues, the team even released a demo in Dec 2019 with a String type support. However, they withdraw this feature later due to some reason. I know they will put it back something soon, but I cannot just let my project wait. So I decided to make something on my own. Given I am a newbie of Rust and WASM, the best way to learn is to make something out of it, especially something I (and other developers) may…

--

--