Bitcoin Forum
May 28, 2024, 12:46:33 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: Introducing a version field to BIP39 Mnemonic Phrases. on: January 13, 2024, 04:06:02 PM
Perhaps you could even stipulate that the new seed phrases must be either 15, 21, or 27 words long, and so any seed phrase which is 12, 18, or 24 words is immediately known to be a legacy seed phrase.

Regarding false positive rates, an 8-bit version field would result in an nVersion/256 false positive rate.
Assuming support for three versions, this would yield a false positive rate of less than 1.2%.
If this isn't enough, one option is to use the 24-bit general purpose field to mitigate this.
This has already been addressed by Lukechilds here : https://github.com/lukechilds/bip39-versioned?tab=readme-ov-file#false-positives
2  Bitcoin / Development & Technical Discussion / Re: Introducing a version field to BIP39 Mnemonic Phrases. on: January 12, 2024, 06:43:39 PM
Since I am not so experienced, could you number 2-3 possible shortcomings of not having a versioning system, apart from the one mentioned in the quoted text above?
From what I know these are the main criticism:
Quote from: aezeed
The lack a version means that wallets may not necessarily know how to re-derive addresses during the recovery process. A lack of a birthday means that wallets don’t know how far back to look in the chain to ensure that they derive all the proper user addresses. Additionally, BIP39 use a very weak KDF.
(https://pkg.go.dev/github.com/lightningnetwork/lnd/aezeed#section-readme)

Given the limitations of non-versioned BIP39 mnemonic phrases, it's equally important to consider the benefits that versioning could bring.
It's essential to design systems with forward compatibility in mind to ensure their long-term relevance and adaptability.



3  Bitcoin / Development & Technical Discussion / Re: Introducing a version field to BIP39 Mnemonic Phrases. on: January 12, 2024, 06:15:54 PM
Thanks for your feedback !

I am not sure whether the VF will be appended or prepended to the entropy. Because you said "prepending" but the quote below looks like the input to the hash function will be ENT + VF, not VF + ENT.
The VF is indeed prepended to the entropy, I agree that  ENT + VF might be confusing. Read it as (ENT + 32)
I was referring to the number of bits of the checksum, basically it's the same way to compute the checksum as per BIP39.

The VF is split in 2 parts where:
Code:
part A = arbitrary bits (24 bits long)
part B = the version 00001101 (8 bits long).
So in part A, we can include any data we want? Because it looks like this adds 24 bits of "protection" against malicious activities. Isn't it? Supposing the 8 bits have a standard set of values, the total "protection" of the seed phrase will be:

128 bits of entropy + 24 arbitrary bits + 8 version bits (the latter will be somewhat standard)
Yes the 24-bit general purpose field can include any data which will be interpreted by the software depending on the version number.

The combined entropy of the seed phrase will look like:
24 general purpose bits + 8 version bits + entropy bits + checksum


Using a passphrase on top of that, will it work symmetrically to the existing BIP39 pattern?
Yes, it'll work exactly the same as long as the KDF is the same.
Passphrases would work with other KDFs too as long as they support salting.
4  Bitcoin / Development & Technical Discussion / Re: Introducing a version field to BIP39 Mnemonic Phrases. on: January 12, 2024, 03:07:07 PM
Thanks for your feedbacks!

Interesting proposal! A few questions:

How would you propose assigning your 8 bit field version field? Something like this?

00000000 - P2PKH at m/44'/0'/0'
00000001 - P2SH-P2WPKH at m/49'/0'/0'
00000010 - P2WPKH at m/84'/0'/0'
00000011 - P2TR at m/86'/0'/0'

What if I want to use a script type/derivation path combo which isn't assigned a version number? What happens then? And what if I want to use the same seed phrase to generate both a P2PKH wallet and a P2WPKH wallet, for example?

I deliberately refrained from drafting specifications for the versions, as I believe that falls outside the scope of this proposal.
However, if I were to design a version dedicated to specifying derivation paths, I would consider utilizing the 24-bit purpose field.

Personally, I envision two methods to achieve this:
  • Employ the entire 24-bit field to define a custom derivation path. This approach, however, would limit the mnemonic phrase to a single derivation path.
  • Alternatively, use 16 bits to designate standard derivation paths, allocate the subsequent 8 bits for subversions (allowing for future expansion of these standard paths).

For example:
first bit     - m/44'/0'/0'
second bit - m/49'/0'/0'
third bit    - m/84'/0'/0'
fourth bit  - m/86'/0'/0'

where:
0001 0000 0000 0000 - m/86'/0'/0' only
1001 0000 0000 0000 - m/44'/0'/0' & m/86'/0'/0'
1111 0000 0000 0000 - all of the above derivation path


I believe that, ultimately, a compromise is necessary between the flexibility of setting a custom derivation path and the capability to utilize multiple derivation paths simultaneously.


Taking 128 bits of entropy generating a 15 word seed phrase using your new system, I assume you are feeding the full 15 words in to PBKDF2? Or are you stripping out the 128 bits of entropy and converting to a "legacy" 12 word seed phrase before generating your wallet?

Yes, to maintain compatibility with non-versioned BIP39 wallets, the complete set of 15 words must be entered into PBKDF2.
Of course, this could be changed in future versions, albeit at the cost of breaking compatibility.

I disagree with your suggestion above to indicate whether a passphrase has been used in the general purpose field. One of the main uses of a passphrase is to add plausible deniability, which is eliminated if you indicate in your seed phrase that you have used a passphrase.

I agree that it'd be a bad idea.
5  Bitcoin / Development & Technical Discussion / Re: Introducing a version field to BIP39 Mnemonic Phrases. on: January 12, 2024, 10:27:46 AM
Few thoughts,
1. Long time ago i read Bitcoin Core doesn't implement BIP39 due to security issue[1], which isn't solved by your proposal.
2. If i understood your proposal correctly, does that mean 12 word mnemonic have less than 128-bit entropy due to version field addition?

[1] https://bitcoin.stackexchange.com/a/88244


[1] If the security issue you are referring to involves the use of PBKDF2, this could be addressed by implementing versioning, although it would break compatibility with non-versioned BIP39 software.

[2] Correct, a 128-bit entropy results in a 15-word mnemonic when considering the 24-bit general-purpose field is used.
For a 12-word mnemonic phrase under the versioned BIP39, you can attain a maximum of 120 bits of entropy, whereas the non-versioned BIP39 allows for 128 bits of entropy with a 12-word mnemonic.
6  Bitcoin / Development & Technical Discussion / Re: Introducing a version field to BIP39 Mnemonic Phrases. on: January 12, 2024, 07:15:11 AM
I think it is best to address all shortcomings of BIP39 when proposing a new algorithm. Version only addresses one of them. I tried to address some more in my rough idea a couple of years ago: https://bitcointalk.org/index.php?topic=5330229.0
Hello, and thank you for your interest!

The primary criticisms of BIP39 that I have encountered include:
  • The absence of versioning.
  • The reliance on a fixed wordlist for checksum verification.

Implementing versioning and a general purpose field could offer several advantages, such as:
  • Specifying the derivation path.
  • Including the wallet's birthdate.
  • Modifying the Key Derivation Function (KDF).
  • Enhancing error detection and correction capabilities.
  • Indicating whether a passphrase is used.
  • Facilitating improved methods of seed xoring.
  • And more...
Regrettably, I don't foresee a method to maintain compatibility with legacy software (non-versioned BIP39) while simultaneously eliminating the requirement for a fixed wordlist.
The objective here is not to introduce a new algorithm, but rather to incorporate versioning while remaining consistent with the BIP39 standard.
7  Bitcoin / Development & Technical Discussion / Introducing a version field to BIP39 Mnemonic Phrases. on: January 11, 2024, 07:18:06 PM
I'm currently involved in a proposal to add a version field to BIP39 mnemonic phrases, an idea that isn't new but one I believe is worth exploring further.
I would really appreciate your feedback on this.
The details of the proposal are outlined in the mailing list, and I'm seeking insights and thoughts from the community on this concept.

For more information, please visit the mailing list at https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2024-January/022275.html

Looking forward to hearing your opinions!
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!