Skip to content

Commit 7c62ebe

Browse files
authored
Merge pull request bitcoin#1654 from storopoli/master
Check typos in CI
2 parents a626ad6 + 52fdb00 commit 7c62ebe

File tree

8 files changed

+71
-6
lines changed

8 files changed

+71
-6
lines changed

.github/workflows/github-action-checks.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,12 @@ jobs:
2020
with:
2121
fetch-depth: 2
2222
- run: scripts/diffcheck.sh
23+
Typo-Checks:
24+
name: "Typo Checks"
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout Actions Repository
28+
uses: actions/checkout@v4
29+
30+
- name: Check spelling
31+
uses: crate-ci/typos@master

.typos.toml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
[default]
2+
extend-ignore-re = [
3+
# NOTE: use here for regex patterns
4+
"xpub.*",
5+
"xprv.*",
6+
"3.*", # address
7+
"5.*", # address
8+
"private_key .*",
9+
"privkey .*",
10+
"tt.*", # <tt> tags
11+
"code.*", # <code> tags
12+
"\\w*<sub>", # prefix for <sub> tags
13+
"OP_SUCCESSx|\\d+",
14+
"pay.*",
15+
"ser.*",
16+
"prefix.*",
17+
"value: .*",
18+
]
19+
20+
[default.extend-words]
21+
# NOTE: use here for false-positives
22+
anc = "anc"
23+
PSBT = "PSBT"
24+
ser = "ser"
25+
# Names
26+
Atack = "Atack"
27+
Meni = "Meni"
28+
Ono = "Ono"
29+
30+
[files]
31+
extend-exclude = [
32+
"/*/*.csv",
33+
"/*.d*",
34+
"/*/*.d*",
35+
"/*/*.go",
36+
"/*/*.json",
37+
"/*/*/*.json",
38+
"/*/*.mod",
39+
"/*/*.proto",
40+
"/*/*.py",
41+
"scripts",
42+
"/*/*.s*",
43+
"/*/*.t*",
44+
]

CONTRIBUTING.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Contributing Guidelines
2+
3+
Apart from following [BIP 2](./bip-0002.mediawiki),
4+
we do CI checks to ensure that the proposed BIPs do not have common typos.
5+
These checks are done using [`typos`](https://github.com/crate-ci/typos).
6+
To check for typos locally,
7+
install [`typos`](https://github.com/crate-ci/typos)
8+
and then run in the root directory:
9+
10+
```bash
11+
typos
12+
```

bip-0046.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ A certificate message can be created by another application external to this sta
107107

108108
Almost all wallets implementing this standard can use their already-existing "Sign Message" function to sign the certificate message. As the certificate message itself is always an ASCII string, the wallet may not need to specially implement this section at all but just rely on users copypasting their certificate message into the already-existing "Sign Message" user interface. This works as long as the wallet knows how to use the private key of the timelocked address for signing messages.
109109

110-
It is most important for wallet implementions of this standard to support creating the certificate signature. Verifying the certificate signature is less important.
110+
It is most important for wallet implementations of this standard to support creating the certificate signature. Verifying the certificate signature is less important.
111111

112112

113113
== Test vectors ==

bip-0075.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ message EncryptedProtocolMessage {
219219
==Payment Protocol Process with InvoiceRequests==
220220
The full process overview for using '''InvoiceRequests''' in the Payment Protocol is defined below.
221221
<br/><br/>
222-
All Payment Protocol messages MUST be encapsulated in either a [[#ProtocolMessage|ProtocolMessage]] or [[#EncryptedProcotolMessage|EncryptedProtocolMessage]]. Once the process begins using [[#EncryptedProtocolMessage|EncryptedProtocolMessage]] messages, all subsequent communications MUST use [[#EncryptedProtocolMessage|EncryptedProtocolMessages]].
222+
All Payment Protocol messages MUST be encapsulated in either a [[#ProtocolMessage|ProtocolMessage]] or [[#EncryptedProtocolMessage|EncryptedProtocolMessage]]. Once the process begins using [[#EncryptedProtocolMessage|EncryptedProtocolMessage]] messages, all subsequent communications MUST use [[#EncryptedProtocolMessage|EncryptedProtocolMessages]].
223223
<br/><br/>
224224
All Payment Protocol messages SHOULD be communicated using [[#EncryptedProtocolMessage|EncryptedProtocolMessage]] encapsulating messages with the exception that an [[#InvoiceRequest|InvoiceRequest]] MAY be communicated using the [[#ProtocolMessage|ProtocolMessage]] if the receiver's public key is unknown.
225225
<br/><br/>

bip-0119.mediawiki

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,7 @@ transaction preimages.
392392
=====Using Non-Tagged Hashes=====
393393

394394
The Taproot/Schnorr BIPs use Tagged Hashes
395-
(`SHA256(SHA256(tag)||SHA256(tag)||msg)`) to prevent taproot leafs, branches,
395+
(`SHA256(SHA256(tag)||SHA256(tag)||msg)`) to prevent taproot leaves, branches,
396396
tweaks, and signatures from overlapping in a way that might introduce a security
397397
[vulnerability https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2018-June/016091.html].
398398

@@ -494,7 +494,7 @@ The preimage argument passed to CHECKTEMPLATEVERIFY may be unknown or otherwise
494494
However, requiring knowledge that an address is spendable from is incompatible with sender's ability
495495
to spend to any address (especially, OP_RETURN). If a sender needs to know the template can be spent
496496
from before sending, they may request a signature of an provably non-transaction challenge string
497-
from the leafs of the CHECKTEMPLATEVERIFY tree.
497+
from the leaves of the CHECKTEMPLATEVERIFY tree.
498498

499499
====Forwarding Addresses====
500500

bip-0152.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ There are several design goals for the Short ID calculation:
209209
* '''Space''' cmpctblock messages are never optional in this protocol, and contain a short ID for each non-prefilled transaction in the block. Thus, the size of short IDs is directly proportional to the maximum bandwidth savings possible.
210210
* '''Collision resistance''' It should be hard for network participants to create transactions that cause collisions. If an attacker were able to cause such collisions, filling mempools (and, thus, blocks) with them would cause poor network propagation of new (or non-attacker, in the case of a miner) blocks.
211211
212-
SipHash is a secure, fast, and simple 64-bit MAC designed for network traffic authentication and collision-resistant hash tables. We truncate the output from SipHash-2-4 to 48 bits (see next section) in order to minimize space. The resulting 48-bit hash is certainly not large enough to avoid intentionally created individual collisons, but by using the block hash as a key to SipHash, an attacker cannot predict what keys will be used once their transactions are actually included in a relayed block. We mix in a per-connection 64-bit nonce to obtain independent short IDs on every connection, so that even block creators cannot control where collisions occur, and random collisions only ever affect a small number of connections at any given time. The mixing is done using SHA256(block_header || nonce), which is slow compared to SipHash, but only done once per block. It also adds the ability for nodes to choose the nonce in a better than random way to minimize collisions, though that is not necessary for correct behaviour. Conversely, nodes can also abuse this ability to increase their ability to introduce collisions in the blocks they relay themselves. However, they can already cause more problems by simply refusing to relay blocks. That is inevitable, and this design only seeks to prevent network-wide misbehavior.
212+
SipHash is a secure, fast, and simple 64-bit MAC designed for network traffic authentication and collision-resistant hash tables. We truncate the output from SipHash-2-4 to 48 bits (see next section) in order to minimize space. The resulting 48-bit hash is certainly not large enough to avoid intentionally created individual collisions, but by using the block hash as a key to SipHash, an attacker cannot predict what keys will be used once their transactions are actually included in a relayed block. We mix in a per-connection 64-bit nonce to obtain independent short IDs on every connection, so that even block creators cannot control where collisions occur, and random collisions only ever affect a small number of connections at any given time. The mixing is done using SHA256(block_header || nonce), which is slow compared to SipHash, but only done once per block. It also adds the ability for nodes to choose the nonce in a better than random way to minimize collisions, though that is not necessary for correct behaviour. Conversely, nodes can also abuse this ability to increase their ability to introduce collisions in the blocks they relay themselves. However, they can already cause more problems by simply refusing to relay blocks. That is inevitable, and this design only seeks to prevent network-wide misbehavior.
213213

214214
====Random collision probability====
215215

bip-0352.mediawiki

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ In our simplified example we have been referring to Alice's transactions as havi
9999
Alice performs the tweak with the sum of her input private keys in the following manner:
100100

101101
* Let ''a = a<sub>1</sub> + a<sub>2</sub> + ... + a<sub>n</sub>''
102-
* Let ''input_hash = hash(outpoint<sub>L</sub> || (a·G))'', where ''outpoint<sub>L</sub>'' is the smallest outpoint lexicographically<ref name="why_smallest_outpoint">'''Why use the lexicographically smallest outpoint for the hash?''' Recall that the purpose of including the input hash is so that the sender and receiver can both come up with a deterministic nonce that ensures that a unique address is generated each time, even when reusing the same scriptPubKey as an input. Choosing the smallest outpoint lexicographically satisifes this requirement, while also ensuring that the generated output is not dependent on the final ordering of inputs in the transaction. Using a single outpoint also works well with memory constrained devices (such as hardware signing devices) as it does not require the device to have the entire transaction in memory in order to generate the silent payment output.</ref>
102+
* Let ''input_hash = hash(outpoint<sub>L</sub> || (a·G))'', where ''outpoint<sub>L</sub>'' is the smallest outpoint lexicographically<ref name="why_smallest_outpoint">'''Why use the lexicographically smallest outpoint for the hash?''' Recall that the purpose of including the input hash is so that the sender and receiver can both come up with a deterministic nonce that ensures that a unique address is generated each time, even when reusing the same scriptPubKey as an input. Choosing the smallest outpoint lexicographically satisfies this requirement, while also ensuring that the generated output is not dependent on the final ordering of inputs in the transaction. Using a single outpoint also works well with memory constrained devices (such as hardware signing devices) as it does not require the device to have the entire transaction in memory in order to generate the silent payment output.</ref>
103103
* Let ''P<sub>0</sub> = B + hash(input_hash·a·B || 0)·G''
104104
105105
''' Spend and Scan Key '''

0 commit comments

Comments
 (0)