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

Add extended key property to SLIP10Node #196

Merged
merged 3 commits into from
Nov 22, 2024
Merged

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Nov 22, 2024

This adds an extendedKey property to SLIP-10 nodes, which returns the BIP-32 serialised extended key. This only works for secp256k1 nodes, as other standards don't specify a standard for serialisation, and the length of the keys is different across curves.

I've also updated SLIP10Node.fromExtendedKey to accept a serialised extended key, instead of an options object.

@Mrtenz Mrtenz marked this pull request as ready for review November 22, 2024 11:46
@Mrtenz Mrtenz requested a review from a team as a code owner November 22, 2024 11:46
src/BIP44Node.ts Outdated Show resolved Hide resolved
src/SLIP10Node.ts Outdated Show resolved Hide resolved
index: 0,
});

if (path.ours.tuple.length === 0) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this meant to account for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We call derive below, which is not valid for an empty array.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I had to remind myself of how the fixtures are structured

@Mrtenz Mrtenz merged commit ba51cac into main Nov 22, 2024
17 checks passed
@Mrtenz Mrtenz deleted the mrtenz/slip-10-extended-key branch November 22, 2024 12:10
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.

2 participants