Project update: 15 November 2026. GitHub change #8: merged into the repository. The underlying protocol remains draft and unaudited.
Secure Net's second Rust migration stage ported Commonveil key operations, hybrid cryptography and recovery-related code while preserving existing formats.
Why we made this change
Commonveil already depends on encrypted device-to-device communications, so changing the implementation must not strand existing accounts or messages. Compatibility with stored keys, signed records and sealed envelopes is therefore a product requirement as well as an engineering test.
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.
Part 2 of moving Secure Net and Commonveil onto Rust. This ports Commonveil's cryptography (src/crypto/*, about 2,000 lines of JavaScript) to rust/secure-net-core/src/cv, keeping every format, so anything made by one implementation works in the other.
What's ported
- P-256 ECDH and ECDSA in WebCrypto's forms (raw 65-byte keys, PKCS#8, 64-byte
r || s), and ECIES sealing - MLKEM768-P256 hybrid KEM, byte for byte with
@noble/post-quantum. Fixed-randomness vectors are intests/vectors/cv-kem.json. One finding: noble's comments say the combiner hashes the ECDH point'sx || y, but its code hashesxonly. The vectors pin down what the library actually does. - Identity: canonical statement text, keyrings, message envelopes v2 and v3 with key commitments, key histories and their digests, pins and anchors, device certificates, device-KEM signatures, device proofs, item signatures, safety numbers and link codes
- Recovery and keys: BIP-39 phrases (checked against the reference vectors), recovery keys, anchors and backups, the PBKDF2 passcode lock, and owner keys (
cvkey1…) - Servers: key chains, the hourly forward ratchet, generations, grants, items and invite previews
All of it is available as cv.* operations in the JSON API, from the command-line build and from WebAssembly.
How it's checked
- Cross-implementation:
test/rust-crypto-interop.test.mjshas 11 tests. Each side makes values and the other opens or verifies them, and both sides must refuse tampered input with the same error codes. CI runs it against the native build and again against the WebAssembly build. - Refusals:
tests/cv_guards.rsexercises each refusal directly. - Mutation: I removed each of 19 security guards in turn, and 18 made a test fail. The 19th is the explicit
0x04check on P-256 points. The SEC 1 decoder underneath already enforces it, so it stays as defence in depth. - Lints: CI now runs clippy with warnings as errors, and
unsafecode is forbidden in the core. - Locally: all 109 JavaScript tests pass, as do all the Rust tests.
Deliberate differences (see rust/README.md)
- Browser keys stay in WebCrypto. Web clients should keep making device keys and the lock key with WebCrypto, where they can't be exported. WebAssembly can't give that guarantee.
- Recovery secrets stay inside Rust. The recovery operations take the phrase and never return the derived secrets.
- ECDSA nonces differ. Rust uses deterministic RFC 6979 nonces and WebCrypto uses random ones. Signatures from either verify everywhere; they just aren't byte-identical.
- Ed25519 owner signatures. These use ed25519-dalek's rules rather than noble's ZIP-215. Honest signatures verify on both.
Needs human review
This is security-critical code. Passing tests, interoperability and mutation checks shows the two implementations agree; it doesn't prove the code is free of vulnerabilities. A cryptographer should review it before Commonveil depends on it.
Next: the protocol's remaining parts (sessions v2, sender keys, wire, ledger, governance, tokens, social, MLS), then Commonveil's client logic and self-hosted server in Rust.
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
Continue comparing Rust and JavaScript outputs under controlled test data, especially for malformed inputs and recovery edge cases.

