Inside Bitcoin
Opening the selected file…
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.
1Contributing to Bitcoin Core2============================4The Bitcoin Core project operates an open contributor model where anyone is5welcome to contribute towards development in the form of peer review, testing6and patches. This document explains the practical process and guidelines for7contributing.9First, in terms of structure, there is no particular concept of "Bitcoin Core10developers" in the sense of privileged people. Open source often naturally11revolves around a meritocracy where contributors earn trust from the developer12community over time. Nevertheless, some hierarchy is necessary for practical13purposes. As such, there are repository maintainers who are responsible for14merging pull requests, the [release cycle](/doc/release-process.md), and15moderation.17Getting Started18---------------20New contributors are very welcome and needed.22If you use AI tools while contributing, please read and follow the [AI23policy](/doc/AI_POLICY.md). Contributors are responsible for understanding and24explaining their own work in their own words.26In-depth reviewing and testing are the bottleneck of the project, and are the27most effective way anyone can start to contribute. It will teach you much more28about the code and process than opening pull requests, and may help you uncover29related issues and follow-ups to contribute code for. Please refer to the [peer30review](#peer-review) section below.32Before you start contributing, familiarize yourself with the Bitcoin Core build33system and tests. Refer to the documentation in the repository on how to build34Bitcoin Core and how to run the unit tests, functional tests, and fuzz tests.36You may also participate in the [Bitcoin Core PR Review Club](https://bitcoincore.reviews/).38Communication Channels39----------------------41Most communication about Bitcoin Core development happens on IRC, in the42`#bitcoin-core-dev` channel on Libera Chat. The easiest way to participate on IRC is43with the web client, [web.libera.chat](https://web.libera.chat/#bitcoin-core-dev). Chat44history logs can be found45on [https://www.erisian.com.au/bitcoin-core-dev/](https://www.erisian.com.au/bitcoin-core-dev/)46and [https://gnusha.org/bitcoin-core-dev/](https://gnusha.org/bitcoin-core-dev/).48Discussion about codebase improvements happens in GitHub issues and pull49requests.51The developer52[mailing list](https://groups.google.com/g/bitcoindev)53should be used to discuss complicated or controversial consensus or P2P protocol changes before working on54a patch set.55Archives can be found on [https://gnusha.org/pi/bitcoindev/](https://gnusha.org/pi/bitcoindev/).58Contributor Workflow59--------------------61The codebase is maintained using the "contributor workflow" where everyone62without exception contributes patch proposals using "pull requests" (PRs). This63facilitates social contribution, easy testing and peer review.65Pull request authors must fully and confidently understand their own changes66and must have tested them. Contributors should mention which tests cover their67changes, or include the manual steps they used to confirm the change.68Contributors are expected to be prepared to clearly motivate and explain their69changes. If there is doubt, the pull request may be closed.70Please refer to the [peer review](#peer-review) section below for more details.72To contribute a patch, the workflow is as follows:741. Fork repository ([only for the first time](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/fork-a-repo))751. Create topic branch761. Commit patches78For GUI-related issues or pull requests, the https://github.com/bitcoin-core/gui repository should be used.79For all other issues and pull requests, the https://github.com/bitcoin/bitcoin node repository should be used.81The master branch for all monotree repositories is identical.83As a rule of thumb, everything that only modifies `src/qt` is a GUI-only pull84request. However:86* For global refactoring or other transversal changes the node repository87should be used.88* For GUI-related build system changes, the node repository should be used89because the change needs review by the build systems reviewers.90* Changes in `src/interfaces` need to go to the node repository because they91might affect other components like the wallet.93For large GUI changes that include build system and interface changes, it is94recommended to first open a pull request against the GUI repository. When there95is agreement to proceed with the changes, a pull request with the build system96and interfaces changes can be submitted to the node repository.98The project coding conventions in the [developer notes](doc/developer-notes.md)99must be followed.101### Committing Patches103In general, [commits should be atomic](https://en.wikipedia.org/wiki/Atomic_commit#Atomic_commit_convention)104and diffs should be easy to read. For this reason, do not mix any formatting105fixes or code moves with actual code changes.107Make sure each individual commit is hygienic: that it builds successfully on its108own without warnings, errors, regressions, or test failures.109See the [developer notes](doc/developer-notes.md#commit-structure-for-tests)110for guidance on where test coverage belongs in a commit stack.112Commit messages should be verbose by default consisting of a short subject line113(50 chars max), a blank line and detailed explanatory text as separate114paragraph(s), unless the title alone is self-explanatory (like "Correct typo115in init.cpp") in which case a single title line is sufficient. Commit messages should be116helpful to people reading your code in the future, so explain the reasoning for117your decisions. Further explanation [here](https://cbea.ms/git-commit/).119If a particular commit references another issue, please add the reference. For120example: `refs #1234` or `fixes #4321`. Using the `fixes` or `closes` keywords121will cause the corresponding issue to be closed when the pull request is merged.123Commit messages should never contain any `@` mentions (usernames prefixed with "@").125Please refer to the [Git manual](https://git-scm.com/doc) for more information126about Git.128- Push changes to your fork129- Create pull request131### Creating the Pull Request133The title of the pull request should be prefixed by the component or area that134the pull request affects. Valid areas are:136- `consensus` for changes to consensus critical code137- `doc` for changes to the documentation138- `qt` or `gui` for changes to bitcoin-qt139- `log` for changes to log messages140- `mining` for changes to the mining code141- `net` or `p2p` for changes to the peer-to-peer network code142- `refactor` for structural changes that do not change behavior143- `rpc`, `rest` or `zmq` for changes to the RPC, REST or ZMQ APIs144- `contrib` or `cli` for changes to the scripts and tools145- `test`, `qa` or `ci` for changes to the unit tests, QA tests or CI code146- `util` or `lib` for changes to the utils or libraries147- `wallet` for changes to the wallet code148- `build` for changes to CMake149- `guix` for changes to the GUIX reproducible builds151Examples:153consensus: Add new opcode for BIP-XXXX OP_CHECKAWESOMESIG154net: Automatically create onion service, listen on Tor155qt: Add feed bump button156log: Fix typo in log message158The body of the pull request should contain sufficient description of *what* the159patch does, and even more importantly, *why*, with justification and reasoning.160You should include references to any discussions (for example, other issues or161mailing list discussions).163The description for a new pull request should not contain any `@` mentions. The164PR description will be included in the commit message when the PR is merged and165any users mentioned in the description will be annoyingly notified each time a166fork of Bitcoin Core copies the merge. Instead, make any username mentions in a167subsequent comment to the PR.169### Translation changes171Note that translations should not be submitted as pull requests. Please see172[Translation Process](/doc/translation_process.md)173for more information on helping with translations.175### Work in Progress Changes and Requests for Comments177If a pull request is not to be considered for merging (yet), please178prefix the title with [WIP] or use [Tasks Lists](https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax#task-lists)179in the body of the pull request to indicate tasks are pending.181### Address Feedback183At this stage, one should expect comments and review from other contributors. You184can add more commits to your pull request by committing them locally and pushing185to your fork.187You are expected to reply to any review comments before your pull request is188merged. You may update the code or reject the feedback if you do not agree with189it, but you should express so in a reply. If there is outstanding feedback and190you are not actively working on it, your pull request may be closed.192Please refer to the [peer review](#peer-review) section below for more details.194### Squashing Commits196If your pull request contains fixup commits (commits that change the same line of code repeatedly) or too fine-grained197commits, you may be asked to [squash](https://git-scm.com/docs/git-rebase#_interactive_mode) your commits198before it will be reviewed. The basic squashing workflow is shown below.200git checkout your_branch_name201git rebase -i HEAD~n202# n is normally the number of commits in the pull request.203# Set commits (except the one in the first line) from 'pick' to 'squash', save and quit.204# On the next screen, edit/refine commit messages.205# Save and quit.206git push -f # (force push to GitHub)208Please update the resulting commit message, if needed. It should read as a209coherent message. In most cases, this means not just listing the interim210commits.212If your change contains a merge commit, the above workflow may not work and you213will need to remove the merge commit first. See the next section for details on214how to rebase.216Please refrain from creating several pull requests for the same change.217Use the pull request that is already open (or was created earlier) to amend218changes. This preserves the discussion and review that happened earlier for219the respective change set.221The length of time required for peer review is unpredictable and will vary from222pull request to pull request.224### Rebasing Changes226When a pull request conflicts with the target branch, you may be asked to rebase it on top of the current target branch.228git fetch https://github.com/bitcoin/bitcoin # Fetch the latest upstream commit229git rebase FETCH_HEAD # Rebuild commits on top of the new base231This project aims to have a clean git history, where code changes are only made in non-merge commits. This simplifies232auditability because merge commits can be assumed to not contain arbitrary code changes. Merge commits should be signed,233and the resulting git tree hash must be deterministic and reproducible. The script in234[/contrib/verify-commits](/contrib/verify-commits) checks that.236After a rebase, reviewers are encouraged to sign off on the force push. This should be relatively straightforward with237the `git range-diff` tool explained in the [productivity238notes](/doc/productivity.md#diff-the-diffs-with-git-range-diff). To avoid needless review churn, maintainers will239generally merge pull requests that received the most review attention first.241Pull Request Philosophy242-----------------------244Patchsets should always be focused. For example, a pull request could add a245feature, fix a bug, or refactor code; but not a mixture. Please also avoid super246pull requests which attempt to do too much, are overly large, or overly complex247as this makes review difficult.250### Features
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.