-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Request: Compile ord as a WASM Binary for Enhanced Integration and Performance #4099
Comments
The
|
Got it, should I close the issue then? |
It is actually a very good idea, played around with it but you don't want the entire Ord to be wasm binary but rather Ordinals and Runestone lib. The major blocker is the bitcoin lib which depends on native libraries and does not play well at all with wasm. Runestone lib can be compiled to wasm quite easy when you remove bitcoin::Transaction from the interface(eg. decipher). |
My use case for this started with the ord decode command. I wanted to decode transactions within my GoLang code, but the easiest solution I found was to use the binary. However, this approach requires spawning a child process, which consumes more resources compared to having the functionality as a WASM module. I also considered using the ord server and sending requests to it, but that introduces network I/O overhead, which I’d prefer to avoid. To clarify, I wasn’t suggesting converting the entire ord binary to WASM. My focus was more on static methods that don’t rely on internet connections, such as decoding, parsing, and similar operations. |
Hello ord team,
I appreciate the work you’ve done on ord and its capabilities in decoding transactions and handling Bitcoin data efficiently. As ord is written in Rust, I’d like to propose an enhancement: providing precompiled WASM binaries as part of the releases.
Compiling ord to WebAssembly (e.g., using tools like wasm-pack) would significantly improve its usability and performance when integrated into other applications. Instead of spawning ord as a separate process, applications could directly invoke its functionality through a WASM runtime. This approach could drastically reduce the overhead of inter-process communication and streamline error handling, ultimately enhancing the speed of applications built around ord.
I believe this change could greatly benefit developers who rely on ord as part of larger systems, such as mine. For reference, similar optimizations have been achieved by integrating Rust-based libraries as WASM, as described in this blog: Add Some Rust to Your Old Node.js Server and My Service Performance Soared by Nearly 80%.
Would the team be open to exploring this idea? I’d be happy to assist with testing or provide more context on how this could benefit users.
Thank you for considering this suggestion!
The text was updated successfully, but these errors were encountered: