Open AtHeartEngineer opened 1 year ago
cloc src/javascript
29 text files.
classified 29 files
29 unique files.
0 files ignored.
Doesn't look "too" huge. But the 2 wasm deps don't have typings either. Would that need to be typed too? Or does anyone know alternative libraries?
- wasmbuilder
61 text files.
classified 59 files
59 unique files.
4 files ignored.
- wasmcurves
20 text files.
classified 19 files
19 unique files.
4 files ignored.
wasmcurves
contains a list of curves' implementations in WASM. However, the code is actually JS, as WASM operations are passed to JS functions. It might be interesting to create an abstraction of those curves in AssemblyScript (which is more user-friendly), so that anyone can create custom curves (probably very time-consuming though).
Or, if any Rust implementation to build custom curves/fields exists (e.g. arkworks ?), we could easily convert that crate to a WASM/JS package and re-write the remaining ffjavascript code in TS. The algebra should be the most difficult part.
Idea Proposal
FFJavascript rewrite
Short Description
Rewrite the ffjavascript library to be more flexible (change more of the finite field parameters) and to have better typing.
Problem Statement
The current ffjavascript library has some limitations, such as depending on web-workers which makes browser extension development difficult, and not being able to create custom fields/curves.
Solution
Fork ffjavascript, refactor with better typing, optional web-worker, and the ability to use custom curves/fields.
Key Stakeholders
@wanseob
Benefits
More flexibility and easier use of ffjavascript
Project Timeline
TBD
Project MVP
Adding Typescript types. Converting code base to typescript. Changing the build system from
rollup
towebpack
to build with typescript. Compiling tocommonjs
andesmodule
.Nice to haves
Compiling with and without web-worker Adding ability to use custom fields.
Tech Stack
Node / Typescript / Webpack