Inside Bitcoin
Opening the selected file…
Inside Bitcoin
Opening the selected file…
The code behind the network, with room to understand it.
Release published 2026-10-28 · Snapshot fetched 2026-11-01. Latest stable release at fetch time; development branches and Git history are excluded. Only the selected code window and visible folders load here.
1Tooling for verification of PGP signed commits2----------------------------------------------4This is an incomplete work in progress, but currently includes a pre-push hook5script (`pre-push-hook.sh`) for maintainers to ensure that their own commits6are PGP signed (nearly always merge commits), as well as a Python 3 script to verify7commits against a trusted keys list.10Using verify-commits.py safely11------------------------------13Remember that you can't use an untrusted script to verify itself. This means14that checking out code, then running `verify-commits.py` against `HEAD` is15_not_ safe, because the version of `verify-commits.py` that you just ran could16be backdoored. Instead, you need to use a trusted version of verify-commits17prior to checkout to make sure you're checking out only code signed by trusted18keys:20```sh21git fetch origin && \22./contrib/verify-commits/verify-commits.py origin/master && \23git checkout origin/master24```26Note that the above isn't a good UI/UX yet, and needs significant improvements27to make it more convenient and reduce the chance of errors; pull-reqs28improving this process would be much appreciated.30Unless `--clean-merge 0` is specified, `verify-commits.py` will attempt to verify that31each merge commit applies cleanly (with some exceptions). This requires using at least32git v2.38.0.34Configuration files35-------------------37* `trusted-git-root`: This file should contain a single git commit hash which is the first unsigned git commit (hence it is the "root of trust").38* `trusted-sha512-root-commit`: This file should contain a single git commit hash which is the first commit without a SHA512 root commitment.39* `trusted-keys`: This file should contain a \n-delimited list of all PGP fingerprints of authorized commit signers (primary, not subkeys).40* `allow-revsig-commits`: This file should contain a \n-delimited list of git commit hashes. See next section for more info.42Import trusted keys43-------------------44In order to check the commit signatures, you must add the trusted PGP keys to your machine. [GnuPG](https://gnupg.org/) may be used to import the trusted keys by running the following command:46```sh47gpg --keyserver hkps://keys.openpgp.org --recv-keys $(<contrib/verify-commits/trusted-keys)48```50Key expiry/revocation51---------------------53When a key (or subkey) which has signed old commits expires or is revoked,54verify-commits will start failing to verify all commits which were signed by55said key. In order to avoid bumping the root-of-trust `trusted-git-root`56file, individual commits which were signed by such a key can be added to the57`allow-revsig-commits` file. That way, the PGP signatures are still verified58but no new commits can be signed by any expired/revoked key. To easily build a59list of commits which need to be added, verify-commits.py can be edited to test60each commit with BITCOIN_VERIFY_COMMITS_ALLOW_REVSIG set to both 1 and 0, and61those which need it set to 1 printed.
Independent explanations by MyBitcoinExplorer. Not affiliated with or endorsed by Bitcoin Core. Guides are educational and do not replace the source or its tests.
Bitcoin Core source © its contributors, distributed under the MIT license. Original notices and bundled third-party licenses are retained in the source tree.