-
Notifications
You must be signed in to change notification settings - Fork 52
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Lumos Work Smother With the Modern Frontend Dev Tools #597
Labels
Milestone
Comments
homura
changed the title
Make Lumos Works Smother With the Modern Frontend Dev Tools
Make Lumos Work Smother With the Modern Frontend Dev Tools
Jan 4, 2024
I support updating. The change sounds reasonable and the updates needed to support it are minimal. In particular, I personally never liked using BI. I would much prefer to use the native BigInt. |
2 tasks
The PR #684 dropped all the fs support |
3 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Currently, Lumos has some methods, particularly crypto-related APIs such as
mnemonicToSeedSync(): Buffer
in@ckb-lumos/hd
. This makes it a bit challenging to integrate Lumos directly with some modern developer tools like Vite. To work with Vite, developers typically require additional configuration to include these methods in the project, which is inconvenient.I would like to propose a refactor to replace these methods with a modern one such as https://github.com/paulmillr/noble-curves, which is suitable for working with multiple major runtimes. Noble-curves is a trusted option for many projects as it has been audited. However, noble-curves relies on the
bigint
API, which means a breaking change for Lumos to use it as the NodeJS'snode:cyrpto
alternative.Around two years ago, Lumos introduced a big integer library
@ckb-lumos/bi
and migrated the bigint-related API to the library for compatibility in #212, as some browsers didn't supportbigint
, especially Safari on iOS < 13.7.Therefore, if we want to achieve this, some breaking changes will be required:
bigint
and drop the compatibility of iOS < 13.7(the market share < 3% at 2023-12)Buffer
returned from some methods toUint8Array
But this makes Lumos
browserify-crypto
,browserify-buffer
, etc.Let me know if you think this change is worth it!
Q&A
Buffer
toUint8Array
affect massively?Probably not, the
Buffer
is extended fromUint8Array
, therefore, I suppose it is a slight change, or even without any change if developers do not use theBuffer
API.It depends on developers' habits. I'd also like to add that the current BI supports construct via bigint
Notes
The text was updated successfully, but these errors were encountered: