| Crates.io | ubl-wasm |
| lib.rs | ubl-wasm |
| version | 0.1.1 |
| created_at | 2026-01-16 19:29:39.185831+00 |
| updated_at | 2026-01-16 20:42:11.819719+00 |
| description | UBL Chip execution engine for WebAssembly - BLAKE3 + JSON Atomic + Decision CID |
| homepage | https://ubl.voulezvous.ai |
| repository | https://github.com/voulezvous/ubl |
| max_upload_size | |
| id | 2049136 |
| size | 205,505 |
UBL Chip execution engine compiled to WebAssembly with true BLAKE3 hashing.
wasm-pack build --target web --release
<script type="module">
import init, { execute_chip, blake3_hash, canonize_json } from './pkg/ubl_wasm.js';
await init();
const chip = {
did: "did:ubl:chip:e53148143fba5cbc",
chip_cid: "e53148143fba5cbc45338ccc980749fa5053b95c6e0e3169fb5ae7d8a70cad2d",
manifest: {
author: "dan@ubl",
canon: "CANON1",
description: "Check if user is adult",
version: "1.0.0",
logic: { field: "user.age", op: ">=", value: 18 }
}
};
const ctx = { user: { age: 21 } };
const result = JSON.parse(execute_chip(JSON.stringify(chip), JSON.stringify(ctx)));
console.log(result);
// {
// result: true,
// reason: "21 >= 18 = true",
// decision_cid: "f128801ff69fc42510fbae27822ae94ec93aba3e6515d7504e52c703499c30ff",
// ...
// }
</script>
| Function | Description |
|---|---|
execute_chip(chip_json, ctx_json) |
Execute chip and return full result with Decision CID |
blake3_hash(data) |
Compute BLAKE3 hash of string data |
canonize_json(json_str) |
Canonize JSON (sorted keys, compact) |
compute_decision_cid(did, cid, ctx, result, reason) |
Compute Decision CID directly |
version() |
Get version string |
Same formula as CLI/HTTP/Postgres:
BLAKE3(CANON1 \0 did \0 chip_cid \0 canonical(ctx) \0 canonical(output))
Isomorphic execution guaranteed.
ubl_wasm_bg.wasm: ~145KB (optimized with wasm-opt)import init, * as wasm from 'ubl-wasm';
import { registerWasm } from '@ubl/sdk';
await init();
registerWasm(wasm);
// Now <Chip/> uses true BLAKE3 via WASM