All blog posts
Updates 3 min read

Secure Net Moves to Rust: Foundations and WebAssembly

The first Rust port brought canonical JSON, signed records, initial sessions and a WebAssembly interface into Secure Net.

By Comutability Published Update from

Project update: 15 November 2026. GitHub change #7: merged into the repository. The underlying protocol remains draft and unaudited.

The first Rust port brought canonical JSON, signed records, initial sessions and a WebAssembly interface into Secure Net.

Why we made this change

Moving cryptographic software between languages is about preserving behaviour, not simply translating syntax. The Rust implementation was designed to retain the same JSON request and response format used by the JavaScript host, making it possible to test the same operations in browsers and server environments.

The engineering record

The original pull request records the following technical scope and evidence. Some forward-looking notes in the record reflect the state of the work when the request was opened, rather than its status today.

The first step of moving Secure Net onto Rust, compiled to WebAssembly so JavaScript hosts (including Commonveil on Base44) can use the same code. Stacked on #5; its diff includes #3 to #5 until those are merged.

Not reviewed. No human cryptographer has looked at this.

What's ported

  • secure-net-core: canonical JSON, signed records (Ed25519 and Ed25519 + ML-DSA-65), the session primitives, accounts/devices/prekeys/bundles, and version 1 one-to-one sessions.
  • api: one JSON-in, JSON-out entry point using the same JSON as the JavaScript, so state saved by one loads in the other.
  • secure-net-wasm: that API for JavaScript hosts.
  • examples/cli.rs: the same API on the command line, for the interop test.

How it's checked

  • cargo test: reproduces every value in cvp-002-v1.json and cvp-016-v1.json, including the JavaScript's exact deterministic ML-DSA-65 signature and ML-KEM-768 keys and ciphertexts. All 13 Rust tests pass locally.
  • test/rust-interop.test.mjs (5 tests, passing locally against the native build):
    • canonical JSON is byte for byte the same;
    • signatures made on either side verify on the other;
    • conversations with JS↔Rust in both directions, with late and out-of-order messages;
    • the same session state moving between implementations mid-conversation;
    • Rust refuses what the JavaScript refuses.
  • Breaking a Rust derivation makes 3 of the 5 interop tests fail. Each of 13 guards in the Rust code was removed in turn and a test failed every time.
  • CI runs the Rust tests, the interop test, a wasm32-unknown-unknown build, and the interop test again against the WebAssembly build. The WebAssembly steps could not be run locally (the Rust target download is blocked in this environment), so this PR's CI is their first run.

Known differences (in rust/README.md)

  • Ed25519 verification rules: noble uses ZIP-215; ed25519-dalek uses its own. Honest signatures pass on both, but crafted edge cases could split them. This must be settled before the ledger is ported.
  • Secrets in memory: secrets are not wiped from memory, same as the JavaScript.

Not yet ported

Sessions v2, sender keys and history, social, groups, ledger, governance, tokens, consent, extensions and the wire. Commonveil is not changed yet.

The wider direction

The Comutability approach is open source with human accountability. AI can help research, design, write code and test it, but a merged change is not the same thing as an independently audited product. Secure Net is explicitly described as a draft in its public README. Its use in a sensitive situation should wait for qualified cryptographic review.

What happens next

Verify byte-level compatibility and recorded test vectors before retiring the older implementation. Source parity is not a substitute for a qualified security audit.

Read the original sources

Sources and further reading

Explore the evidence and original project records behind this article.