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

14 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
Christian Lewe
43fa7cf13d Mark Taproot BIPs as Final 2023-02-19 16:16:13 +01:00
Brandon Black
d690408080
BIP341/342: Clarify SigHash extensions
* Pull the definition of the extension in BIP342 to its own section
* Add a section to BIP341 on validating script path signatures
* Clarify that SigMsg does not produce the message being signed, but
a common portion of it
2021-11-03 15:05:49 -07:00
Luke Dashjr
40b10c83db
Merge pull request #1104 from ajtowns/202103-bip341-speedy-trial-mtp
BIP341: speedy trial activation parameters
2021-04-25 21:54:10 +00:00
Jonas Nick
43b5f171dc BIP 341/342: Add link to Bitcoin Core test vectors
Also remove mention of non-existing examples.
2021-04-13 15:04:17 +00:00
Anthony Towns
a516c135ab BIP341/342: document current deployment status 2021-03-26 06:33:05 +10:00
MarcoFalke
d8531483f5 bip 341/342: Replace CCompactSize with CompactSize 2020-09-03 14:37:50 -07:00
Gregory Sanders
25fe598828
be slightly more explicit about codesep_pos
Felt this could be under-defined, and if this is wrong, would be nice to have correct text in its place
2020-08-16 23:32:38 -04:00
Pieter Wuille
b9ea863727 Use consistent capitalization of tag TapSighash 2020-07-28 13:50:50 -07:00
Vis Virial (a.k.a. びりある)
9329af381f
Fix "Using a single OP_CHECKSIGADD-based script"
1. CHECKSIG / CHECKSIGADD is confused

Only the first OP-code for the first public key should be "CHECKSIG" and the following (second to n-th) OP-codes should be "CHECKSIGADD".
It is confusing because it is only specified the first and last OP-codes, so I specified the second OP-code clearly.
(I recommend to describe why only the first OP-code should be "CHECKSIG", not "CHECKSIGADD".)

2. Order of the signatures in witness

In the original sentence, the stack status after the all witness elements are pushed will be
| w_n  |
|    :    |
| w_1 |

and then, the first element of the script, "<pubkey_1>" will be pushed to the stack
| pubkey_1 |
| w_n  |
|    :    |
| w_1 |

so the "pubkey_1" and "w_n" won't match.

The order of either "pubkey_i"s or "w_i"s should be inverted.
2020-02-20 16:24:06 +09:00
Pieter Wuille
9cf4038f17 fix BIP links 2020-01-20 07:35:26 -08:00
Pieter Wuille
c3b91dcc22 Fixes to headers 2020-01-19 14:48:58 -08:00
Pieter Wuille
e1914b8173 fixes 2020-01-19 14:48:58 -08:00
Pieter Wuille
1faa4b19bc Rename BIPs 2020-01-19 14:47:33 -08:00