Skip to content

bip3: Switch to SPDX identifiers #1892

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

Merged
merged 10 commits into from
Jul 18, 2025
Merged

Conversation

real-or-random
Copy link
Contributor

This has been discussed in #1819 (review)

See individual commit messages for further rationale. I can squash the commits if this will be cleaner.

This doesn't touch all the "License" and "License-Code" headers yet. Let's first agree on the changes, and then we can implement them.

@real-or-random real-or-random force-pushed the 202507-spdx branch 2 times, most recently from 7cf70ec to 6183adb Compare July 9, 2025 09:33
@real-or-random
Copy link
Contributor Author

real-or-random commented Jul 9, 2025

After staring at this section and some BIP preambles for a while, a further suggestion is to drop "License-Code" entirely. It's used only by five BIPs so far (BIP 98, BIP 116, BIP 117, BIP 330, BIP 340), and I think it creates more ambiguity than it tries to resolve:

For BIP98, BIP116, and BIP 117 (some comments below apply to all of them but I list them only once):

  • BIP98 contains "source code" to render a diagram used in the document. Is this covered by "License" or by "License-Code"?
  • In fact, all aux files of BIP98 are either diagrams or their source code (or a shell script to build the diagrams). I think what they meant with "All provided source code is licensed under the MIT license." in the copyright section is that the reference implementation of the BIP is under MIT, but this reference implementation lives in another repo, which anyway has an explicit MIT license file as fork of Bitcoin Core.
  • BIP 116 contains a Bitcoin script. I claim that this is source code. Is it covered by "License" or by "License-Code"?

BIP330:

  • The Copyright section just says: "This document is licensed under the Creative Commons CC0 1.0 Universal license.", not talking about a different license (MIT) for code at all. Which code should be under MIT? The implementation in a PR to Bitcoin Core or this aux file?

BIP340:

  • The "License-Code" header was introduced only recently (by me) as part of changing the license of the code and the test vectors. But this was limited in scope to the code only to avoid obtaining permission from even more people. We should have started from scratch with everything under CC0 OR MIT.

I feel that this just relying on this text in BIP3 would be a sufficient solution (here in the version after this PR but the one before was also good):

Each auxiliary source code file or source directory should specify the license under which it is made available as is
common in software (e.g., with a SPDX-License-Identifier: <SPDX License Expression> comment,
a license header, or a LICENSE/COPYING file). It is recommended to make any test vectors available under CC0-1.0 or
FSFAP in addition to any other licenses to allow anyone to copy test vectors into their implementations without
introducing license hindrances. Licenses listed in the License-Code header apply to all source directories, source code
files, and test vectors provided with the BIP except those where a LICENSE file in a directory or the file header states
otherwise.

If we stick to something like this, then licensing will be less ambiguous, and we should just drop License-Code.

It could still be rephrased a bit to say "each auxiliary code file or directory made available under different terms than what is specified in the License header" to clarify that the License header is meant to apply to all kinds of aux files, unless specified otherwise. And we'll need a note that old BIPs may have a License-Code header and simply refer to BIP2.

You could say that should belong to a larger overhaul of the legal stuff in BIP3 (see murchandamus#2 (comment) and murchandamus#2 (comment)), but I don't think that's the case. Dropping the header (only for new BIPs, of course) is purely an "editorial" thing and doesn't go into the actual legal issues, so I'd say it belongs to BIP3.

You could also say that I'm quite late with this comment, and I can't really argue against that...

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 taking the time to put together this proposal to improve BIP 3. I heartily agree with all your suggestions including that we should drop the License-Code header for future BIPs. Thank you for taking the time to write the detailed motivations in the commit messages. I went through all the proposed changes commit by commit and support the content of all of the edits. If you touch it again, I’d request that the changes be amended to drop the reformatting of line lengths to minimize the diffs.

If you would like to add also text to drop the License-Code header I’d also support that, otherwise, I can add that as a follow-up to this PR.

@jonatack jonatack added Proposed BIP modification PR Author action required Needs updates, has unaddressed review comments, or is otherwise waiting for PR author labels Jul 15, 2025
SPDX doesn't have an official identifier for "public domain", at least
not for the simple "This document is placed into the public domain"
declarations used in some BIPs, see
https://wiki.spdx.org/view/Legal_Team/Decisions/Dealing_with_Public_Domain_within_SPDX_Files
for the rationale provided by their legal team. The rationale is sound,
but It's possible to create "user-defined" identifiers of the form
LicenseRef-X. This is a good idea here to make sure that all SPDX
expression will be formally valid.

And in our case, all "PD" BIPs match the following pseudo regex, so
there's not much potential for confusion:

    "This (document|BIP|work|proposal) is (hereby)? (placed)? in the
    public domain."

So it makes sense to keep using a single identifier for all of these.
That's a bit of legal nitpicking, sorry. CC0 contains something like a
public domain dedication along with a fallback license, so it's neither
entirely. Some call it a "legal instrument". I prefer not calling it
anything.
I think that requirement is not helpful. I don't think hat including
additional licenses will be overwhelming to the reader. If anything, it
will obfuscates the actual licensing conditions. (Anyway, this should be
super rare.)
The actual reason why I suggest this is that I think that's a great
default choice for a new BIP, so it's a perfect example. CC0-1.0 is a
great liberal choice for the BIP document (and test vectors etc.), and
MIT is the common choice for code in our ecosystem. Putting both BIP and
code under the "OR" avoids any confusion about which part is licensed
under which terms and also avoids any hassle when reorganizing, e.g.,
when moving code out of the BIP Markdown file to a separate file etc.

But I don't want this PR to recommend a license, so let me sell this
change as an editorial change to an example, which is warranted because
the MIT is much more known than FSFAP, in particular in this ecosystem.
@real-or-random
Copy link
Contributor Author

Sorry for the changing line breaks! I don't like this either, but the line breaks were so consistent that I assumed you wanted me to reformat... I changed it back (first force-push to a50e1ca) and also added a change to the "Header Descriptions" section, which I had overlooked (second force-push to 88d2918).

As a side note, what I highly recommend for new texts and BIPs is Semantic Line Breaks (also called Semantic Linefeeds or Ventilated Prose), i.e., having a line break after each substantial unit of thought. This makes it so much easier to reorganize thoughts during editing, and it also keeps the diffs clean. A similar, but slightly worse (if you ask me) advice is having full sentence per line, see also here.

If you would like to add also text to drop the License-Code header I’d also support that, otherwise, I can add that as a follow-up to this PR.

I'm happy to take care of it next week. I suggest a follow-up PR because this PR is ready from my side now. But I can also add commits here if you prefer that. Just let me know.

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 88d2918

A few minor comments that can be done in a follow-up (along with dropping the License-Code header).

* CC0-1.0: [Creative Commons CC0 1.0 Universal](https://creativecommons.org/publicdomain/zero/1.0/)
* GNU-All-Permissive: [GNU All-Permissive License](http://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html)
* FSFAP: [FSF All Permissive License](https://www.gnu.org/prep/maintain/html_node/License-Notices-for-Other-Files.html)
Copy link
Member

@jonatack jonatack Jul 18, 2025

Choose a reason for hiding this comment

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

In commit e5748c9, maybe update the link to the more complete https://spdx.org/licenses/FSFAP.html

* PD: Released into the public domain
* OPL: [Open Publication License, version 1.0](http://opencontent.org/openpub/)
* LicenseRef-PD: Placed into the public domain
* OPUBL-1.0: [Open Publication License 1.0](https://opencontent.org/openpub/)
Copy link
Member

@jonatack jonatack Jul 18, 2025

Choose a reason for hiding this comment

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

In commit 85a248f, maybe update the link to the more comprehensive https://spdx.org/licenses/OPUBL-1.0.html

or the file header states otherwise.

For example, a preamble specifying the optional License-Code header might look like:

License: CC0-1.0
License-Code: MIT

In this case, the code in the BIP is not available under CC0-1.0, but is only available under the terms of the MIT
In this case, the source code in the BIP is not available under Creative Commons CC0 1.0 Universal, but is only available under the MIT
Copy link
Member

Choose a reason for hiding this comment

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

In commit 0cc4d26, nit, per https://spdx.org/licenses/CC0-1.0.html

Suggested change
In this case, the source code in the BIP is not available under Creative Commons CC0 1.0 Universal, but is only available under the MIT
In this case, the source code in the BIP is not available under Creative Commons Zero v1.0 Universal, but is only available under the MIT


#### Not Acceptable Licenses

All licenses not explicitly included in the above lists are not acceptable terms for a Bitcoin Improvement Proposal.
However, BIPs predating this proposal were allowed under other terms, and should use these abbreviations
when no other license is granted:
However, BIPs predating this proposal were accepted under other terms, and should use one the following identifiers.
Copy link
Member

Choose a reason for hiding this comment

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

In commit 0cc4d26, missing word

Suggested change
However, BIPs predating this proposal were accepted under other terms, and should use one the following identifiers.
However, BIPs predating this proposal were accepted under other terms, and should use one of the following identifiers.

@jonatack jonatack merged commit 340c1a3 into bitcoin:master Jul 18, 2025
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 Jul 18, 2025
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.

3 participants