Skip to content

BIP85: Clarify spec, correct test vectors, add Portuguese language code, add dice application#1600

Merged
jonatack merged 3 commits into
bitcoin:masterfrom
akarve:master
Sep 25, 2024
Merged

BIP85: Clarify spec, correct test vectors, add Portuguese language code, add dice application#1600
jonatack merged 3 commits into
bitcoin:masterfrom
akarve:master

Conversation

@akarve

@akarve akarve commented May 26, 2024

Copy link
Copy Markdown
Contributor

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

akarve commented May 27, 2024

Copy link
Copy Markdown
Contributor Author

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 PR by non-owner to update BIP content Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified labels May 30, 2024
@murchandamus

Copy link
Copy Markdown
Member

Paging @ethankosakovsky

@akarve

akarve commented Jun 4, 2024

Copy link
Copy Markdown
Contributor Author

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
Comment thread bip-0085.mediawiki Outdated
@murchandamus

Copy link
Copy Markdown
Member

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

akarve commented Jun 22, 2024

Copy link
Copy Markdown
Contributor Author

@murchandamus Howdy. Any luck reaching Ethan?

@murchandamus

Copy link
Copy Markdown
Member

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

akarve commented Jun 27, 2024

Copy link
Copy Markdown
Contributor Author

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

@murchandamus

Copy link
Copy Markdown
Member

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

@akarve

akarve commented Jun 29, 2024

Copy link
Copy Markdown
Contributor Author

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
Copy Markdown
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

akarve commented Jul 4, 2024

Copy link
Copy Markdown
Contributor Author

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

akarve commented Jul 15, 2024

Copy link
Copy Markdown
Contributor Author

@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.

@murchandamus murchandamus left a comment

Copy link
Copy Markdown
Member

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.

Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated
@akarve

akarve commented Jul 17, 2024

Copy link
Copy Markdown
Contributor Author

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

@murchandamus murchandamus left a comment

Copy link
Copy Markdown
Member

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?

Comment thread bip-0085.mediawiki Outdated
@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

akarve commented Sep 22, 2024

Copy link
Copy Markdown
Contributor Author

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

@akarve akarve requested a review from murchandamus September 22, 2024 21:00
@jonatack jonatack removed the Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified label Sep 23, 2024

@jonatack jonatack left a comment

Copy link
Copy Markdown
Member

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.)

Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki
Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated
Comment thread bip-0085.mediawiki Outdated
@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

akarve commented Sep 24, 2024

Copy link
Copy Markdown
Contributor Author

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

@jonatack jonatack left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

ACK 9179bec

Comment thread bip-0085.mediawiki
* 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
Copy Markdown
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

Comment thread bip-0085.mediawiki
* Add the Portuguese language (9') to application 39'
* Add dice application 89101'
* Clarify Testnet support for XPRV application 32'
* Minor grammar, format, clarity improvements

@jonatack jonatack Sep 25, 2024

Copy link
Copy Markdown
Member

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
@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
Copy Markdown
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

nvk commented Oct 4, 2024

Copy link
Copy Markdown

NACK

@achow101

achow101 commented Oct 4, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
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
Copy Markdown
Contributor

NACK
post merge

@scgbckbone

Copy link
Copy Markdown
Contributor

revert breaking changes PR #1673

@achow101

achow101 commented Oct 4, 2024

Copy link
Copy Markdown
Member

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

akarve commented Oct 4, 2024

Copy link
Copy Markdown
Contributor Author

#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

jonatack commented Oct 4, 2024

Copy link
Copy Markdown
Member

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

jonatack commented Oct 4, 2024

Copy link
Copy Markdown
Member

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
Copy Markdown
Contributor

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

@murchandamus

Copy link
Copy Markdown
Member

I think we’ll have to talk about what’s on-topic to be added to BIP85 and what isn’t, as well as how the use-cases get collected. BIP85 is starting to collect optional extensions like a kitchen sink.—With all those use cases described here, what does it mean to “implement BIP85”, does a project implement BIP85 while it only supports some of these? How do users know which parts of BIP85 are supported by a project?

I am coming around to recommending that BIP85 perhaps adopt an extension style more similar to BIP174 (PSBT) which has an accompanying auxiliary file to register fields that have been defined to prevent clashes, but requires that any extensions be defined in separate BIPs. I think it could also work well for BIP85: new extensions would stand on their own legs, describe their use case in their own proposal, but merely declare their use of BIP85 and reserve the derivation path in the context of BIP85.

This would also stop making every extension subject to your review and approval, @akarve, although I’m sure the would-be authors would appreciate your review.

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

Labels

Proposed BIP modification PR by non-owner to update BIP content

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants