feat(wasm-mps): add support for RedPallas DKG, key derivation, DSG#290
Conversation
d411553 to
a8eff36
Compare
819ec00 to
47032e3
Compare
cc9ad20 to
3225239
Compare
e9c408b to
f82dda8
Compare
There was a problem hiding this comment.
Pull request overview
Adds RedPallas support to the wasm-mps package, extending the WASM-exposed multi-party signing/keygen surface beyond Ed25519 by introducing RedPallas DKG, Orchard key-derivation session driving, and RedPallas DSG signing/verification helpers.
Changes:
- Add RedPallas DKG round APIs plus Orchard derivation-session init/step and FVK→IVK utilities in the Rust WASM module.
- Expand Mocha tests to cover RedPallas flows (DKG, derivation progression, DSG) and add more negative-prefix cases.
- Update build/test configuration and Rust dependencies/profiles to support the new crypto stack and optimize release builds.
Reviewed changes
Copilot reviewed 5 out of 6 changed files in this pull request and generated 13 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/wasm-mps/test/mps.ts | Reorganizes existing Ed25519 tests and adds extensive RedPallas DKG/derivation/DSG test coverage (including negative cases). |
| packages/wasm-mps/src/lib.rs | Implements RedPallas DKG/DSG + derivation session plumbing and exposes new wasm-bindgen types/functions. |
| packages/wasm-mps/package.json | Adjusts Mocha invocation to tweak Node warning behavior. |
| packages/wasm-mps/Makefile | Changes wasm-opt flags (SIMD + optimization level). |
| packages/wasm-mps/Cargo.toml | Adds Orchard/zcash/pasta_curves deps and release profile tuning; patches Orchard source. |
| packages/wasm-mps/Cargo.lock | Locks newly introduced dependency graph for RedPallas/Orchard/zcash components. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
@claude please review |
be01374 to
8be114c
Compare
4bf0d40 to
060b3cb
Compare
060b3cb to
ca08435
Compare
|
@copilot If you're only finding low level corrections at this point, would you feel comfortable merging this PR? |
Yes, the PR looks ready to merge. All critical issues have been resolved:
The remaining suggestions in resolved threads are about making error messages more parameter-specific (e.g., "decryption_key must be 32 bytes" vs "Invalid input"). These would be nice quality-of-life improvements but aren't blockers. |
|
claude review.... PR audit:
|
ca08435 to
4ffd5f2
Compare
|
@Logicwax Majority is AI slop, but I have resolved the few actual issues.
The
Same as before.
Garbling circuit is a public github repo and SL has gone through its release process which includes internal review and audit.
Fixed.
This is stupid. This wants us to cause a runtime trap rather than just throw an error as we currently are doing. Will not fix.
This function is only used for testing and is not part of the protocol. Will not fix.
I believe the ed25519 tests prove that exact same methods used for RedPallas argument coercion are sane. We are not doing anything new here. Will not fix.
Fixed.
If it's not used in the tests, then it's not need. Will remove redapallas_ask_to_ak.
DKG is tested in the DSG test. Derivation is a long running test, I don't see the need to duplicate it in Rust when we already test it in JS.
derivation_seed is not a shared commitment it is a seed for a PRNG.
Our CI bumps package version as part of release.
This is actually a good suggestion. Fixed.
That's not how serialization works. These have to be done separately as the message property is part of a serialized object.
Fixed.
Prefer the concise way it is written, but i'll assign the Some result to
Removed clone and it works without destructuring.
Because they are helper functions for the JS tests and are not used in the actual protocol.
They are distinguishable, we just aren't testing that deeply. It's fine for now. Will not fix.
As if code cannot be self explanatory. But whatever, comment added. |
4ffd5f2 to
0885b08
Compare
Made these Options.
Originally named drv to match the Rust to C++ bindings in firmware, but they can be renamed to msg in this case.
Orchard does not support derivation as it is a privacy coin. Will add comment.
This comment describes what the code is doing. Its purpose is justified. Will not fix. |
| results1[i].state, | ||
| ), | ||
| const message = Buffer.from( | ||
| "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks", |
Ticket: HSM-361