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

BIP85 derived entropy for Breez SDK #1179

Merged
merged 2 commits into from
Feb 20, 2024

Conversation

benma
Copy link
Collaborator

@benma benma commented Feb 19, 2024

No description provided.

@benma benma requested a review from Beerosagos February 19, 2024 16:42
@benma benma force-pushed the ln-hot-wallet-mnemonic branch 2 times, most recently from a6060e6 to 6d5239f Compare February 19, 2024 16:52
benma added a commit to benma/bitbox02-api-go that referenced this pull request Feb 20, 2024
Access to the BIP85 sub-apps BIP39 and LN according to
BitBoxSwiss/bitbox02-firmware#1179.
benma added a commit to benma/bitbox02-api-go that referenced this pull request Feb 20, 2024
Access to the BIP85 sub-apps BIP39 and LN according to
BitBoxSwiss/bitbox02-firmware#1179.
@benma benma force-pushed the ln-hot-wallet-mnemonic branch from 6d5239f to 1509b0e Compare February 20, 2024 10:58
benma added a commit to benma/bitbox02-api-go that referenced this pull request Feb 20, 2024
For now the same app as before is supported - bip39, but explicit.

The empty message now returns InvalidInput - would have been a
breaking change but the BIP85 API endpoint was never
released (disabled by not activating the app-bip85 Rust feature).

Reason: we want to add another dedicated app number for the generation
of deterministic entropy for the Breez SDK Lightning hot wallet in the
BitBoxApp. This will segregate keys so that BIP85-BIP39 mnemonics
which the user already might use (or will use) are not unintentionally
re-used and made hot in the Lightning wallet.
@benma benma force-pushed the ln-hot-wallet-mnemonic branch 2 times, most recently from 66fc6ba to d1fc7fc Compare February 20, 2024 15:05
benma added a commit to benma/bitbox02-api-go that referenced this pull request Feb 20, 2024
@benma benma changed the title Ln hot wallet mnemonic BIP85 derived entropy for Breez SDK Feb 20, 2024
For the generation of a mnemonic for Breez-SDK Lightning hot wallets
in the BitBoxApp.

Using the regular BIP85-BIP39 path like `m/83696968'/39'/0'/12'/0'`
for this is problematic as a user might use the same mnemonics for
something else, e.g. another cold storage wallet. In such a case, the
derived mnemonic of the user would become hot without the user
realizing it.

For the purpose of generating entropy for a lightning hot wallet using
BIP85, we should instead use a different application number dedicated
to this.

We are going with number `19534'`, which is unlikely to interfere with
other uses. It's hex representation `0x4c4e` spells `LN` in ASCII.

The BIP85 derivation would then be
`m/83696968'/{app_no}/{language}'/{words}'/` as in BIP85-BIP39, but
use `19534'` for the `app_no` instead of `39'`, so:

    m/83696968'/19534'/0'/12'/0'

We restrict to only 16 byte derived entropy (equivalent of 12 words
mnemonics) for LN hot wallet mnemonics for simplicity and easier
recovery for users.

The index represents the account number - for now we only allow
`0` (the first account), and can extend to multiple if there is ever a
need.
@benma benma force-pushed the ln-hot-wallet-mnemonic branch from d1fc7fc to c7e091c Compare February 20, 2024 15:21
Copy link
Collaborator

@Beerosagos Beerosagos left a comment

Choose a reason for hiding this comment

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

tACK!

@benma benma merged commit 4d2434f into BitBoxSwiss:master Feb 20, 2024
1 check passed
@benma benma deleted the ln-hot-wallet-mnemonic branch February 20, 2024 21:11
benma added a commit to benma/bitbox02-api-go that referenced this pull request Feb 20, 2024
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