-
Notifications
You must be signed in to change notification settings - Fork 512
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
update the default signing algorithm to ed25519 #2658
base: main
Are you sure you want to change the base?
Conversation
… in downstream classes like Account
You should add a way to supply algorithm in secret numbers. Also this should be a major release for some of the packages. |
@ckniffen Are you suggesting that I add an I agree that this change needs to wait for a major revision of the packages. |
Does this count as a breaking change? |
Yes the reason being is if you have your secret numbers recorded from a previous account generation it will now not be possbile to generate the same wallet again. |
The default signing algorithm of rippled's Why do we have this discrepancy (the defaults for JS client library is I saw a note about the inability of rippled command line to generate |
…519 as the default signing algorithm
…orithm - explicitly state the algorithm used with generateSeed(), instead of relying on the defaults
@@ -7,6 +7,9 @@ import { | |||
secretToEntropy, | |||
} from '../utils' | |||
|
|||
// TODO: preferably import this type from ripple-keypairs | |||
// import type { Algorithm } from 'ripple-keypairs' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Module '"ripple-keypairs"' declares 'Algorithm' locally, but it is not exported. ts(2459)
index.d.ts(2, 15): 'Algorithm' is declared here.
I tried to import the Algorithm
type from ripple-keypairs
, but I get the above error.
I'm confused, Algorithm
is exported here:
export type Algorithm = 'ecdsa-secp256k1' | 'ed25519' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would need to be exported in https://github.com/XRPLF/xrpl.js/blob/be732a4a6b7bdf58d0efff084b76a66f3f625fe6/packages/ripple-keypairs/src/index.ts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks, updated in
c25d871
@ckeshava please fix lint errors and rebase |
If this is a breaking change, it needs to wait for a major version bump. |
We could release this with rippled v2 client library support as that will also require a major version bump. |
@@ -38,7 +38,7 @@ function generateSeed( | |||
const entropy = options.entropy | |||
? options.entropy.slice(0, 16) | |||
: randomBytes(16) | |||
const type = options.algorithm === 'ed25519' ? 'ed25519' : 'secp256k1' | |||
const type = options.algorithm === 'ecdsa-secp256k1' ? 'secp256k1' : 'ed25519' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be tested against the enum?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line 24 should use the enum too for the key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've lost some of the context here. Which enum are you referring to?
In line 24, I'm using secp256k1
imported from './signing-schemes/secp256k1'
Are you referring to that import?
@CodeRabbit full review |
@coderabbitai full review |
Actions performedFull review triggered. |
Warning Rate limit exceeded@justinr1234 has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 29 minutes and 56 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
High Level Overview of Change
If no signing algorithm is specified, use ed25519. At the moment, the code uses secp256k1. This causes incoherence between the
fromSeed
andgenerateSeed
functions because they use different defaults.Note: This change causes breakage in downstream classes like Account
Context of Change
Type of Change
Did you update HISTORY.md?
Test Plan
The current unit tests have been updated to use new values.