Contributing to Bitcoin ABC

The Bitcoin ABC project welcomes contributors!

This guide is intended to help developers contribute effectively to Bitcoin ABC.

Communicating with Developers

To get in contact with Bitcoin ABC developers, you can join the eCash Development Telegram group. The intent of this group is to facilitate development of Bitcoin ABC and other eCash node implementations. We welcome people who wish to participate.

Acceptable use of this group includes the following:

It is not for:

Bitcoin ABC Development Philosophy

Bitcoin ABC aims for fast iteration and continuous integration.

This means that there should be quick turnaround for patches to be proposed, reviewed, and committed. Changes should not sit in a queue for long.

Here are some tips to help keep the development working as intended. These are guidelines for the normal and expected development process. Developers can use their judgement to deviate from these guidelines when they have a good reason to do so.

Here are some handy links for development practices aligned with Bitcoin ABC:

Getting set up with the Bitcoin ABC Repository

  1. Create an account at reviews.bitcoinabc.org

  2. Install Git and Arcanist on your machine

To install these packages on Debian or Ubuntu, type: sudo apt-get install git arcanist

Git documentation can be found at git-scm.com.

For Arcanist documentation, you can read Arcanist Quick Start and the Arcanist User Guide.

The Phabricator version of Arcanist is unmaintained and does not work with PHP 8 or higher. This is an issue for Linux distributions such as Ubuntu 22.04. In this case, you can use the Phorge version of Arcanist instead.

  1. If you do not already have an SSH key set up, follow these steps:

Type: ssh-keygen -t ed25519 -C "[email protected]"

Enter a file in which to save the key (/home/username/.ssh/id_ed25519): [Press enter]

  1. Upload your SSH public key to https://reviews.bitcoinabc.org

Paste contents from: /home/*username*/.ssh/id_ed25519.pub

  1. Clone the repository and install Arcanist certificate:
git clone ssh://[email protected]:2221/source/bitcoin-abc.git

cd bitcoin-abc

arc install-certificate

Note: Arcanist tooling will tend to fail if your remote origin is set to something other than the above. A common mistake is to clone from Github and then forget to update your remotes.

Follow instructions provided by arc install-certificate to provide your API token.

Contributing to the node software

During submission of patches, arcanist will automatically run arc lint to enforce Bitcoin ABC code formatting standards, and often suggests changes. If code formatting tools do not install automatically on your system, you will have to install the following:

Install all the code formatting tools on Debian Bullseye (11) or Ubuntu 20.04:

sudo apt-get install python3-pip php-codesniffer shellcheck yamllint
pip3 install "black>=24.0" "isort>=5.6.4" "mypy>=0.910" "flynt>=0.78" "flake8>=5" flake8-comprehensions flake8-builtins
echo "export PATH=\"`python3 -m site --user-base`/bin:\$PATH\"" >> ~/.bashrc
source ~/.bashrc

If not available in the distribution, clang-format-12 and clang-tidy-12 can be installed from https://releases.llvm.org/download.html or https://apt.llvm.org.

For example, for macOS:

curl -L https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.0/clang+llvm-12.0.0-x86_64-apple-darwin.tar.xz | tar -xJv
ln -s $PWD/clang+llvm-12.0.0-x86_64-apple-darwin/bin/clang-format /usr/local/bin/clang-format
ln -s $PWD/clang+llvm-12.0.0-x86_64-apple-darwin/bin/clang-tidy /usr/local/bin/clang-tidy

If you are modifying a shell script, you will need to install the shellcheck linter. A recent version is required and may not be packaged for your distribution. Standalone binaries are available for download on the project’s github release page.

Note: In order for arcanist to detect the shellcheck executable, you need to make it available in your PATH; if another version is already installed, make sure the recent one is found first. Arcanist will tell you what version is expected and what is found when running arc lint against a shell script.

If you are running Debian 10, it is also available in the backports repository:

sudo apt-get -t buster-backports install shellcheck

If you are modifying Rust files, you will need to install a stable rust version, plus a nightly toolchain called “abc-nightly” for formatting:

# Install latest stable Rust version
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s
source ~/.cargo/env
rustup install nightly-2023-08-23
rustup component add rustfmt --toolchain nightly-2023-08-23
# Name the nightly toolchain "abc-nightly"
rustup toolchain link abc-nightly "$(rustc +nightly-2023-08-23 --print sysroot)"

Contributing to the web projects

To contribute to web projects, you will need nodejs > 16 and npm > 8.5.0. Follow these installation instructions to install nodejs with node version manager.

Then:

cd bitcoin-abc
[sudo] nvm install 16
[sudo] npm install -g npm@latest
[sudo] npm install -g [email protected]
[sudo] npm install -g eslint

Some repositories have a .nvmrc file which specifies the version of node expected. For example, to work in Cashtab,

cd bitcoin-abc/cashtab
nvm use

The specified version of nodejs will be installed and used.

To work on the extension, you will need browserify

[sudo] npm install -g browserify

Contributing to Electrum ABC

See the dedicated CONTRIBUTING.md document.

Working with The Bitcoin ABC Repository

A typical workflow would be:

You should add suggested reviewers and a test plan to the commit message. Note that Arcanist is set up to look only at the most-recent commit message, So all you changes for this Diff should be in one Git commit.

What to work on

If you are looking for a useful task to contribute to the project, a good place to start is the list of tasks at https://reviews.bitcoinabc.org/maniphest.

You could also try backporting some code from Bitcoin Core.

By contributing to this repository, you agree to license your work under the MIT license unless specified otherwise in contrib/debian/copyright or at the top of the file itself. Any work contributed where you are not the original author must contain its license header with the original author(s) and source.

Disclosure Policy

See DISCLOSURE_POLICY.