xrpl-dev-portal
xrpl-dev-portal copied to clipboard
Added key pair sample code
XRPL bounty sample for DGE-94 Milestone 1
The goal of this bounty is to support JavaScript for all of the code samples. Milestone 1 is Cryptographic Key Derivation, previously available only in Python.
Seems too high level for a sample code. I think you'd need to use a crypto lib to derive the keypairs from a seed in a low level manner.
Can pull the implementation from xrpl.js or go more deeper but first want to know whether we need to be precise with the examples using ripple libs or have to write them from scratch.
Using the implementation used on xrpl.js would be fine (i guess)
Using the implementation used on xrpl.js would be fine (i guess)
As suggested, updated the code to derive ed25519 key pairs.
Thanks for the info, that's exactly what I was looking for. I will update the code plus will suggest to make bounties more descriptive as we move ahead.
I think we want this to have the same scope as the Python key derivation code sample. That means:
* No using Ripple or XRPLF libraries for seed derivation. It's OK to use them for base58 encoding since that's not the point of this sample. (Hint: all 16-byte UInts are valid seeds for Ed25519 keys, so you just need to generate a random number using a cryptographically-secure source of randomness.) * Should cover both ed25519 and secp256k1 derivation. That's important because secp256k1 derivation is significantly more complicated.
This code sample accurately handles the easiest part (using an off-the-shelf crypto library to derive a Ed25519 key pair from seed) but doesn't cover some of the more challenging aspects of the code it's supposed to port, so this is incomplete thus far.
Thanks for the info, that's exactly what I was looking for. I will update the code plus will suggest to make bounties more descriptive as we move ahead.
I have updated the code as per your comments. @mDuo13 Please review.
Here's the updated link to the bounty referred to in this PR: https://github.com/XRPLBounties/Proposals/blob/main/bounties/0031%20JavaScript%20Code%20Samples.md
@JST5000 @mDuo13 @mvadari Is this bounty complete? If not can you go through the current code, I think its now somewhat equivalent to the python code.
@JST5000 @mDuo13 @mvadari Is this bounty complete? If not can you go through the current code, I think its now somewhat equivalent to the python code.
I'll check today. Sorry for the delay - didn't get a notification for this message for some reason :/
Thanks @jonathanlei and @JST5000. What do I have to do next to get the PR merged?
Hey @TusharPardhe we have decided to accept your work for the bounty, but ended up merging a different submission (#1507).
I'm going to close this PR, but please submit to claim the bounty - you will receive the full amount for your the unique contribution
Here's the form to claim a bounty: https://xrpl.typeform.com/xrpl-bounties
Ahh I would suggest updating the bounty page so we don't have similar PRs (It'll get difficult for the reviewers as well). Also, thank you for considering my code as well its always a good experience to learn more about XRPL.
Looking forward for more contributions!