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

BREAKING: Remove specification field in favour of SLIP-10 path type #124

Merged
merged 7 commits into from
Mar 10, 2023

Conversation

Mrtenz
Copy link
Member

@Mrtenz Mrtenz commented Mar 8, 2023

This replaces the specification field added in #120, with a new path type slip10:. This means that you can now use something like ["slip10:44'", "slip10:60'", /* ... */] as derivation path, as well as the current bip32: derivation paths. This simplifies the BIP-32 derivation logic, and separates SLIP-10 and BIP-32 specific logic to a separate file.

While BIP-32 and SLIP-10 are mostly the same, there are some subtle differences. Projects that require full compatibility with one or the other spec can now choose based on the path type.

Example

This works:

const node = SLIP10Node.fromExtendedKey({
  /* ... */,
  curve: 'secp256k1',
});

node.derive([`slip10:0'`, `slip10:1`]);

This also works:

const node = SLIP10Node.fromExtendedKey({
  /* ... */,
  curve: 'secp256k1',
});

node.derive([`bip32:0'`, `bip32:1`]);

This does not work anymore:

const node = SLIP10Node.fromExtendedKey({
  /* ... */,
  curve: 'ed25519', // <-- Note the curve
});

node.derive([`bip32:0'`, `bip32:1`]);

Breaking changes

  • ed25519 can no longer be used with bip32: derivation paths, as it's only defined in SLIP-10.

@Mrtenz Mrtenz force-pushed the mrtenz/slip-10-node-type branch from ae1386e to 1b7188e Compare March 8, 2023 17:55
@Mrtenz Mrtenz marked this pull request as ready for review March 8, 2023 19:35
@Mrtenz Mrtenz requested a review from a team as a code owner March 8, 2023 19:35
src/derivers/shared.ts Outdated Show resolved Hide resolved
src/derivers/slip10.ts Show resolved Hide resolved
src/derivers/shared.ts Show resolved Hide resolved
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