-
Notifications
You must be signed in to change notification settings - Fork 514
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
BREAKING CHANGE(fix): deriveKeypair
ignoring a manual algorithm
being specified
#2376
Conversation
While this is new behavior this a major fix. I would be okay with putting this in 3.0 and releasing before the other 3.0 features and calling that 4.0 |
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.
This doesn't need to be a breaking change - you can just continue to do pre-existing behavior when the algorithm is not specified, like in XRPLF/xrpl-py#415
It would actually be a 2.0 for ripple-keypairs and the other libraries wouldn't need to be bumped |
Just seeing this on mobile email - and likely missing some context - but it
should be easy to determine algorithm via length of the decoded base58.
Ed25519 has a 3 byte version iirc ?
…On Wed, Jul 12, 2023, 7:33 AM Mayukha Vadari ***@***.***> wrote:
While this is new behavior this a major fix. I would be okay with putting
this in 3.0 and releasing before the other 3.0 features and calling that 4.0
It would actually be a 2.0 for ripple-keypairs and the other libraries
wouldn't need to be bumped
—
Reply to this email directly, view it on GitHub
<#2376 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEAHG4GULNL4WRZWSUG7VLXPXWGJANCNFSM6AAAAAA2GXFJCU>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
That is only true of the public/private key - seeds don't have types |
@mvadari In theory I think this change makes this non-breaking by restoring the default to using the "interpret based on seed" behavior, but I'm nervous about it - bf1be2f I'd prefer to just fully make the changes in a breaking release since best case scenario if we release it in a non-breaking version, this change changes nothing for existing users. Worst case scenario breaks someone's ability to access their wallet, what do you think? |
This fix is now being added to 3.0, so it's fine to make it breaking. |
@JST5000 This needs to have merge conflicts addressed. That should clean up some of the extra updates in this PR like typescript version. |
3bcbc35
to
158183e
Compare
(Note: I will update the |
High Level Overview of Change
ripple-keypair
'sderiveKeypair
function was ignoring whenalgorithm
was passed in as an opt. Instead it incorrectly interpretted all seeds without ansEd
start as using thesecp256k1
algorithm.Pre-fix, this shows up in xrpl.js in that
Wallet.fromSeed('sAbc...', { algorithm: ECDSA.ed25519 })
will always usesecp256k1
instead ofed25519
andWallet.fromSeed('sEdXyz...', { algorithm: ECDSA.secp256k1 })
will always useed25519
since that's what the "seed prefix" indicates to do.Context of Change
This is a very breaking fix, and so should wait until 3.0 since it would cause all manually defined seeds to be interpretted via
ed25519
instead ofsecp256k1
. This PR would cause existing seeds to not work.In order to get them to work again, the code would have to be updated to specify
{ algorithm: ECDSA.secp256k1 }
when generating the Wallet using any of the generators (for exampleWallet.fromSeed(
sN2abs..., { algorithm: ECDSA.secp256k1 })
.Additionally,
xrpl
'sWallet.generate()
was depending on this automatic seed evaluation behavior, and so has been updated to work with the fix.Found while updating the
secretNumbers
PR #1799Type of Change
Test Plan
Updated CI passes
{ algorithm: ECDSA.secp256k1 }
to ensure the same account as before was used to sign / compare against expected values.