Dash API and its usage

Dash API and its usage


Crypto APIs Team

Feb 18, 2020 • 3 min

Dash – Digital Cash is one of the most highlighted alternative coins to Bitcoin, and thus so is Dash API. It was built upon its core code and it offered several attractive features to cryptocurrency enthusiasts. Its model involving “Masternodes” apparently lead to better privacy and higher transaction speeds than Bitcoin. And the APIs that connect to Dash give the needed leverage to use the blockchain effectively.

How does “Masternodes” model help?

Similarly to Bitcoin, the system consists of miners (check our glossary). However, Masternodes are added to the network as special servers that execute the core functions of those added features. They contain a full copy of the Dash blockchain.

As noted, Bitcoin has a full transparency on the transactions’ history and participants. Masternodes in Dash aim to increase privacy and security through the PrivateSend service by making the history untraceable.

In addition, Bitcoin takes an average of 10 minutes for a transaction to be completed. In Dash blockchain, that transactions is minimized to 2.5 minutes through InstantSend service, again facilitated by Masternode network. If the user wants to decrease that time furthermore, a small fee accomplishes that for a few seconds.

The reward’s proportions of the network is divided like such:

  • - 45% goes to Miner
  • - 45% goes to Masternode
  • - 10% goes to the network for further improvements

Noticeably, this blockchain has become popular for several reasons and its thought to have a high potential for the future. So Crypto APIs through Dash API wants to motivate interested developers and enterprises into becoming participants without much needed. Here are a few endpoints that Dash API can be used to help the process, especially in transactions.

Dash API – Get Transactions Fee

Through Dash API, Transactions Fee Endpoint gives information about the fees (in Dash) for all transactions included in the last 70 blocks. 

  • - min shows the lowest fee, 
  • - max is the highest
  • - average – the average fee
  • - recommended is the fee that we consider as the one that corresponds to a cheap and fast execution
  • - average_bytes represents the average size of the transactions in bytes and is used for the calculations of the recommended fee price.

The GET request expects a response such as:

“payload”: {
  “min”: “0.00000226”,
  “max”: “0.00046074”,
  “average”: “0.00001464”,
  “min_fee_per_byte”: “0.00000001”,
  “average_fee_per_byte”: “0.00000001”,
  “max_fee_per_byte”: “0.0000006”,
  “unit”: “dash”}

Dash API – Get Transactions Size

Dash API provides an endpoint where you can get the size of your transaction in bytes. The user is able to calculate the approximate size of a standard transaction.

Required fields are: { “inputs”: [{ “address”: “…”, “value”: … }, …], “outputs”: [{ “address”: “…”, “value”: … }, …], “fee”: { “address”: “…”, “value”: … } }

The POST request expects a response such as:

{“tx_size_bytes”: 167}

Dash API – Refund Transactions

Through Dash API. the Refund Transaction Endpoint allows users easily to return the amount in dash they have received from an unknown source. Only two fields are required: the txid of the transcation and the wif of the recipient address. There is an optional field fee. If fee field is not set the system will set the recommended fee from the Transaction Fee Endpoint, which is explained above.

The POST request expects a response such as:

“payload”: {“txid”:”e6ecdb73025b0ce3ef30b694003a2a1ab8fdc5cc3d7edd7cb618113dc783aaf3″}

Note: The Refund Transaction Endpoint works only if the provided transaction has only one recipient! The only exclusion is if an input address is receiving the change (participates as an output address as well).

In conclusion, these are a few examples of how endpoints help in integrating the Dash API into your website. They provide the backbone into the complete process of participating in this Dash blockchain.

Read more on our docs on Dash API.

Related articles