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: Clarify spec, correct test vectors, add Portuguese language code, add dice application #1600

Merged
merged 3 commits into from
Sep 25, 2024

Conversation

akarve
Copy link
Contributor

@akarve akarve commented May 26, 2024

Summary of changes:

  • Clarify drng_reader.read is a first-class function (not an evaluation)
  • Clarify endianness
  • Clarify possibility for TPRV keys
  • Add new reference implementation in Python
  • Clarify that HD-Seed-WIF uses most significant bits
  • Add language code for Portuguese under BIP-32 application
  • Correct entropy for BASE64 test vector
  • Correct byte order and output for XPRV test vector
  • Add new champion

Unit tests for all substantive changes can be found in the reference implementation here:
akarve/bipsea#63

@akarve
Copy link
Contributor Author

akarve commented May 27, 2024

Glad to remove my implementation from reference implementations per #1580 but on review I think you will find that my implementation is more complete and unit-tested than the original. I was also unable to get the original to run at all after install.

@murchandamus murchandamus added Proposed BIP modification Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels May 30, 2024
@murchandamus
Copy link
Contributor

Paging @ethankosakovsky

@akarve
Copy link
Contributor Author

akarve commented Jun 4, 2024

I will be happy to hear from @ethankosakovsky but he hasn't been active on GH since 2021. I have no idea if there's a procedure for this, nevertheless I volunteer to become a maintainer of this BIP if the author cannot be reached.

@akarve akarve changed the title BIP85: Clarify spec, correct PWD BASE64 test vector entropy BIP85: Clarify spec, correct PWD BASE64 test vector, add Portuguese language code Jun 4, 2024
bip-0085.mediawiki Outdated Show resolved Hide resolved
@murchandamus
Copy link
Contributor

Hey @akarve, I’ve tried to send an email to Ethan, let’s see what comes back. If we do not hear from Ethan, it seems to me that BIP 2 provides an option for another champion to take over stewardship of an existing BIP when the original Champion falls off the face of the earth.

@akarve
Copy link
Contributor Author

akarve commented Jun 22, 2024

@murchandamus Howdy. Any luck reaching Ethan?

@murchandamus
Copy link
Contributor

Hey @akarve, I was unable to reach @ethankosakovsky per the email address provided in this BIP.

Sorry, there is very little precedent for this situation, so I’m still making this up as we go. We could have done this in parallel, beside trying to reach out directly, but I would like to propose the following next steps: Please post about your proposed changes on the Bitcoin Developer Mailing list, and point out that you volunteer to become the champion of BIP 85. You could also request in that email that if someone is in touch with Ethan, it would be appreciated if they could reach out to make him aware. Assuming that Ethan isn’t reactivated and nobody objects, we would then try to get some review for your changes, add you as a second BIP champion, and merge this PR.

@akarve
Copy link
Contributor Author

akarve commented Jun 27, 2024

@murchandamus Done. The mailing list topic is "BIP-85 Champion Unreachable? Please weigh in." in case you'd like to comment.

@murchandamus
Copy link
Contributor

Yeah, I saw that. Could you please add yourself as a champion to the BIP in this PR?

@akarve
Copy link
Contributor Author

akarve commented Jun 29, 2024

Will do. Can you advise as to whether champions for PRs in Status: Draft should remedy inconsistencies with other BIPs, like this inconsistency with BIP-32 or leave them as is for backwards compatibility?

@RandyMcMillan
Copy link
Contributor

It may be useful to be consistent with bytes or bits in the document.

Preferably use bits throughout?

@akarve akarve changed the title BIP85: Clarify spec, correct PWD BASE64 test vector, add Portuguese language code BIP85: Clarify spec, correct test vectors, add Portuguese language code, add dice application Jul 4, 2024
@akarve
Copy link
Contributor Author

akarve commented Jul 4, 2024

It may be useful to be consistent with bytes or bits in the document.
Preferably use bits throughout?

Yeah, I've done that wherever possible though there are some cases where say BIP-39 uses bits or where one needs an odd number of bits so I've kept those cases as-is.

I was more worried about changing the byte order for the XPRV application but went ahead with it in the name of consistency with BIP-32.

@akarve
Copy link
Contributor Author

akarve commented Jul 15, 2024

@murchandamus hi, we about good to go here?

lmk if i need to do anything for the failing "Diff checks" — it's objecting to changes to the header block, which are necessary in this rare case.

Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

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

Thanks for your patience.

It would be best if you add yourself as a second author rather than replace Ethan.

Can you advise as to whether champions for PRs in Status: Draft should remedy inconsistencies with other BIPs, like this inconsistency with BIP-32 or leave them as is for backwards compatibility?

Given that this BIP was drafted more than four years ago, there seems to be a good chance that it is already in use. Insofar, it seems best to remain compatible with the original specification rather than fixing inconsistencies with other BIPs.

lmk if i need to do anything for the failing "Diff checks" — it's objecting to changes to the header block, which are necessary in this rare case.

Yeah, you will need to also update the table in the repository’s README to align it with your preamble’s fields.

The changes seem fine to me, but it would be great if some people that are more invested in the content of this BIP also reviewed it.

bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
@akarve
Copy link
Contributor Author

akarve commented Jul 17, 2024

Given that this BIP was drafted more than four years ago, there seems to be a good chance that it is already in use. Insofar, it seems best to remain compatible with the original specification rather than fixing inconsistencies with other BIPs.

Compared to BIP-32, WIF is relatively unused. On the chance that there are security implications to the widely used BIP-32 order I stuck with BIP-32 ordering. I can change this if the reviewers don't agree.

@akarve akarve requested a review from murchandamus July 17, 2024 23:30
Copy link
Contributor

@murchandamus murchandamus left a comment

Choose a reason for hiding this comment

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

Given that this BIP was drafted more than four years ago, there seems to be a good chance that it is already in use. Insofar, it seems best to remain compatible with the original specification rather than fixing inconsistencies with other BIPs.

Compared to BIP-32, WIF is relatively unused. On the chance that there are security implications to the widely used BIP-32 order I stuck with BIP-32 ordering. I can change this if the reviewers don't agree.

I had the impression that the scheme had not changed significantly (first 32 bytes for the chain code, last 32 bytes for the private key). Or is this about the endianness?

If it did change, especially in a backwards incompatible manner, could you please document the changes of the Specification in a Change Log as seen for example in BIP 352?

bip-0085.mediawiki Outdated Show resolved Hide resolved
@jonatack jonatack added the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label Jul 24, 2024
@akarve
Copy link
Contributor Author

akarve commented Sep 22, 2024

@murchandamus Change Log added. We should be good to go :) Thanks for your assistance in getting this over the line.

@jonatack jonatack removed the Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified label Sep 23, 2024
Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

Did an editing pass. Murch might be travelling currently.

(This is a bit of a slog to review commit-by-commit, as many commits re-tweak the changes in the previous ones. I looked at each commit, then ended up looking at the overall diff.)

bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
bip-0085.mediawiki Outdated Show resolved Hide resolved
@akarve akarve force-pushed the master branch 3 times, most recently from 5c71ffb to e076afb Compare September 24, 2024 02:37
    * Add new maintainer (author unreachable)
    * Swap chain code and private key bytes in application 32' for consistentcy with BIP-32 (major change)
    * Correct derived entropy for application 128169' test vector (major change)
    * Clarify big endian serialization
    * Add the Portuguese language (9') to application 39'
    * Add dice application 89101'
    * Clarify Testnet support for XPRV application 32'
    * Minor grammar, format, clarity improvements
@akarve
Copy link
Contributor Author

akarve commented Sep 24, 2024

@jonatack Thank you. I turned around your feedback and rebased into a single commit for clarity.

Copy link
Member

@jonatack jonatack left a comment

Choose a reason for hiding this comment

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

ACK 9179bec

* JavaScript library implementation: [https://github.com/hoganri/bip85-js]
* 2.0 Python library implementation: [https://github.com/akarve/bipsea]
* 1.0 Python library implementation: [https://github.com/ethankosakovsky/bip85]
* 1.0 JavaScript library implementation: [https://github.com/hoganri/bip85-js]
Copy link
Member

Choose a reason for hiding this comment

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

A few ideas for a follow-up:

  • move this section to just above the change log, and/or more clearly mention that 2.0 and 1.0 refer to versions of this BIP

or

  • consider whether it makes sense to drop the 1.0 versions from this list

* Add the Portuguese language (9') to application 39'
* Add dice application 89101'
* Clarify Testnet support for XPRV application 32'
* Minor grammar, format, clarity improvements
Copy link
Member

@jonatack jonatack Sep 25, 2024

Choose a reason for hiding this comment

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

For another pull, it may be good to standardize the various BIPs change logs on the same order (personally prefer to order by descending date, i.e. most recent first).

Edit: for what it's worth, descending date is also the recommended order in https://keepachangelog.com/en/1.1.0/

@jonatack jonatack merged commit a1be309 into bitcoin:master Sep 25, 2024
4 checks passed
@jonatack jonatack removed the PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author label Sep 25, 2024
@scgbckbone
Copy link
Contributor

what is this ? breaking changes after after 3 people talking for 4 months ?

I will be happy to hear from @ethankosakovsky but he hasn't been active on GH since 2021. I have no idea if there's a procedure for this, nevertheless I volunteer to become a maintainer of this BIP if the author cannot be reached.

BS #1344 (comment) (you'd just need to wait bit more, which you should if you're doing breaking changes, anyways)

@nvk
Copy link

nvk commented Oct 4, 2024

NACK

@achow101
Copy link
Member

achow101 commented Oct 4, 2024

Although the BIP is still in Draft status, I think it should have been marked as proposed or final a long time ago as it does appear to be deployed by a few projects. This should be well past the stage where breaking changes can be implemented. The breaking changes should have been discussed on the mailing list, and I think should have been in a new BIP which could supercede 85. Furthermore, the BIPs process currently has no way to distinguish BIP versions and the way that has been implemented here is confusing.

I think this PR should be reverted and the breaking changes should be first discussed on the mailing list and with the projects that have already implemented BIP 85.

I agree that the original author is unresponsive enough to justify a change of BIP champion, but I don't think that should mean the new champion can add any breaking changes that they wish.

@scgbckbone
Copy link
Contributor

I agree that the original author is unresponsive enough to justify a change of BIP champion, but I don't think that should mean the new champion can add any breaking changes that they wish.

he's only unresponsive on GH, if BIP2 is followed and email sent, he'd resurface imo (as last time)

@RandyMcMillan
Copy link
Contributor

NACK
post merge

@scgbckbone
Copy link
Contributor

revert breaking changes PR #1673

@achow101
Copy link
Member

achow101 commented Oct 4, 2024

he's only unresponsive on GH, if BIP2 is followed and email sent, he'd resurface imo (as last time)

#1600 (comment) and #1600 (comment) suggests that email was in fact tried, multiple times, and they were unreachable.

@akarve
Copy link
Contributor Author

akarve commented Oct 4, 2024

#1600 (comment) and #1600 (comment) suggests that email was in fact tried, multiple times, and they were unreachable.

Correct. Moreover an email was sent to the bitcoin dev list looking for him with no results. My understanding is that we followed BIP2 in this regard.

@jonatack
Copy link
Member

jonatack commented Oct 4, 2024

Although the BIP is still in Draft status, I think it should have been marked as proposed or final a long time ago as it does appear to be deployed by a few projects.

Will propose that in a week if not proposed by someone before.

Thank you everyone for the feedback.

@jonatack
Copy link
Member

jonatack commented Oct 4, 2024

I've opened a full revert in #1674 to provide a clean slate. Any desirable changes from this pull can be proposed separately.

@scgbckbone
Copy link
Contributor

@achow101 @akarve my bad, now I see that BIP2 was followed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants