feat(core): extract SignerMultisigCkbBase for Omnilock multisig#360
feat(core): extract SignerMultisigCkbBase for Omnilock multisig#360phroi wants to merge 6 commits intockb-devrel:releases/nextfrom
Conversation
🦋 Changeset detectedLatest commit: a770d52 The changes in this PR will be included in the next version bump. This PR includes changesets to release 20 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
✅ Deploy Preview for apiccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for liveccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for appccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the CKB multisig and Omnilock support by refactoring shared logic into a new abstract base class and introducing dedicated signer implementations for Omnilock. It centralizes cryptographic utilities, updates core dependencies, and improves the build system, laying a more robust foundation for advanced CKB interactions. The changes aim to streamline development and ensure compatibility with the latest CKB script versions. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
✅ Deploy Preview for docsccc ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
Code Review
This pull request introduces a significant and well-executed refactoring to support multisig wallets for CKB and Omnilock. The core of the change is the extraction of a common SignerMultisigCkbBase class, which greatly improves code reuse and maintainability. The PR also adds several new signer classes for both CKB multisig and Omnilock multisig, complete with corresponding tests and usage examples.
A notable part of this work is the update of @noble dependencies to new major versions, with the codebase being correctly adapted to the new APIs. The build process has also been modernized by migrating to tsdown. Overall, the changes are extensive, covering new features, refactoring, dependency updates, and build improvements, and the code quality is high. I have reviewed the changes and found no issues.
Extract shared multisig logic into abstract SignerMultisigCkbBase with encodeWitnessLock/decodeWitnessLock template methods. CKB multisig and Omnilock multisig are thin subclasses differing only in witness encoding. MultisigCkbWitness entity moved to its own module. OmniLockWitnessLock molecule encoding added as standalone utility.
f3e9823 to
a770d52
Compare

Why
The CKB multisig signer and Omnilock multisig signer share ~46% of their code. The only real differences are witness encoding (plain multisig bytes vs. OmniLockWitnessLock envelope) and script cardinality (multiple variants vs. one).
Changes
MultisigCkbWitnessentity into standalone moduleSignerMultisigCkbBasewithencodeWitnessLock/decodeWitnessLocktemplate methodsSignerMultisigCkbReadonlyto thin subclassSignerMultisigOmniLockReadonlyandSignerMultisigOmniLockPrivateKeyfor Omnilock auth flag 0x06OmniLockWitnessLockmolecule encoding utilityBuilds on #349.