DEV Community

Cover image for RP2: Open-source, Privacy-focused Crypto Tax Software
eprbell
eprbell

Posted on • Updated on

RP2: Open-source, Privacy-focused Crypto Tax Software

Table of Contents

Introduction

RP2 is a privacy-focused, free, non-commercial, open-source US cryptocurrency tax calculator that is up to date for Fiscal Year 2021. Preparing crypto taxes can be a daunting and error-prone task, especially if multiple transactions, coins, exchanges and wallets are involved. This task could be delegated to a crypto tax preparation service, but many crypto users value their privacy and prefer not to send their transaction information to third parties unnecessarily. Additionally, many of these services cost money. RP2 solves all of these problems:

  • it manages the complexity related to coin flows and tax calculation and it generates data that accountants can understand (in the format of form 8949), even if they are not cryptocurrency experts;
  • it prioritizes user privacy by storing crypto transactions and tax results on the user's computer and not sending them anywhere else;
  • it's free and open-source.

Another unique advantage of RP2 is transparent computation: it generates full computation details for every lot fraction, so that it's possible to verify step-by-step how RP2 reaches the final result.

RP2 supports the FIFO and LIFO accounting methods, to help minimize the amount due.

It reads in a spreadsheet containing crypto transactions. The spreadsheet can be generated either manually or automatically using DaLI, a RP2 data loader and input generator (which is also privacy-focused, free and open-source). After parsing the input, RP2 uses high-precision math to calculate long/short term capital gains, cost bases, balances, average price, in/out lot relationships/fractions, and finally it generates output spreadsheets.

RP2 has a programmable plugin architecture for output generators, accounting methods and countries. The output generator builtin plugins are US-specific, but RP2's architecture makes it possible to contribute additional generators for different countries or for different US-based cases.

Similarly DaLI has its own programmable plugin architecture for data loaders (both CSV and REST-based).

How RP2 Operates

RP2 has been designed to have expressive primitives that can be used as building blocks for most tax scenarios: complex tax events can be described with patterns, built using these primitives (see the FAQ list for examples, particularly the DeFi-related ones).

RP2 treats virtual currency as property for tax purposes, as per IRS Virtual Currency Guidance.

RP2 supports the FIFO and LIFO accounting methods: however, in and out lots typically don't have matching amounts, so RP2 fractions them, maps in/out lot fractions and computes the resulting cost basis and capital gains for each lot fraction.

RP2 groups lot fractions into the following taxable event categories, each of which has a specific tax treatment:

  • AIRDROP: gains from airdrops;
  • DONATE: donations to charitable organizations;
  • FEE: fee-only transaction, used in some DeFi scenarios (e.g. gas fee for running certain smart contracts);
  • GIFT: gifts to parties who are not charitable organizations (not tax-deductible).
  • HARDFORK: gains from hard forks;
  • INCOME: gains from miscellaneous income (e.g. Coinbase Earn);
  • INTEREST: gains from interest;
  • MINING: gains from mining;
  • MOVE: the fee for moving currency between two accounts controlled by the same owner;
  • SELL: specifically, sale and exchange of one cryptocurrency for another. RP2 splits them in two subcategories:
    • long-term capital gains, if the lot was held for more than 1 year, or
    • short-term capital gains otherwise;
  • STAKING: gains from staking;
  • WAGES: income from crypto wages.

For each of these categories RP2 generates an output spreadsheet with transaction details and computed gains/losses (see Input and Output Files for more details). Users can give this output to their tax preparer with the rest of their tax documentation (see also FAQ on which tax forms to file).

Call for Coders

Help us expand RP2 and DaLI's functionality!

RP2 is the first component of what could be a powerful, community-driven suite of open-source, privacy-focused, crypto tax software. It is intended as the core of a larger project ecosystem, maintained by the community. These projects can extend RP2 and DaLI's capability, usefulness and ease of use in new ways. For example:

  • DaLI data loader plugins: add support for more exchanges and wallets (via REST API and/or CSV files). DaLI, the RP2 data loader, uses them to generate an input ODS file and a config file that can be fed directly to RP2;
  • RP2 plugins: RP2 can be expanded via its programmable plugin architecture, which enables support for new output generators, countries and accounting methods;
  • RP2 GUI: make RP2 more user-friendly and accessible to people who are not familiar with the CLI;
  • RP2 high-level interface: RP2 captures complex tax events using a few powerful, low-level primitives, aggregated in patterns. A higher level tool might abstract out these patterns and present them to the user in a friendlier way (for example it may capture a complex concept like DeFi bridging as a primitive, rather than a pattern);
  • more...

If you'd like to start an ecosystem project, please open an issue to let the RP2 community know.

Discussion (0)