DERO Atlantis RPC API V2.0

1. Introduction

This document describes the RPC API for the DERO daemon and wallet which are implemented according to the JSON RPC 2.0 standard.

We will give a description of the available RPC methods with their parameters and results and provide code examples for calling the methods and the data returned.

DERO is the first crypto project to combine a Proof of Work blockchain with a DAG (Directed Acyclic Graph) block structure and wholly anonymous transactions. The fully distributed ledger processes transactions with a twelve-second average block time and is secure against majority hashrate attacks.

DERO will be the first CryptoNote blockchain to have smart contracts on its native chain without any extra layers or secondary blockchains.

For more information visit http://www.dero.io

1.1 Data Types

DERO is written in Go, so we give the data types of the parameters and results in Go format. It is pretty straightforward to convert them to other languages.

Amounts in DERO have a resolution of 112 decimals and are handled as unsigned 64 bit integers.

../_images/rpc1.png

As DERO combines DAG and Blockchain, it uses different height information than traditional blockchains. DERO blocks have an additional height value, called the topological height.

The topological height is unique for each block, while at each blockchain height there can be multiple blocks associated. Each blockchain height contains at least a main block and optional side blocks.

../_images/rpc2.png

1.2 Code Examples

The examples provided for each method are written in Python - using the ’request’ package to build the HTTP request and perform the JSON encoding.

../_images/rpc3.png

2. Quick Overview

../_images/rpc4.png
../_images/rpc5.png

3. DERO Daemon RPC Interface

3.1 Introduction

When launched, the Dero daemon automatically starts the RPC server interface at port 20206.

You can change the port by using the rpc-bind parameter:

../_images/rpc6.png

3.2 Methods via POST

Most RPC methods work by issuing HTTP POST requests and sending the parameters in the payload.

../_images/rpc7.png

3.2.1 getblockcount

The method “getblockcount” returns the height of the (currently synced) chain. This is also the currenty unstable height. This method is called without parameters

../_images/rpc8.png

3.2.2 get_info

The method “get_info” returns various info about the daemon and the state of the network. This method has no parameters.

../_images/rpc9.png
../_images/rpc10.png

3.2.3 getblocktemplate

Return a block template (used for mining a block).

../_images/rpc11.png

3.2.4 submitblock

Submits a processed blocktemplate_blob and blockhashing_blob to the daemon. The parameter is unnamed as the data is transmitted as array and accessed by-position (see https://www.jsonrpc.org/specification#parameter_structures).

../_images/rpc12.png

3.2.5 getlastblockheader

The method “getlastblockheader” returns the latest blockheader of the (currently synced) chain. This is equal to the top unstable height. This method is called without parameters.

../_images/rpc13.png
../_images/rpc14.png

3.2.6 getblockheaderbyhash

The method “getblockheaderbyhash” returns the blockheader for the supplied blocks hash.

../_images/rpc15.png

3.2.7 getblockheaderbytopoheight

The method “getblockheaderbytopoheight” returns the blockheader for the supplied topoheight.

../_images/rpc16.png

3.2.8 getblockheaderbyheight

The method “getblockheaderbyheight” returns the blockheader for the supplied blockchain topopplied blockchain topoheight, it does the same as the getblockheaderbytopoheight function.

../_images/rpc17.png

3.2.9 getblock

The method “getblock” returns the data of a block from either the given height or hash.

../_images/rpc18.png
../_images/rpc19.png

3.2.10 gettxpool

The method “gettxpool” returns the tx hashes that are currently in the mempool. This method has no parameters.

../_images/rpc20.png

3.3 Methods via GET

For compability reasons, some RPC methods work using HTTP GET requests. Thereby the method name is part of the URL and the parameters are transmitted in the payload.

../_images/rpc21.png

3.3.1 getheight

The method “getheight” returns the different heights of the blockchain. It is called without parameters.

../_images/rpc22.png

3.3.2 gettransactions

The method “gettransactions” returns the transaction data for a list of transaction IDs in hex and JSON format.

../_images/rpc23.png
../_images/rpc24.png

3.3.3 sendrawtransaction

The method “sendrawtransaction” takes a transaction as hex data and submits it into the mem-pool if valid. Various checks are performed to ensure the transaction is valid, however the boolean result fields are not used, so you have to check the “status” value.

../_images/rpc25.png

3.3.4 is_key_image_spent

The method “is_key_image_spent” is used to check the status of a list of key_images.

../_images/rpc26.png

4 DERO Wallet RPC Interface

4.1 Introduction

To the use the RPC interface, the wallet has to be started with the rpc-server function enabled:

../_images/rpc27.png

If your machine is accessible from the outside, you should setup a rpc login to access the wallet:

../_images/rpc28.png

The default port number for the wallet is 20209, but this can be also changed:

../_images/rpc29.png

Note: the Dero daemon has to also be started to sync up the wallet transactions.

4.2 Methods via POST

All wallet RPC methods work by issuing HTTP POST requests and sending the parameters in the payload.

../_images/rpc30.png

4.2.1 getaddress

The method “getaddress” method is used to the address from the wallet. This method has no parameters.

../_images/rpc31.png

4.2.2 getbalance

The method “getbalance” method is used to get the current balance and unlocked from the wallet. This method has no parameters.

../_images/rpc32.png

4.2.3 getheight

The method “getheight” method is used to get the currently synced blockchain height from the wallet. This method has no parameters.

../_images/rpc33.png

4.2.4 transfer

The method “transfer” method is used to create one or multiple transactions from a list of destinations. The optionally returned tx_key can used to prove that the amount was sent to the address using the Dero block explorer.

../_images/rpc34.png
../_images/rpc35.png

4.2.5 transfer_split

The method “transfer_split” is equal to the “transfer” method in 4.2.4 and kept for compatibility reasons.

../_images/rpc36.png

4.2.6 get_bulk_payments

The method “get_bulk_payments” is used to get a bulk of transactions from a list of payment IDs. Note: The method aborts if atleast one payment ID is not found/invalid.

../_images/rpc37.png

4.2.7 query_key

The method “query_key” is used to query either the secret key in mnemonic form or the view_key in hex form from the wallet.

../_images/rpc38.png

4.2.8 make_integrated_address

The method “make_integrated_address” is used to combine a payment_id and normal wallet address to create an integrated address.

../_images/rpc39.png

4.2.9 split_integrated_address

The method “split_integrated_address” is used to get the payment_id and normal wallet address from an integrated address.

../_images/rpc40.png

4.2.10 get_transfer_by_txid

The method “get_transfer_by_txid” is used to get transaction details for a specific transaction ID.

../_images/rpc41.png

4.2.11 get_transfers

The method “get_transfers” is used to get all out/ingoing transactions from a wallet. You can use the min_height and max_height parameters to narrow down the scope.

../_images/rpc42.png

For DERO RPC API please click here