{"id":50300387,"url":"https://github.com/rhodey/lock.host-wasm-js","last_synced_at":"2026-05-28T12:34:04.042Z","repository":{"id":342085560,"uuid":"1164124065","full_name":"rhodey/lock.host-wasm-js","owner":"rhodey","description":"Lock.host WASM JS example","archived":false,"fork":false,"pushed_at":"2026-03-18T21:37:37.000Z","size":122,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-17T17:06:23.934Z","etag":null,"topics":["crypto","enclave","wasm"],"latest_commit_sha":null,"homepage":"https://lock.host","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rhodey.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-02-22T17:15:56.000Z","updated_at":"2026-03-18T21:37:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/rhodey/lock.host-wasm-js","commit_stats":null,"previous_names":["rhodey/lock.host-wasm-js"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rhodey/lock.host-wasm-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-wasm-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-wasm-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-wasm-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-wasm-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rhodey","download_url":"https://codeload.github.com/rhodey/lock.host-wasm-js/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rhodey%2Flock.host-wasm-js/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33609237,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-28T02:00:06.440Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["crypto","enclave","wasm"],"created_at":"2026-05-28T12:34:03.501Z","updated_at":"2026-05-28T12:34:04.037Z","avatar_url":"https://github.com/rhodey.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lock.host-wasm-js\nLock.host WASM JS example, see [Lock.host](https://github.com/rhodey/lock.host)\n\nThis demonstration uses OpenAI to control a Solana wallet:\n+ Unmodified OpenAI lib\n+ (Mostly) Unmodified Solana lib\n+ Hit /api/joke?message=your best joke\u0026addr=abc123\n+ OAI is asked \"You are to decide if a joke is funny or not\"\n+ If so 0.001 SOL is sent to addr\n+ jokes are written to SQLite by [SQLiteWasmWasi](https://github.com/rhodey/sqlitewasmwasi)\n\n## Why\n[Lock.host-node](https://github.com/rhodey/lock.host-node) demonstrates the same features but is expensive to host\n\n[Lock.host-python](https://github.com/rhodey/lock.host-python) also demonstrates the same features and is expensive to host\n\nIt is very efficient to host WASM apps and so Lock.host has started in this direction\n\n## Setup\nInstall [just](https://github.com/casey/just) then [wasmtime](https://github.com/bytecodealliance/wasmtime):\n```\napt install just (or brew install just)\ncurl https://wasmtime.dev/install.sh -sSf | bash\n```\n\nYou also need [wac](https://github.com/bytecodealliance/wac) and this one takes a few minutes:\n```\ncargo install wac-cli\n```\n\n## Run\n+ [http://localhost:8080](http://localhost:8080)\n+ [app wallet](https://explorer.solana.com/address/DohcaGiBiC3yuPz4gHtoA7QJhyL5N7hk3EpnfFyHZR2S?cluster=devnet)\n+ [user wallet](https://explorer.solana.com/address/CFf6SMjR3eNKR7me9CGHhRNE1SwSQaPi5r4MWZQFGB2W?cluster=devnet)\n```\ncp example.env .env\njust build\njust run\njust joke 'why did the worker quit his job at the recycling factory? because it was soda pressing.'\n\u003e {\"signature\":\"25ndS3qg8EsiaN1uEBfpb63QNdWZDma8ap5Cc5Hv3P4nBM4kAd3pLJQiZHFGpYSm9HLcrzkQaz1mvDrw4Yy4Hu4X\",\"from\":\"DohcaGiBiC3yuPz4gHtoA7QJhyL5N7hk3EpnfFyHZR2S\",\"to\":\"CFf6SMjR3eNKR7me9CGHhRNE1SwSQaPi5r4MWZQFGB2W\",\"thoughts\":\"The joke plays on the pun between 'so depressing' and 'soda pressing', which is clever and light-hearted.\"}\nsqlite3 mount/app.db \"select * from jokes;\"\n\u003e 1|CFf6SMjR3eNKR7me9CGHhRNE1SwSQaPi5r4MWZQFGB2W|why did the worker quit his job at the recycling factory? because it was soda pressing.|The joke plays on the pun between 'so depressing' and 'soda pressing', which is clever and light-hearted.|1\n```\n\n## How\nIt has only very very recently become possible to compile JS to WASM\n\nSpecifically we use [ComponentizeJS](https://github.com/bytecodealliance/ComponentizeJS) which compiles the Mozilla SpiderMonkey JS engine into WASM\n\nThe JS engine then parses and runs the app sources. Think of it like node but you dont have `fs` and `Buffer`\n\nBecause the runtime is exotic @solana/kit had to be patched to use @noble/ed25519\n\n[SQLiteWasmWasi](https://github.com/rhodey/sqlitewasmwasi) is also very new\n\n## Performance\n1. npx loadtest -n 10000 http://localhost:8080 == 5675 RPS\n2. npx loadtest -n 10000 -k http://localhost:8080 == 6262 RPS\n\n## License\nhello@lock.host\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhodey%2Flock.host-wasm-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frhodey%2Flock.host-wasm-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frhodey%2Flock.host-wasm-js/lists"}