Simplified Exchange Integration Guide
This document explains how to integrate PascalCoin into your exchange via the JSON API.
In PascalCoin there are two types of digital assets that can be exchanged.
Most exchanges will only trade PASC and not PASA. PASC can be exchanged in the same way other cryptocurrencies are. However, trading PASA is different since they are non-fungible assets. This means that some PASA are more valuable than others, due to their desirable numbers and/or names. For PASA exchanges, an auction-style market is recommended, such as PascWallet.
In order to support large numbers of users, exchanges do not require a PASA for each user. They are able to integrated PascalCoin into their exchange using a single PASA owned by the exchange which acts as a custodian account for all their users.
User deposits can be identified via a Payload Code inside the deposit transaction.
Installing PascalCoin is simple and can be installed on Linux or Windows. Minimum requirements are 1GB RAM, 2 CPU's and at least 10GB of storage.
The server should be isolated from public network and have the following ports opened publically:
Locally but not publically, the following ports should be opened
After installing the software, set a wallet password. By default the password is an empty string. *You can programmatically add/change the wallet password via
setwalletpassword method. If using the GUI, use the Options menu.
In order to send/recieve PASC, you will need at least 1 key. This key will be associated to your exchange account (PASA).
On first run, PascalCoin will examine your wallet for keys and if none are found, it will add one for you.
You can also create a new key programatically using the
IMPORTANT PLEASE ENSURE YOUR WALLET AND KEYS ARE BACKED UP AT ALL TIMES.
NOTE: To programmatically determine the available keys in PascalCoin, you can use the
In order to receive deposits and send withdrawals, your exchange will require an account (PASA). Getting an account is easy, and you can use:
To accept deposits from users is easy. You need to instruct your users to include a PayloadCode inside their transaction to your exchange account. This PayloadCode can be used to identify the user.
Suppose the exchange account is 12345-67. All deposits and withdrawals operate through this account on the exchange.
The user database contains a unique PayloadCode for each user.
Once your exchange is operational, you need to scan for deposits using same sort of workflow you would use for other cryptocurrencies.
It can be done in many ways:
getaccountoperations: If you're working in only 1 account, this can be a good option. Just scan your account every few minutes (or seconds) to obtain all related operations. An example should be call
getaccountoperations with a
depth=10 and a
max=1000 and process received info
getblockoperations to scan what happened in a block and all related operations. If they match your account/s then update your info.
To know last blockchain block number, just call
It's important to decode correctly all received operations, that are returned as a "Operations Object": https://github.com/PascalCoin/PascalCoin/wiki/JSON-RPC-API#operation-object
One important difference is to support both PUBLIC or ENCRYPTED payload codes in deposit transactions. This is required because some users may encrypt their payload and others may not. For example, users who withdraw from Poloniex directly to their deposit address on your exchange will always contain encrypted payloads. However, deposits from wallet users may be public. In principle, it is up to the recipient to examine the payloads both in their raw public form and then in their decrypted form.
As a result, when processing user deposit transactions to your exchange, it is highly recommended that you:
First check if the Operation Payload matches your users deposit code. If it matches, then the deposit can be accepted otherwise proceed to (2).
Decrypt the payload using
unlock method (only one time) prior to call
payloaddecrypt, otherwise it will not be able to decrypt because wallet keys are locked.
Repeat (1) using the decrypted payload code from (2). If it matches then deposit is accepted otherwise the deposit is unrecognised.
With this approach you can ensure deposits are never missed and that support requests are minimised.
Also, Sphere 10 Software offers free technical support for exchange listings of PascalCoin.