Files
nym/clients/webassembly
Dave Hrycyszyn 8baa236d81 Feature/wasm js demo (#191)
* Moved `nym-sphinx-wasm` into `wasm` folder and renamed its examples

* A proposal for some structural cleanup

* desktop client: beginning of a Rust example for chunking.

* Simplifying desktop client readme

* Tarting up webassembly README

* A more visual webassembly client example

* clients/webassembly: grouping a few things into named functions for clarity

* clients/webassembly: put URLs at top of file, prepping for drop-down action

* mixnode + provider run: changed startup error messages a bit

* clients/webassembly: scrolling from the bottom in the demo
2020-04-21 10:05:38 +01:00
..
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00
2020-04-21 10:05:38 +01:00

Nym Sphinx in WebAssembly

This is a Rust crate which is set up to automatically cross-compile the contents of lib.rs to WebAssembly (aka wasm).

Wasm is pretty close to bare metal. Browser-based or server-side JavaScript (or other wasm-using environments) can use the wasm output from this crate to create Sphinx packets at much higher speeds than would be possible using (interpreted) JavaScript. This enables browser-based and mobile applications get stronger privacy, in a way that wasn't previously possible.

Compiling

First, make sure you've got all the Rust wasm toolchain installed. Cross-compilation sounds scary but the Rust crew have enabled a remarkably simple setup.

Using it as a JavaScripter

See our docs.

Demo

There's a demo web application in the www folder. To run it, first make sure you've got a recent npm installed, then follow the instructions in its README.

Developing

Whenever you change your Rust, run wasm-pack build to update the built was artefact in the pkg directory.