Skip to content
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

length check warning on arg publicKeyBytes for method deriveAddressFromBytes #2679

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mattlockyer
Copy link

Currently addresses are derived from any length of bytes, but documentation states that addresses are only derived from compressed public key points:

https://xrpl.org/docs/concepts/accounts/cryptographic-keys/

High Level Overview of Change

Not sure where this should go. Perhaps in the codec package.

Context of Change

I faced an error that was hard to debug since I was passing in an uncompressed public key point to deriveAddress and signing. Everthing was working locally with the xrpl libraries but the nodes were rejecting the transactions.

TLDR; I needed to call deriveAddress with the compressed public key point, as per documentation.

Nothing in the code prevents me from calling deriveAddress with any length of bytes, uncompressed or arbitrary length.

There should be a check.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Did you update HISTORY.md?

  • No, this change does not impact library users

Test Plan

Please add commit to put this check in the right place and add warning to the codebase. It will help other developers in the future.

…omBytes

Currently addresses are derived from any length of bytes, but documentation states that addresses are only derived from compressed public key points:

https://xrpl.org/docs/concepts/accounts/cryptographic-keys/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant