About

The Background

It is "common wisdom" now that Bitcoin is to be treated as an Asset, and that gains from trading in it be treated as Capital Gains for taxation purposes. This view has support from regulatory pronouncements in countries like Norway, USA etc., and also some pretty solid looking legal advice from a few leading lawyers who have taken a very deep look at the problem from an India-specific perspective as well.

The App

Given the above situation it will be good to have a tool that allows traders to compute their gains / losses from Bitcoin trades, and the resulting Income Tax liability. This is the problem CoinsecureCG aims to do. This app pulls your trades history using the Coinsecure API and compute your Gains. Computing the actual tax burden on the computed Gain is left an exercise for the user.

This is my submission for the July Hackathon run by Coinsecure, an Indian Bitcoin exchange. The app is hosted on Google Appengine, and uses Coinsecure's API to build useful reports for traders using the Coinsecure Exchange. The code powering this application is open sourced under the Affero GPL v3, and available on Github.

The Author

My name is Sriram Karra; you can find more about me on Github, Google+, LinkedIn, and Twitter . In short, I have a day job as a Product Manager at an exciting startup. I program for fun in my spare time and recently started dabbling with Bitcoin. You can find me as user gowron on Bitcointalk

Features

Three main features are available, and can be accessed through the top navigation bar.
  1. Transactions: View your transaction history in a neat summary
  2. Capital Gains - Actual: Find out your Capital Gains for sell transactions in any given date range. This can be useful for computing your tax liability, for e.g.
  3. Capital Gains - Projection: This is useful to identify your gain and resulting tax liability if you plan to sell part of your holding right now or in the future.

What you need

All features access the Coinsecure testnet instance, you will need an account and an API Key on the testnet instance. Head over there if you'd like to create a test account and fetch an API Key. At a later time this app may be ported over to use production data from Coinsecure.

Frequently Asked Questions

  1. I got the right API Key from Coinsecure, but it does not work. Why is that?
    All features access the Coinsecure testnet instance, you will need an account and an API Key on the testnet instance. Head over there if you'd like to create a test account and fetch an API Key. At a later time this app may be ported over to use production data from Coinsecure.
  2. I don't have the time to create a new account. Can you just show me how it works?
    If you use the apikey 'test' (without quotes) the app will pick up some pre-generate randomised dummy data for demo purposes. You can use the test api key in all three tabs of the application.
  3. How do you compute the Capital Gains?
    The logic is a simple FIFO based match of the Buy transactions against Sell transactions. In the Capital Gains tabs you will find a detailed list of paired transactions. Note that depending on the actual Buys and Sells, one Sell may get matched to multiple Buys, and one Buy may get matched to more than one Sell txn.
  4. How do you classify gains as long term or short term?
    After applying the simple FIFO matching logic if the Sell date for a matched transaction is 3 or more years after the matching Buy transaction, it is considered a Long Term Gain. Otherwise it is taken as a Short Term Gain. This is based on the prevailing tax rules for assets that are not Securities on which STT has been paid.
  5. Can I change the Threshold to some other value for computing the capital gains?
    Yes, it is possible, but some manual work is involved. Send an additional GET parameter ltg_threshold=1 by editing the URL in the /cgActual page. But note that you can only specify a single number that denotes years - so you cannot set it to less than one year.
  6. The CG computation is great, but can I just get the raw data for me to build my own UI?
    Yes, it is possible, but some manual work is involved. Send an additional GET parameter debug=True by editing the URL in the /cgActual and /cgProj pages.
  7. What can you tell me about the security / privacy of my trading data?
    Your API Key, your trades history and such personal information are not stored on the server. The form fields are saved to your browser's localStorage. Some data is tracked for analytics, for e.g. number of different actions performed by a user and stored after doing a double-sha256 of your API Key. In sum, your data is safe. If you are paranoid you can view the source. If you are really paranoid you can host the code yourself on GAE.