Developers guide:Contributing

From Trezor Wiki
Jump to: navigation, search


You would like to contribute to Trezor firmware? Great!

Adding a small feature or a fix[edit]

If your change is somewhat subtle, feel free to file a PR in one of the appropriate repositories directly. See the PR requirements noted at the bottom of this page.

Adding a new coin[edit]

Forks and derivatives[edit]

If the coin you are adding is a fork of Bitcoin or other cryptocurrency we already support (in other words, new app is not needed) you can modify the definitions in the trezor-firmware repository. The location depends on the type of the asset to be added:

Other[edit]

If you plan to add a new cryptocurrency, which needs its own app, please follow these instructions:

Create an issue in trezor-firmware stating which coin you plan to add where you state:

  • What is the approximate scale? Have a look at the other apps and try to compare your new app with one of those present in the terms of scale.
  • Do we need any new cryptographic primitives to support this coin?
  • Is there (or will you develop) a frontend wallet that will support Trezor with this coin?
  • Provide links to relevant developer documentation, esp. about address format and transaction signing
  • Provide a link to a transaction explorer

We will review this issue and give feedback. We either confirm that we would like to have this coin in the firmware and give you a go-ahead or we might decline. Please note that it is not possible to merge each and every coin. Using this workflow we would like to ensure you are not spending time on developing code we will later decline.

Also note that at this time, we do not accept submissions for coins that are not in the Top 30 by market cap.

If you do not create this issue, be aware that we will most likely reject your PR.

If we agree on accepting the coin, you can start developing a pull request. Every submission should contain at least these four components:

If you need to add new protobuf messages, these can be found in common/protob directory.

In general, it is a good idea to get inspired by the past Pull requests for other coins. Note that the examples here are split into individual PRs against different repos. We have since switched to monorepo model, so you can get all the changes in a single pull request.

Pull request requirements[edit]

Each PR needs to fulfill the following criteria:

  • Tests on CI must pass.
  • The code is properly formatted (`make style`).
  • Commits must have concise commit messages, the imperative mood is preferred (rationale).
  • Multiple commits per PR are allowed, but please do not use reverts etc. Use interactive rebase.
  • Do not use merge (e.g. merge trezor/master into...). Again, use rebase.
Like Trezor? Get one here!