1
0
mirror of https://github.com/bitcoin/bips.git synced 2025-07-21 12:58:14 +00:00

4245 Commits

Author SHA1 Message Date
Yuval Kogman
cd19d89e58 scripted-diff: fix BIP 2 field order violations
-BEGIN VERIFY SCRIPT-
set -e
perl <<'-END PERL-'
use strict;
use warnings;

my $topbip = 9999;

my @FieldOrder = qw(
	BIP
	Layer
	Title
	Author
	Authors
	Editor
	Deputies
	Discussions-To
	Comments-Summary
	Comments-URI
	Status
	Type
	Created
	License
	License-Code
	Discussion
	Post-History
	Version
	Requires
	Replaces
	Proposed-Replacement
	Superseded-By
);

my $bipnum = 0;
while (++$bipnum <= $topbip) {
	my $fn = sprintf "bip-%04d.mediawiki", $bipnum;
	my $is_markdown = 0;
	if (!-e $fn) {
		$fn = sprintf "bip-%04d.md", $bipnum;
		$is_markdown = 1;
	}
	-e $fn || next;
	open my $F, "<", $fn or die "$!";

	my (@before, %preamble, @after);

	if ($is_markdown) {
		while (<$F>) {
			push @before, $_;
			last if m[^(?:\xef\xbb\xbf)?```$]
		}
		die "No ``` in $fn" if eof $F;
	} else {
		while (<$F>) {
			push @before, $_;
			last if m[^(?:\xef\xbb\xbf)?<pre>$];
		}
		die "No <pre> in $fn" if eof $F;
	}
	my %found;
	my ($title, $author, $status, $type, $layer);
	my ($field, $val, @field_order);
	while (<$F>) {
		push @after, $_ and last if ($is_markdown && m[^```$]);
		push @after, $_ and last if (!$is_markdown && m[^</pre>$]);

		if (m[^  ([\w-]+)\: (.*\S)$]) {
			$field = $1;
			$val = $2;
		} elsif (m[^  ( +)(.*\S)$]) {
			$val = $2;
		} else {
			die "Bad line in $fn preamble";
		}

		push @{$preamble{$field} ||= []}, $_;
	}
	push @after, <$F>;
	close $F or die $!;

	open my $W, ">", "$fn" or die "$!";

	print $W @before;
	print $W map { @$_ } grep { defined } delete @preamble{@FieldOrder};
	die "Unknown fields: @{[ keys %preamble ]}" if %preamble;
	print $W @after;

	close $W or die $!;
}
-END PERL-
-END VERIFY SCRIPT-
2025-07-20 14:29:13 -06:00
Jon Atack
340c1a3d53
Merge pull request #1892 from real-or-random/202507-spdx
bip3: Switch to SPDX identifiers
2025-07-18 13:45:02 -07:00
Tim Ruffing
88d29188c6 bip3: Editorial cleanup of the license lists 2025-07-18 13:29:46 +02:00
Tim Ruffing
7aa54dd696 bip3: Change License example to CC0-1.0 OR MIT
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.
2025-07-18 13:29:46 +02:00
Tim Ruffing
0cc4d26e67 bip3: Editorial changes in "BIP Licensing" 2025-07-18 13:29:46 +02:00
Tim Ruffing
e1d72f0243 bip3: Recommend SPDX-License-Identifier comments 2025-07-18 13:29:46 +02:00
Tim Ruffing
3de6ed6dc0 bip3: Don't require omitting unacceptable licenses
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.)
2025-07-18 13:29:46 +02:00
Tim Ruffing
d01e941188 bip3: Don't call CC0 a license
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.
2025-07-18 13:29:08 +02:00
Tim Ruffing
33d45d7f74 bip3: Use user-defined LicenseRef-PD instead of PD
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.
2025-07-18 13:29:08 +02:00
Tim Ruffing
85a248f68e bip3: Fix SPDX id of Open Publication License 2025-07-18 13:29:08 +02:00
Tim Ruffing
e5748c9997 bip3: Fix SPDX id of FSF/GNU All Permissive 2025-07-18 13:29:08 +02:00
Tim Ruffing
c3b6691284 bip3: Switch to SPDX License Expressions 2025-07-18 13:29:08 +02:00
Mark "Murch" Erhardt
be3d2e4611
Merge pull request #1897 from Galoretka/rawe
BIP69: fix function name typo in example code
2025-07-16 16:27:14 -07:00
Galoretka
504c8439ce
Fix function name typo: use bytearr_cmp instead of bytearray_cmp 2025-07-16 21:35:15 +03:00
Mark "Murch" Erhardt
83ac8427e7
Merge pull request #1890 from nothingmuch/fragment-fixes
BIP 77: Delimit fragment params with  `-` instead of `+`
2025-07-10 15:04:58 -07:00
Yuval Kogman
8b83c34949 Specify lexicographical order for fragment params
The rationale for this change is that since `-` instead of `+` breaks
compatibility anyway, the marginal cost of removing this
unusual/surprising requirement for reverse lexicographical ordering is
zero.
2025-07-10 22:06:57 +02:00
Yuval Kogman
43f9688600 Separate fragment params with - instead of +
Since only Bull Bitcoin Mobile and Cake wallet are currently deployed in
production, both using PDK, and the `+` character is causing some
friction, this change seems justified to avoid similar issues with
future implementations.
2025-07-10 01:33:16 +02:00
Mark "Murch" Erhardt
c17a3dbceb
Merge pull request #1888 from achow101/380-drop-H
380: Disallow H as a hardened indicator
2025-07-03 14:49:16 -07:00
Guro
fd1955694b
bip373: add hyperlinks to other BIPs (#1886)
Co-authored-by: Mark "Murch" Erhardt <murch@murch.one>
2025-07-03 10:46:18 -07:00
Ava Chow
3cc71d7c22 380: Disallow H as a hardened indicator 2025-07-01 14:28:30 -07:00
Jon Atack
36618d1c3c
Merge pull request #1884 from scgbckbone/b388_fix_vector
BIP-0388: Fix test vector
2025-07-01 13:20:47 -07:00
scgbckbone
db8bad7ac9 fix: descriptor in "Taproot wallet policy with sortedmulti_a and a miniscript leaf" test vector which incorrectly uses @0 from keys info without key origin derivation 2025-06-30 12:44:04 +02:00
Mark "Murch" Erhardt
77b0bb297a
Merge pull request #1819 from murchandamus/2025-03-bip3-followups
BIP3: Address additional review
2025-06-27 10:17:21 -07:00
Murch
99b8541e09
bip3: Improve compatibility section 2025-06-27 10:15:26 -07:00
Murch
0bbe31b745
bip3: Restate recommendation to get early feedback 2025-06-27 10:15:24 -07:00
Murch
66cb7504b4
bip3: Explain why the Replaces header is unchanged 2025-06-27 10:15:23 -07:00
Murch
7101294a93
bip3: Describe acceptance as Adoption/Publication 2025-06-27 10:15:21 -07:00
Murch
2c57d8aee6
bip3: Fix minor phrasing and structure issues 2025-06-27 10:14:25 -07:00
Jon Atack
187d8859dc
Merge pull request #1876 from Merkleize/ccv-fixes
443: Fix some mistakes, and add paragraph on fees
2025-06-26 15:35:44 -07:00
Jon Atack
f9017e52a3
Merge pull request #1874 from bigspider/bip388-musig-fix
388: fix incorrect example
2025-06-25 10:41:05 -07:00
Kendra Karol Sevilla
f38f6c4e7b
[bip-390]: add hyperlinks to BIPs (327, 380, 389, 32) (#1877)
* add hyperlinks to BIPs

* Update bip-0390.mediawiki
2025-06-24 08:26:41 -07:00
Salvatore Ingala
e4e2b7ccd1
443: add paragraph on fee management 2025-06-22 20:46:37 +02:00
Salvatore Ingala
ff5703c755
443: fix some errors in the python pseudocode and a wrong reference. 2025-06-22 20:28:46 +02:00
Salvatore Ingala
dadbbc6de4
388: fix incorrect example
As per the test vectors, musig key expressions require the aggregation step
to precede the change/address_index derivations.
2025-06-21 12:03:15 +02:00
Jon Atack
e22eaa5a52
Merge pull request #1803 from quapka/hardened-indicator 2025-06-20 16:06:00 -07:00
Mark "Murch" Erhardt
db9e16eb5d
Merge pull request #1873 from lechpzn/master
[bip-0443]: fix link to bip-0341
2025-06-20 15:40:07 -07:00
Afounso Souza
0f47be10d6
BIP443: Fix links to other BIPs 2025-06-20 15:37:24 -07:00
Jon Atack
1889614e54
Merge pull request #1871 from achow101/desc-clarifications
390: clarifications on KEY expression restrictions
2025-06-19 19:20:40 -07:00
Ava Chow
c754a4d095 390: Additional clarifications on KEY expression restrictions 2025-06-18 17:13:07 -07:00
Ava Chow
bc66fdb166 descriptors: Require BIP 380
All of BIPs describing new descriptors require BIP 380
2025-06-18 15:09:43 -07:00
Mark "Murch" Erhardt
879ba82ab4
Merge pull request #1867 from achow101/390-clarifications
390: Allow repeated participant pubkeys and disallow ranged participants with aggregate derivation.
2025-06-18 14:10:44 -07:00
Ava Chow
530b91d86b 390: Allow repeated participant pubkeys 2025-06-18 12:32:52 -07:00
Jon Atack
a39a82f497
Merge pull request #1866 from rkrux/musig-multipath
390: mention about multipath key expression in musig descriptors
2025-06-18 11:23:02 -07:00
Mark "Murch" Erhardt
e82c925973 Merge pull request #1870 from notnout/patch-1
Update bip-0321.mediawiki to remove duplicate address example
2025-06-16 11:59:34 -07:00
Commander Nout
a211df4825
Update bip-0321.mediawiki to remove duplicate address example
Removing duplicate address example that's exactly the same as above.
2025-06-16 10:27:23 -05:00
rkrux
099b1807a4 390: mention about multipath key expression in musig descriptors
Also, adds an example for the same.
2025-06-06 13:29:11 +05:30
Jon Atack
dbb9617e5f
Merge pull request #1865 from achow101/383-fix-scripts
383: Fix output scripts and reword minimal encoding explanation
2025-06-05 13:32:51 -07:00
Ava Chow
ee7accaf5f 383: Fix output scripts and reword minimal encoding explanation
Co-Authored-By: Dr. Maxim Orlovsky <orlovsky@lnp-bp.org>
2025-06-05 13:22:17 -07:00
Jon Atack
820a044c81
Merge pull request #1861 from ethicnology/master
BIP21: clarify that example addresses are intentionally invalid
2025-06-04 13:24:38 -07:00
ethicnology
fad325e7a1
refactor: add warning about invalid example addresses in BIP-21 2025-06-04 15:57:44 -04:00