Skip to content
This repository has been archived by the owner on Jun 15, 2021. It is now read-only.

Commit

Permalink
Update list-asset.adoc to reflect new process
Browse files Browse the repository at this point in the history
  • Loading branch information
cbeams committed Apr 5, 2018
1 parent b491fed commit c0e9ffc
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 52 deletions.
Binary file added exchange/howto/images/asset-hierarchy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
114 changes: 62 additions & 52 deletions exchange/howto/list-asset.adoc
Original file line number Diff line number Diff line change
@@ -1,84 +1,88 @@
= How to list a token
= How to list an asset
:toc:

== Introduction

This document describes the process how to submit a request for adding a new altcoin or token (we use the general term _token_ in this document) to the currency list in Bisq. Adding a token does not mean any endorsement of the token. For making decisions in case of controversial requests we use the Bisq DAO voting process. The maintainers of the GH repository have the authority to merge or reject the PR based on the formal requirements but not on "political" objections (e.g. if we consider the token to be a scam, etc).
This document describes the process for listing a new ("crypto") asset on the Bisq exchange. Anyone with sufficient technical skill to follow the instructions below can list any asset. There are no fees involved in this process.

Please note that Bisq is not implementing technically any token infrastructure, e.g. wallet, full node, block explorer, etc. Rather, we only support users adding a token address as a payment account that will be used to settle a trade for bitcoin. The process of sending and receiving the token is not part of the Bisq application; traders must use their own token wallets to perform the actual transfer.
Please note that Bisq does not implement any technical infrastructure for listed assets, such as wallets, full nodes, block explorers, etc. Rather, Bisq simply supports users adding an address for any listed asset as a _payment account_ that can be used to settle trades for bitcoin. The process of sending and receiving such asset payments, like the process of sending and receiving fiat payments, is not an integrated part of the Bisq application; traders must use their own wallet software to perform actual transfers for such assets.

NOTE: This document replaces the earlier process description in the link:https://bisq.community/t/how-to-add-your-favorite-Altcoin/46[Bisq forum].
NOTE: This document replaces the earlier process description in the link:https://bisq.community/t/how-to-add-your-favorite-Altcoin/46[Bisq forum] and the earlier document at https://bisq.network/list-token.


== Prerequisites

=== Block explorer
=== The asset must have an official block explorer

The token must have an active, publicly available block explorer.
The asset must have an active, publicly available block explorer.

=== The ticker symbol does not conflict with national currency tickers
=== The asset ticker symbol must not conflict with national currency tickers

The ticker symbol must not conflict with one of the national currency ISO 4217 ticker symbols listed at https://en.wikipedia.org/wiki/ISO_4217.

=== The ticker symbol does not conflict with other crypto-currency tickers
=== The asset ticker symbol must not conflict with other asset ticker symbols

The ticker symbol must not conflict with one of the top 100 cryptocurrency ticker symbols listed at: https://coinmarketcap.com/currencies at the time of PR creation.
The ticker symbol must not conflict with one of the top 100 cryptocurrency / crypto-asset ticker symbols listed at: https://coinmarketcap.com/currencies at the time of PR creation.

=== The token does not have extra requirements
=== The asset must not impose additional technical requirements

Be sure that the requirements to add the token does not cause extra effort for Bisq maintainers, e.g. requiring additional input fields because the address alone is not sufficient for a trade.
Be sure that the requirements to add the asset do not cause extra effort for Bisq maintainers, e.g. requiring additional input fields because the address alone is not sufficient for a trade.

=== Arbitrators must be able to look up transactions in the block explorer
=== Arbitrators must be able to look up transactions in the asset block explorer

The arbitrator must be able to look up transaction in the token's block explorer by using the receiver's address. In case that is not possible as a result of enhanced privacy features (Zcash, Monero, CryptoNote coins, etc) a suggested solution needs to be added to the PR (e.g. in Zcash we support only transparent addresses not z-addresses; in Monero we require that the user is using a Monero wallet which supports transaction keys to enable 3rd party audits of the transaction which is used in case of a dispute). As such additional cases require additional effort (popup with background info) it will be up to Bisq contributors whether to add a PR for the popup and translation strings. Of course the code or the popup can be part of the PR as well but a more detailed description is out of scope of this document.
A Bisq arbitrator must be able to look up transactions in the asset's block explorer by using the receiver's address. In case that is not possible as a result of enhanced privacy features e.g. in Zcash, Monero and CryptoNote coins, a suggested solution needs to be added to the asset listing pull request (e.g. in Zcash we support only transparent addresses not z-addresses; in Monero we require that the user is using a Monero wallet which supports transaction keys to enable 3rd party audits of the transaction which is used in case of a dispute). As such additional cases require additional effort (popup with background info) it will be up to Bisq contributors whether to add a pull request for the popup and translation strings. Of course the code or the popup can be part of the PR as well but a more detailed description is out of scope of this document.


== Instructions

IMPORTANT: Each of the classes below reside in the https://github.com/bisq-network/bisq-core repository. You will need to fork this repository, make the specified modifications, and then submit them as a SINGLE COMMIT within a SINGLE PULL REQUEST. Please DO NOT issue several pull requests by attempting to modify the sources one by one via the GitHub web UI. You need to have a competent developer make these changes and actually run the tests. *To be extra clear:* If you don't know what a "pull request" is, or have never created one yourself, please do not attempt to follow the instructions below on your own.
IMPORTANT: Each of the steps described below deal with code in the https://github.com/bisq-network/bisq-core repository. You will need to fork this repository, make the specified changes, and then submit those changes as a SINGLE COMMIT within a SINGLE PULL REQUEST. Please DO NOT issue several pull requests by attempting to modify the sources one by one via the GitHub web UI. You need to have a competent developer make these changes and actually run the tests. *To be extra clear:* If you are unfamiliar with Java, don't know what a "pull request" is, or have never created a pull request yourself, please do not attempt to follow the instructions below on your own.

=== Step 1. Add address validation logic
=== Step 1. Implement your asset

Add code for address validation to the `validate` method in `bisq.core.payment.validation.AltCoinAddressValidator` class.
[#asset-hierarchy]
.The `bisq.asset.Asset` type hierarchy
image::images/asset-hierarchy.png[Asset Hierarchy]

=== Step 2. Add address validation tests
All assets listed on the Bisq exchange ultimately implement the https://jitpack.io/com/github/bisq-network/bisq-core/-SNAPSHOT/javadoc/bisq/asset/Asset.html[`bisq.asset.Asset`] interface. Your asset implementation will need to extend the https://jitpack.io/com/github/bisq-network/bisq-core/-SNAPSHOT/javadoc/bisq/asset/Coin.html[`Coin`], https://jitpack.io/com/github/bisq-network/bisq-core/-SNAPSHOT/javadoc/bisq/asset/Token.html[`Token`] or https://jitpack.io/com/github/bisq-network/bisq-core/-SNAPSHOT/javadoc/bisq/asset/Erc20Token.html[`Erc20Token`] subtypes as appropriate.

Add unit tests with different addresses of the token to the `bisq.core.payment.validation.AltCoinAddressValidatorTest` class and *run the tests* to ensure they pass.
TIP: The links above point to Javadoc for each respective type. Read it!

=== Step 3. Add token to currency list
TIP: Look through existing concrete `Asset` implementations for one most similar to yours and use it as a baseline.

Add an entry for the token to the `createAllSortedCryptoCurrenciesList` method in the `bisq.core.locale.CurrencyUtil` class. The first parameter is the ticker, the second parameter is the token name and the optional third parameter is the boolean `isAsset` parameter. Set that to `true` in case the token is not using a dedicated blockchain but is issued on other blockchains (e.g. colored coins, ETH tokens, etc). The list is *ordered alphabetically by token name*—please add your entry at the correct position!
`Coin` implementations must be located within the `bisq.asset.coins` package. `Token` implementations must be located within the `bisq.asset.tokens` package.

==== Examples
For example, if you are listing a new `Coin` named `FooCoin`, its fully-qualified name should be `bisq.asset.coins.FooCoin`.

----
// token with dedicated blockchain
result.add(new CryptoCurrency("XMR", "Monero"));
TIP: Follow existing coding conventions. Everything from license headers to import statements to indentation and blank lines matters. Make your implementation look _exactly_ like the other `Asset` implementations you see.

// token issued on another blockchain
result.add(new CryptoCurrency("MT", "Mycelium Token", true));
----
=== Step 2. Register your asset

=== Step 4. Add token to trade statistics manager
Register your asset by adding an entry to the `META-INF/services/bisq.asset.Asset` provider-configuration file.

Open the `bisq.core.trade.statistics.TradeStatisticsManager` class and add an entry like the following at the end of the list in the `printAllCurrencyStats` method:
Entries in this file must be kept in alphabetical order.

----
newlyAdded.add([ticker symbol]);
----
=== Step 3. Write tests for your asset

=== Step 5. Compile and test
Create a new `AbstractAssetTest` subclass for your asset, named e.g. `FooCoinTest` and implement the required methods as appropriate.

TIP: Again, look to existing `AbstractAssetTest` implementations for a baseline as to how your own should look.

=== Step 4. Compile and test everything

Run the following command and ensure you get a successful result.

----
./gradlew build
[...]
BUILD SUCCESSFUL
----

=== Step 6. Create well-formed Git commit
=== Step 5. Create a well-formed Git commit

Your changes should be squashed into a SINGLE GIT COMMIT with a commit message that reads as follows:

----
List [token name] ([ticker symbol])
List [asset name] ([ticker symbol])
----

For example:
Expand All @@ -96,40 +100,46 @@ Date: Wed Aug 1 00:00:00 1979 -0800
List OtherPlane (OTP)
----

=== Step 7. Submit pull request
=== Step 6. Submit your pull request

Your pull request should be submitted against the bisq-network/bisq-core repository's `master` branch. Make sure you do this from a dedicated topic branch in your fork named, for example, `list-foo-token`. Do not submit your pull request directly from your `master` branch, as this can make things unnecessarily complex if and when there are merge conflicts.
Your pull request should be submitted against the bisq-network/bisq-core repository's `master` branch. Make sure you do this from a dedicated topic branch in your fork named, for example, `list-foo-asset`. Do not submit your pull request directly from your `master` branch, as this can make things unnecessarily complex if and when there are merge conflicts.

Copy and paste the form template below into the description of the pull request and fill it out.

----
- Official block explorer URL: [url]
- Is this an _altcoin_ with a dedicated blockchain or a _token_ based on another blockchain, (e.g. Ethereum-based ERC-20 tokens): [altcoin | token]
- Official project URL: [url]
- Official block explorer URL: [url]
----

IMPORTANT: When submitting your pull request, please check the `Allow edits from maintainers` box. See https://github.com/bisq-network/style/issues/4 for details.


== Caveats

=== Controversial tokens may be put to a vote
=== Controversial assets may be put to a vote

Accepting a request to list a given asset does not imply endorsement of that asset by Bisq maintainers, contributors or co-founders. Bisq maintainers merge or reject asset listing pull requests based strictly on the formal requirements laid out in this document, not on any political, legal or ethical grounds.

However, any BSQ stakeholder can request that listing a given asset be put to a vote under the normal Bisq DAO voting process.

If such a request for voting is filed, the PR will be delayed until the next voting period. Filing a request for voting is described at https://bisq.network/phase-zero.

If the vote has greater than 50% approval and reaches the required quorum (at least 5% of total BSQ stake need to vote on it) the result will be used to accept or reject the asset. Not reaching the quorum results in a rejection.

To request listing an asset that has already been rejected by such a vote, the requester must include a clear statement about what has changed since the original vote.

Any BSQ stakeholder can also request a vote to remove an already-listed asset.

- Any BSQ token holder can request that a decision for adding the token should be decided in the Bisq DAO voting process (the Bisq DAO will be executed in a manual manner as long the full DAO version is not implemented according to the DAO phase 0 doc TODO: add link, not available atm).
- If such a request for voting is filed the PR will be delayed until the next voting period. Filing a request for voting is described in the DOA voting document (TODO: add link, not available atm).
- If the voting has > 50% of votes and reaches the required quorum (at least 5% of total BSQ stake need to vote on it) the result will be used to accept or reject the token. Not reaching the quorum results in a rejection.
- For requesting again a token which got rejected by voting it requires a clear statement about the changed circumstances. Objecting the political positions is not sufficient (e.g. Coin XXX is not a scamcoin because of ....).
- Any BSQ token holder can also request a voting to remove an already supported token.
=== Inactive assets will be de-listed

=== Inactive tokens will be de-listed
At each new release we will check whether already-listed assets have been traded in the past 4 months. If this requirement is not met the asset will be removed. The Bisq trade statistics are used as a reference. Removal of an un-traded asset will not be announced outside of normal release notes.

- At each new release we will check if already added tokens have been traded in the past 4 months. If this requirement is not met the token will be removed. The Bisq trade statistics are taken as reference. Removal of a not-traded token will not be announced beside in the release notes of the new release.
- Adding the token again requires a statement about the changed circumstances (e.g. link to discussions where demand for the token is documented, etc).
Listing the asset again will require a statement about what has changed since the original de-listing, e.g.: links to discussions where demand for the asset is documented, etc.

=== Getting a new token into production may take a while
=== Getting a new asset into production may take a while

Adding a new token will be part of the normal release cycle. Whenever we ship the next Bisq release, your token will be included.
Whenever we ship the next Bisq release, your newly-listed asset will be included and become available for trading. We typically ship once every few weeks, but there is no fixed release schedule, and release intervals can vary widely.

=== Pull requests that do not conform to the requirements will be ignored and closed
=== Pull requests that do not conform to the requirements above will be rejected

If your pull request is for any reason incorrect, e.g. code does not compile, tests do not pass, steps have been missed in the instructions, your changes will be ignored and your pull request will be closed. Getting your token listed is 100% your responsibility. If you follow the instructions, the `bisq-core` maintainers will merge it; if you don't, they won't. It's that simple.
If your pull request is for any reason incorrect, e.g. code does not compile, tests do not pass, steps have been missed in the instructions, your changes will be ignored and your pull request will be closed. Getting your asset successfully listed is 100% your responsibility. If you follow the instructions, the `bisq-core` maintainers will merge it; if you don't, they won't. It's that simple.

0 comments on commit c0e9ffc

Please sign in to comment.