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

Feat: bip32 package with blinded xpub support #126

Merged
merged 19 commits into from
Sep 9, 2024

Conversation

bucko13
Copy link
Contributor

@bucko13 bucko13 commented Sep 6, 2024

New package for working with bip32 objects. Starting with various utilities for getting blinded xpubs and paths.

Eventually I think it would make sense for a lot of the @caravan/bitcoin keys and paths code to be moved here too.

Diff looks pretty big, but important changes are in packages/bip32 and apps/coordinator

Implemented a proof of concept for support in Caravan Coordinator

Screenshot 2024-09-05 at 10 35 56 PM

Copy link

changeset-bot bot commented Sep 6, 2024

⚠️ No Changeset found

Latest commit: 6eff96c

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Copy link

vercel bot commented Sep 6, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
caravan-coordinator ✅ Ready (Inspect) Visit Preview 💬 Add feedback Sep 9, 2024 4:23pm

nk1tz
nk1tz previously approved these changes Sep 6, 2024
Copy link
Contributor

@nk1tz nk1tz left a comment

Choose a reason for hiding this comment

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

Looks good, nothing to say

Copy link
Contributor

@chadchapnick chadchapnick left a comment

Choose a reason for hiding this comment

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

Educational read through for me—thank you! An excellent feature and have tested building a wallet, signing+broadcasting. Some minor nits and questions 1

Footnotes

  1. possibly irrelevant q's

import { Buffer } from "buffer";
import crypto from "crypto";
const DEFAULT_MAX = 2 ** 31 - 1;
export const secureRandomInt = (min = 0, max = DEFAULT_MAX): number => {
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: can enrich types? min: number= 0 etc

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the type system infers this so intellisense should pick this up just fine (but it is important to be more specific if you want it narrowed down more).

packages/bip32/src/paths.ts Outdated Show resolved Hide resolved
packages/bip32/src/paths.ts Show resolved Hide resolved
packages/bip32/src/keys.ts Outdated Show resolved Hide resolved
@bucko13 bucko13 merged commit 83c3f28 into caravan-bitcoin:main Sep 9, 2024
3 checks passed
@bucko13 bucko13 deleted the bip32 branch September 9, 2024 19:04
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.

3 participants