You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Workspace with crates: `dash`, `hashes`, `internals`, `dash-network`, `dash-spv`, `key-wallet`, `rpc-*`, utilities (`fuzz`, `test-utils`), and FFI crates (`*-ffi`).
5
+
- Each crate keeps sources in `src/`; unit tests live alongside code with `#[cfg(test)]`. Integration tests use `tests/` (e.g., `rpc-integration-test`).
6
+
- Mobile SDK lives in `swift-dash-core-sdk/`; FFI bindings are in `*-ffi`. Shared helpers in `internals/` and `test-utils/`.
We're currently preparing to bump MSRV and **change the edition to 2018**.
6
-
To minimize the churn we recommend you to submit your local WIP changes ASAP.
7
-
There will be a lot of rebasing after the edition change.
5
+
Feature work targets the active `v**-dev` branch (development). Submit hotfixes and documentation-only changes to `master` unless maintainers direct otherwise.
8
6
9
7
:+1::tada: First off, thanks for taking the time to contribute! :tada::+1:
10
8
@@ -35,154 +33,78 @@ changes to this document in a pull request.
35
33
36
34
## General
37
35
38
-
The Rust Dash Core project operates an open contributor model where anyone is
39
-
welcome to contribute towards development in the form of peer review,
40
-
documentation, testing and patches.
36
+
We welcome contributions of all kinds: bug fixes, features, tests, docs, and reviews. This codebase powers Dash protocol libraries (networking, SPV, wallet, FFI). Changes must be reviewed with security and backward‑compatibility in mind.
41
37
42
-
Anyone is invited to contribute without regard to technical experience,
43
-
"expertise", OSS experience, age, or other concern. However, the development of
44
-
standards & reference implementations demands a high-level of rigor, adversarial
45
-
thinking, thorough testing and risk-minimization. Any bug may cost users real
46
-
money. That being said, we deeply welcome people contributing for the first time
47
-
to an open source project or pick up Rust while contributing. Don't be shy,
48
-
you'll learn.
49
38
39
+
## Communication
50
40
51
-
## Communication channels
52
-
53
-
Communication about Rust Bitcoin happens primarily in
54
-
[#bitcoin-rust](https://web.libera.chat/?channel=#bitcoin-rust) IRC chat on
55
-
[Libera](https://libera.chat/) with the logs available at
56
-
<https://gnusha.org/bitcoin-rust/> (starting from Jun 2021 and now on) and
57
-
<https://gnusha.org/rust-bitcoin/> (historical archive before Jun 2021).
58
-
59
-
Discussion about code base improvements happens in GitHub issues and on pull
60
-
requests.
61
-
62
-
Major projects are tracked [here](https://github.com/orgs/rust-bitcoin/projects).
63
-
Major milestones are tracked [here](https://github.com/rust-bitcoin/rust-bitcoin/milestones).
41
+
- Use GitHub Issues for bugs and feature requests.
42
+
- Use Pull Requests for code changes and design discussions.
43
+
- If enabled, GitHub Discussions can host broader design topics.
64
44
65
45
66
46
## Asking questions
67
47
68
-
> **Note:** Please don't file an issue to ask a question. You'll get faster
69
-
> results by using the resources below.
70
-
71
-
We have a dedicated developer channel on IRC, #bitcoin-rust@libera.chat where
72
-
you may get helpful advice if you have questions.
48
+
Prefer opening a GitHub Discussion (if enabled) or a clearly labeled issue. Provide context, reproduction steps, and what you’ve tried.
73
49
74
50
75
51
## Contribution workflow
76
52
77
-
The codebase is maintained using the "contributor workflow" where everyone
78
-
without exception contributes patch proposals using "pull requests". This
79
-
facilitates social contribution, easy testing and peer review.
80
-
81
-
To contribute a patch, the workflow is a as follows:
82
-
83
-
1. Fork Repository
84
-
2. Create topic branch
85
-
3. Commit patches
86
-
87
-
Please keep commits should atomic and diffs easy to read. For this reason
88
-
do not mix any formatting fixes or code moves with actual code changes.
89
-
Further, each commit, individually, should compile and pass tests, in order to
90
-
ensure git bisect and other automated tools function properly.
91
-
92
-
Please cover every new feature with unit tests.
93
-
94
-
When refactoring, structure your PR to make it easy to review and don't hesitate
95
-
to split it into multiple small, focused PRs.
53
+
We use the standard fork-and-PR model:
96
54
97
-
Commits should cover both the issue fixed and the solution's rationale.
98
-
Please keep these [guidelines](https://chris.beams.io/posts/git-commit/) in mind.
55
+
1. Fork the repository and create a topic branch.
56
+
2. Make focused commits; keep diffs minimal and self‑contained.
57
+
3. Ensure each commit builds and tests pass to keep `git bisect` meaningful.
58
+
4. Cover new functionality with tests and docs where applicable.
59
+
5. Open a PR early for feedback; keep the description clear and scoped.
99
60
100
-
To facilitate communication with other contributors, the project is making use
101
-
of GitHub's "assignee" field. First check that no one is assigned and then
102
-
comment suggesting that you're working on it. If someone is already assigned,
103
-
don't hesitate to ask if the assigned party or previous commenters are still
104
-
working on it if it has been awhile.
61
+
Commits should explain the why and the what. Conventional Commits are encouraged.
105
62
106
63
107
64
## Preparing PRs
108
65
109
-
The main library development happens in the `master` branch. This branch must
110
-
always compile without errors (using GitHub CI). All external contributions are
111
-
made within PRs into this branch.
66
+
Active development happens on `v**-dev` branches. Feature work should target the current `v**-dev`. The `master` branch is kept stable; submit hotfixes and documentation changes to `master` unless directed otherwise. All PRs must compile without errors (verified by GitHub CI).
112
67
113
68
Prerequisites that a PR must satisfy for merging into the `master` branch:
114
-
* each commit within a PR must compile and pass unit tests with no errors, with
115
-
every feature combination (including compiling the fuzztests) on some
116
-
reasonably recent compiler (this is partially automated with CI, so the rule
117
-
is that we will not accept commits which do not pass GitHub CI);
69
+
* each commit within a PR should compile and pass unit tests with no errors, with
70
+
relevant feature combinations (including building fuzz tests where applicable);
118
71
* the tip of any PR branch must also compile and pass tests with no errors on
119
-
MSRV (check [README.md] on current MSRV requirements) and pass fuzz tests on
120
-
nightly rust;
72
+
MSRV (see README for current MSRV) and run fuzz tests where applicable;
121
73
* contain all necessary tests for the introduced functional (either as a part of
122
74
commits, or, more preferably, as separate commits, so that it's easy to
123
75
reorder them during review and check that the new tests fail without the new
124
76
code);
125
-
* contain all inline docs for newly introduced API and pass doc tests;
126
-
* be based on the recent `master` tip from the original repository at
127
-
<https://github.com/rust-bitcoin/rust-bitcoin>.
128
-
129
-
NB: reviewers may run more complex test/CI scripts, thus, satisfying all the
130
-
requirements above is just a preliminary, but not necessary sufficient step for
131
-
getting the PR accepted as a valid candidate PR for the `master` branch.
132
-
133
-
PR authors may also find it useful to run the following script locally in order
134
-
to check that each of the commits within the PR satisfies the requirements
135
-
above, before submitting the PR to review:
136
-
```shell script
137
-
BITCOIN_MSRV=1.29.0 ./contrib/test.sh
138
-
```
139
-
Please replace the value in `BITCOIN_MSRV=1.29.0` with the current MSRV from
140
-
[README.md].
77
+
* include inline docs for newly introduced APIs and pass doc tests;
78
+
* be based on the recent tip of the target branch in this repository.
79
+
80
+
Reviewers may run additional scripts; passing CI is necessary but may not be sufficient for merge. To mirror CI locally:
New changes may format the code with `rustfmt`, but they should not re-format
183
-
any existing code for maintaining diff size small, keeping `git blame` intact and
184
-
reduce review time. Repository maintainers may not review PRs introducing large
185
-
blocks of re-formatted code.
107
+
Run `cargo fmt --all` before submitting PRs. Use `cargo clippy --workspace --all-targets -- -D warnings` to catch issues early. Avoid large, unrelated reformatting to keep diffs focused and `git blame` useful.
186
108
187
109
You may check the [discussion on the formatting](https://github.com/rust-bitcoin/rust-bitcoin/issues/172)
188
110
and [how it is planned to coordinate it with crate refactoring](https://github.com/rust-bitcoin/rust-bitcoin/pull/525)
@@ -192,55 +114,30 @@ avoid any end-line space characters.
192
114
193
115
### MSRV
194
116
195
-
The Minimal Supported Rust Version (MSRV) is 1.29; it is enforced by our CI.
196
-
Later we plan to increase MSRV to support Rust 2018 and you are welcome to check
197
-
the [tracking issue](https://github.com/rust-bitcoin/rust-bitcoin/issues/510).
117
+
The Minimal Supported Rust Version (MSRV) is 1.89; it is enforced by CI. Crates use mixed editions (2021/2024); consult `Cargo.toml` and README for details.
198
118
199
119
### Naming conventions
200
120
201
-
Naming of data structures/enums and their fields/variants must follow names used
202
-
in Bitcoin Core, with the following exceptions:
203
-
- the case should follow Rust standards (i.e. PascalCase for types and
204
-
snake_case for fields and variants);
205
-
- omit `C`-prefixes.
121
+
Use Rust standards: `UpperCamelCase` for types/traits, `snake_case` for modules/functions/variables, `SCREAMING_SNAKE_CASE` for constants. Prefer descriptive names matching Dash domain concepts.
206
122
207
123
### Unsafe code
208
124
209
-
Use of `unsafe` code is prohibited unless there is a unanimous decision among
210
-
library maintainers on the exclusion from this rule. In such cases there is a
211
-
requirement to test unsafe code with sanitizers including Miri.
125
+
Minimize `unsafe`. When required (especially across FFI boundaries), encapsulate it, document invariants, add tests, and consider Miri/sanitizers.
212
126
213
127
214
128
## Security
215
129
216
-
Security is the primary focus for this library; disclosure of security
217
-
vulnerabilities helps prevent user loss of funds. If you believe a vulnerability
218
-
may affect other implementations, please disclose this information according to
219
-
the [security guidelines](./SECURITY.md), work on which is currently in progress.
220
-
Before it is completed, feel free to send disclosure to Andrew Poelstra,
221
-
apoelstra@wpsoftware.net, encrypted with his public key from
222
-
<https://www.wpsoftware.net/andrew/andrew.gpg>.
130
+
This library is NOT suitable for consensus‑critical validation. Always validate inputs from untrusted sources and never log or store private keys. Report vulnerabilities privately via GitHub Security Advisories or by contacting the maintainers through a private channel.
223
131
224
132
225
133
## Testing
226
134
227
-
Related to the security aspect, rust bitcoin developers take testing very
228
-
seriously. Due to the modular nature of the project, writing new test cases is
229
-
easy and good test coverage of the codebase is an important goal. Refactoring
230
-
the project to enable fine-grained unit testing is also an ongoing effort.
231
-
232
-
Fuzzing is heavily encouraged: feel free to add related material under `fuzz/`
233
-
234
-
Mutation testing is planned; any contributions helping with that are highly
235
-
welcome!
135
+
Testing is a priority. Keep unit tests close to code and use `tests/` for integration. Add fuzz targets under `fuzz/` when appropriate. Use deterministic test vectors and avoid network dependencies unless explicitly required (mark such tests `#[ignore]`).
236
136
237
137
238
-
## Going further
138
+
## References
239
139
240
-
You may be interested in the guide by Jon Atack on
241
-
[How to review Bitcoin Core PRs](https://github.com/jonatack/bitcoin-development/blob/master/how-to-review-bitcoin-core-prs.md)
242
-
and [How to make Bitcoin Core PRs](https://github.com/jonatack/bitcoin-development/blob/master/how-to-make-bitcoin-core-prs.md).
243
-
While there are differences between the projects in terms of context and
244
-
maturity, many of the suggestions offered apply to this project.
140
+
- See README for workspace overview and MSRV.
141
+
- See CLAUDE.md and AGENTS.md for repo‑specific commands and workflows.
0 commit comments