diff --git a/.github/workflows/typos.yml b/.github/workflows/typos.yml new file mode 100644 index 0000000..f67d011 --- /dev/null +++ b/.github/workflows/typos.yml @@ -0,0 +1,17 @@ +name: Check Typos +on: + push: + branches: + - master + pull_request: {} + workflow_dispatch: null + +jobs: + typos: + runs-on: ubuntu-latest + steps: + - name: Checkout Actions Repository + uses: actions/checkout@v4 + + - name: Check spelling + uses: crate-ci/typos@master diff --git a/.typos.toml b/.typos.toml new file mode 100644 index 0000000..65d9564 --- /dev/null +++ b/.typos.toml @@ -0,0 +1,16 @@ +[default] + +[default.extend-words] +# NOTE: use here for false-positives +# EXAMPLE: PSBT = "PSBT" + +[files] +extend-exclude = ["site/themes/nightfall"] + +[type.gitignore] +extend-glob = [".gitignore"] +check-file = false + +[type.lock] +extend-glob = ["*.lock"] +check-file = false diff --git a/cookbook/src/tx_segwit-v0.md b/cookbook/src/tx_segwit-v0.md index d709359..7ae3c19 100644 --- a/cookbook/src/tx_segwit-v0.md +++ b/cookbook/src/tx_segwit-v0.md @@ -306,9 +306,9 @@ We create the message `msg` by converting the `sighash` to a [`Message`](https:/ This is the message that we will sign. The [Message::from](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.Message.html#impl-From%3C%26%27_%20bitcoin%3A%3Ahashes%3A%3Asha256d%3A%3AHash%3E) method takes anything that implements the promises to be a thirty two byte hash i.e., 32 bytes that came from a cryptographically secure hashing algorithm. -We compute the signature `sig` by using the [`sign_ecdsa`](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.Secp256k1.html#method.sign_ecdsa) method. -It takes a refence to a [`Message`](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.Message.html) and a reference to a [`SecretKey`](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.SecretKey.html) as arguments, -and returns a [`Signature`](https://docs.rs/secp256k1/0.27.0/secp256k1/ecdsa/struct.Signature.html) type. +We compute the signature `sig` by using the [`sign_ecdsa`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Secp256k1.html#method.sign_ecdsa) method. +It takes a reference to a [`Message`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html) and a reference to a [`SecretKey`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.SecretKey.html) as arguments, +and returns a [`Signature`](https://docs.rs/secp256k1/0.29.0/secp256k1/ecdsa/struct.Signature.html) type. In the next step, we update the witness stack for the input we just signed by first converting the `sighash_cache` into a [`Transaction`](https://docs.rs/bitcoin/0.31.1/bitcoin/blockdata/transaction/struct.Transaction.html) by using the [`into_transaction`](https://docs.rs/bitcoin/0.31.1/bitcoin/sighash/struct.SighashCache.html#method.into_transaction) method. @@ -337,7 +337,7 @@ This transaction is now ready to be broadcast to the Bitcoin network. [^change]: Please note that the `CHANGE_AMOUNT` is not the same as the `DUMMY_UTXO_AMOUNT` minus the `SPEND_AMOUNT`. This is due to the fact that we need to pay a fee for the transaction. -[^expect]: We will be unwraping any [`Option`](https://doc.rust-lang.org/std/option)/[`Result`](https://doc.rust-lang.org/std/result) +[^expect]: We will be unwrapping any [`Option`](https://doc.rust-lang.org/std/option)/[`Result`](https://doc.rust-lang.org/std/result) with the `expect` method. [^secp]: Under the hood we are using the [`secp256k1`](https://github.com/rust-bitcoin/rust-secp256k1/) crate to generate the key pair. @@ -346,4 +346,3 @@ This transaction is now ready to be broadcast to the Bitcoin network. [secp256k1](https://en.bitcoin.it/wiki/Secp256k1). [^spend]: And also we are locking the output to an address that we control: - the `wpkh` public key hash that we generated earlier. \ No newline at end of file diff --git a/cookbook/src/tx_taproot.md b/cookbook/src/tx_taproot.md index c813bef..a6a0d73 100644 --- a/cookbook/src/tx_taproot.md +++ b/cookbook/src/tx_taproot.md @@ -62,7 +62,7 @@ fn senders_keys(secp: &Secp256k1) -> Keypair { This will be useful to mock a sender. In a real application these would be actual secrets[^secp]. We use the `SecretKey::new` method to generate a random private key `sk`. -We then use the [`Keypair::from_secret_key`](https://docs.rs/bitcoin/0.31.1/bitcoin/key/struct.Keypair.html#method.from_secret_key) method to instatiate a [`Keypair`](https://docs.rs/bitcoin/0.31.1/bitcoin/key/struct.Keypair.html) type, +We then use the [`Keypair::from_secret_key`](https://docs.rs/bitcoin/0.32.0/bitcoin/key/struct.Keypair.html#method.from_secret_key) method to instantiate a [`Keypair`](https://docs.rs/bitcoin/0.32.0/bitcoin/key/struct.Keypair.html) type, which is a data structure that holds a keypair consisting of a secret and a public key. Note that `senders_keys` is generic over the [`Signing`](https://docs.rs/secp256k1/0.27.0/secp256k1/trait.Signing.html) trait. This is used to indicate that is an instance of `Secp256k1` and can be used for signing. @@ -320,7 +320,7 @@ It takes the following arguments: - `input_index` is the index of the input we are signing; it is a [`usize`](https://doc.rust-lang.org/std/primitive.usize.html) type. We are using `0` since we only have one input. -- `&prevouts` is a refence to the [`Prevouts`](https://docs.rs/bitcoin/0.31.1/bitcoin/sighash/enum.Prevouts.html) enum that we defined earlier. +- `&prevouts` is a reference to the [`Prevouts`](https://docs.rs/bitcoin/0.32.0/bitcoin/sighash/enum.Prevouts.html) enum that we defined earlier. This is used to reference the outputs of previous transactions and also used to calculate our transaction value. - `annex` is an optional argument that is used to pass the annex data. We are not using it, so we are passing `None`. @@ -337,9 +337,9 @@ We create the message `msg` by converting the `sighash` to a [`Message`](https:/ This is a the message that we will sign. The [Message::from](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.Message.html#impl-From%3C%26%27_%20bitcoin%3A%3Ahashes%3A%3Asha256d%3A%3AHash%3E) method takes anything that implements the promises to be a thirty two byte hash i.e., 32 bytes that came from a cryptographically secure hashing algorithm. -We compute the signature `sig` by using the [`sign_schnorr`](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.Secp256k1.html#method.sign_schnorr) method. -It takes a refence to a [`Message`](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.Message.html) and a reference to a [`Keypair`](https://docs.rs/secp256k1/0.27.0/secp256k1/struct.Keypair.html) as arguments, -and returns a [`Signature`](https://docs.rs/secp256k1/0.27.0/secp256k1/ecdsa/struct.Signature.html) type. +We compute the signature `sig` by using the [`sign_schnorr`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Secp256k1.html#method.sign_schnorr) method. +It takes a reference to a [`Message`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Message.html) and a reference to a [`Keypair`](https://docs.rs/secp256k1/0.29.0/secp256k1/struct.Keypair.html) as arguments, +and returns a [`Signature`](https://docs.rs/secp256k1/0.29.0/secp256k1/ecdsa/struct.Signature.html) type. In the next step, we update the witness stack for the input we just signed by first converting the `sighash_cache` into a [`Transaction`](https://docs.rs/bitcoin/0.31.1/bitcoin/blockdata/transaction/struct.Transaction.html) by using the [`into_transaction`](https://docs.rs/bitcoin/0.31.1/bitcoin/sighash/struct.SighashCache.html#method.into_transaction) method. @@ -356,7 +356,7 @@ This transaction is now ready to be broadcast to the Bitcoin network. [^change]: Please note that the `CHANGE_AMOUNT` is not the same as the `DUMMY_UTXO_AMOUNT` minus the `SPEND_AMOUNT`. This is due to the fact that we need to pay a fee for the transaction. -[^expect]: We will be unwraping any [`Option`](https://doc.rust-lang.org/std/option)/[`Result`](https://doc.rust-lang.org/std/result) +[^expect]: We will be unwrapping any [`Option`](https://doc.rust-lang.org/std/option)/[`Result`](https://doc.rust-lang.org/std/result) with the `expect` method. [^secp]: Under the hood we are using the [`secp256k1`](https://github.com/rust-bitcoin/rust-secp256k1/) crate to generate the key pair.