https://github.com/demosglok/pyodide https://github.com/demosglok/nucypher_webassembly
When developing browser extension or other browser-side stuff for interacting with nucypher networks, you’ll need private keys for accounts, which for now can only be generated in python. So you’ll need host process, running on the client computer. While it is possible to convince users to install additional software for that, it’ll make additional complexities and friction. I wanted to investigate possibility to run python and all nucypher stuff solely in browser. Especially having cpython being compiled to webassembly. So i used most advanced toolset for now which have implemented python in webassembly. This is iodide project and its part “pyodide” which aims to run scientific tools for AI in webassembly. I took pyumbral as basic block to run it in browser first, and build it together with all dependencies into webassembly. With help of luck and some black C++ magic i managed to load all python code into my browser (try firefox , it has better support for webassembly). However it appeared that my kung-fu and my blackmagic isn’t strong enough, as one dependency is still missing and can’t be built into webassembly because uses asm code besides c++ code. So for now project is more like a demo and proof of concept, you can run it and see python working, but key generation is not asking some symbols from libffi. I envision its possible to rewrite this asm part in c/c++ or skip totally and use some alternative c/c++ only approach. but this will require some patching of umbral code or underlying libraries code (cffi, cryptography, openssl) and i didn’t manage to do this before deadline
sorry for naming, i was in terrible rush sending project in last minutes