{"id":29068878,"url":"https://github.com/aspectron/secp256k1-wasm","last_synced_at":"2025-06-27T11:09:33.242Z","repository":{"id":40608398,"uuid":"309850141","full_name":"aspectron/secp256k1-wasm","owner":"aspectron","description":"WebAssembly build of the official secp256k1 library","archived":false,"fork":false,"pushed_at":"2021-06-03T01:28:24.000Z","size":3023,"stargazers_count":5,"open_issues_count":1,"forks_count":1,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-05-23T10:36:54.372Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aspectron.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-11-04T01:29:34.000Z","updated_at":"2025-01-10T23:14:42.000Z","dependencies_parsed_at":"2022-09-20T12:03:05.106Z","dependency_job_id":null,"html_url":"https://github.com/aspectron/secp256k1-wasm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/aspectron/secp256k1-wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fsecp256k1-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fsecp256k1-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fsecp256k1-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fsecp256k1-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aspectron","download_url":"https://codeload.github.com/aspectron/secp256k1-wasm/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aspectron%2Fsecp256k1-wasm/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262244912,"owners_count":23281029,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-27T11:09:32.760Z","updated_at":"2025-06-27T11:09:33.231Z","avatar_url":"https://github.com/aspectron.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"secp256k1-wasm\r\n==============\r\n\r\nEMCC+LLVM WebAssembly bindings for [libsecp256k1 ](https://github.com/bitcoin-core/secp256k1)\r\n\r\nThis project provides Emscripten WASM bindings for libsecp256k1 and provides basic scaffolding to build the native libsecp256k1 C code to WASM using EMCC.\r\n\r\nBuilding secp256k1-wasm\r\n-----------------------\r\n\r\nRepositories you will need to clone:\r\n\r\n    $ git clone https://github.com/aspectron/secp256k1-wasm\r\n    $ git clone https://github.com/WebAssembly/binaryen\r\n    $ git clone https://github.com/llvm/llvm-project\r\n    $ git clone https://github.com/emscripten-core/emscripten\r\n\r\nBuilding Binaryen:\r\n\r\n    $ cd binaryen\r\n    $ cmake .\r\n    $ cmake --build . --config Release -j NNN\r\n    NNN = number of CPU cores/threads\r\n\r\nOverride emscripten src files:\r\n\r\n    $ cp emscripten_override/src/* to emscripten/src/\r\n\r\nThe following process builds LLVM inside the `./emscripten/build` folder:\r\n\r\n    $ cd emscripten\r\n    $ mkdir build\r\n    $ cd build/\r\n    $ cmake ../../llvm-project/llvm -DCMAKE_BUILD_TYPE=Release -DLLVM_ENABLE_PROJECTS='lld;clang' -DLLVM_TARGETS_TO_BUILD=\"host;WebAssembly\" -DLLVM_INCLUDE_EXAMPLES=OFF -DLLVM_INCLUDE_TESTS=OFF\r\n    $ cmake --build . --config Release -j NNN\r\n    NNN = number of CPU cores/threads\r\n    $ cd ..     \r\n    \r\nWe are now back in the Emscripten folder. Generate the default `.emscripten` file:\r\n\r\n    $ ./emcc  -v\r\n\r\nEdit the `.emscripten` file to contain correct paths to LLVM and Binaryen:\r\n\r\n  * point `LLVM_ROOT` to `\u003cpath to emscripten\u003e/build/bin` or `\u003cpath to emscripten\u003e/build/Release/bin` if LLVM was built using Visual C++\r\n  * point `BINARYEN_ROOT` to `\u003cpath to binaryen\u003e`\r\n\r\nRe-run `./emcc -v` to check that everything is ok.  You should now see the version of EMCC, clang and InstalledDir information.\r\n\r\nBuild secp256k1-wasm:\r\n\r\nYou can run `./build` or `build.bat` to build the WASM binaries or execute the following:\r\n\r\n    $ emcc -I ./depend/secp256k1 -I ./depend/secp256k1/src secp256k1-bindings.cpp -o http/secp256k1.html -s EXTRA_EXPORTED_RUNTIME_METHODS=[\"cwrap\"] -std=c++11 --bind -s ALLOW_MEMORY_GROWTH=1 -s IMPORTED_MEMORY\r\n\r\nTo test the build, you will require an installed version of NodeJs. From within the `secp256k1-wasm` folder please run the following:\r\n\r\nusing python SimpleHTTPServer:\r\n\r\n    $ python -m SimpleHTTPServer 8000\r\n\r\nusing nodejs:\r\n\r\n    $ npm install\r\n    $ node test/node-server\r\n\r\nYou should now be able to access the emscripten environment with secp256k1 loaded at http://localhost:3000\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspectron%2Fsecp256k1-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faspectron%2Fsecp256k1-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faspectron%2Fsecp256k1-wasm/lists"}