NAV Navbar
cli
  • Introduction
  • Getting Started
  • XBridge APIBETA
  • XRouter APIBETA
  • Changelog
  • Introduction

    Blocknet provides a simple and powerful API to build previously impossible multi-chain applications that consume services on compatible blockchains, all while remaining 100% trustless and decentralized.

    The API is accessible through command line(cli) with additional endpoints on the way. Code examples can be viewed in the dark panels next to each respective API call.

    Please see Getting Started to begin using the APIs or continue reading below to learn more about the Blocknet Protocol, the different components, and how they all work.

    Blocknet Protocol

    Blocknet is an interoperability protocol that can be used as a 2nd layer on any compatible blockchain to enable decentralized communication and exchange between different blockchains in a permissionless and trustless manner. Blockchain interoperability comes in 2 parts: exchange(XBridge) and communication(XRouter).

    The protocol is supported by a network of Service Nodes, which are similar to masternodes with an increased level of participation. Service Node host full nodes of the blockchains the protocol is compatible with, manage and cross-verify the orderbooks, verify interactions between peers, route communication between blockchains, and participate in governance by voting.

    XBridge

    XBridge provides the ability to perform atomic swap exchanges between any coin that is supported by the Blocknet Protocol via APIs. When paired with XRouter, any application can perform exchanges between any compatible blockchains using SPV. The entire process is done in a trustless manner by decentralizing the storage of funds, orderbooks, order matching, and asset exchange:

    [1] ACCT using Check Lock Time Verify (#4)

    The exchange takes place on each respective blockchain. Note that once an exchange is completed, when the funds are received will be dependent on the blockchain's accepted confirmation time. By default, the required amount of confirmations is set 0 and the funds aren't redeemable until each blockchain achieves their respective required amount of confirmations. For instance, lets look at an example of an exchange between BTC requireing 1 confirmation and BLOCK requiring 2 confirmations. BLOCK has a faster confirmation time so it will receive 2 confirmations while BTC has 0, but the funds will not be redeemable until BLOCK has at least 2 confirmation and BTC has at least 1 confirmation.

    There is currently a fixed fee of 0.015 BLOCK to take(fill) an order and no fee to make(create) an order.

    Design

    The following diagrams depict the events of an exchange with various outcomes. As seen in the diagrams, a "client" refers to software utlizing the Blocknet Protocol, which can be a blockchain, microservice, dApp, mobile app, website, etc.

    Successful Exchange (view full size image)

    The flow of the diagram above is top-to-bottom, left-to-right:

    1. The maker client creates an order locally;
      • Order put in new state;
    2. The order is broadcasted to the network;
      • A network transaction fee for the maker token's blockchain is charged to the maker;
    3. The Service Node network verifies the order is good;
    4. The order is added to the orderbooks, which the Service Nodes sync;
      • Order put in open state;
    5. The taker client responds to take the order;
      • A network transaction fee for the taker token's blockchain is charged;
      • A fixed 0.015 BLOCK fee is charged to the taker;
      • Order put in accepting state;
    6. The Service Node network verifies the response to take the order is good;
    7. The maker acknowledges the taker;
      • Order put in hold state;
    8. The maker and trader tokens are deposited into the atomic swap P2SH address;
      • Order put in created state;
    9. The Service Nodes verify the terms of the atomic swap contract are good;
    10. The transactions to the P2SH meet the required amount of confirmations;
    11. The P2SH secrets are spent to the opposite party;
      • Order put in signed state;
      • Order put in commited state;
    12. The maker and taker successfully receive the exchanged tokens;
      • Order put in finished state;
    Failed Exchange - Bad Maker Order (view full size image)

    The flow of the diagram above is top-to-bottom, left-to-right:

    1. The maker client creates an order locally;
      • Order put in new state;
    2. The order is broadcasted to the network;
      • A network transaction fee for the maker token's blockchain is charged to the maker;
    3. The Service Node network verifies the order is bad;
    4. The order is rejected by the network;
      • Order put in canceled state;
    Failed Exchange - Bad Taker Response (view full size image)

    The flow of the diagram above is top-to-bottom, left-to-right:

    1. The maker client creates an order locally;
      • Order put in new state;
    2. The order is broadcasted to the network;
      • A network transaction fee for the maker token's blockchain is charged to the maker;
    3. The Service Node network verifies the order is good;
    4. The order is added to the orderbooks, which the Service Nodes sync;
      • Order put in open state;
    5. The taker client responds to take the order;
      • A network transaction fee for the taker token's blockchain is charged;
      • A fixed 0.015 BLOCK fee is charged to the taker;
      • Order put in accepting state;
    6. The Service Node network verifies the response to take the order is bad;
      • Order put in canceled state;
    Failed Exchange - Bad Atomic Swap Terms (view full size image)

    The flow of the diagram above is top-to-bottom, left-to-right:

    1. The maker client creates an order locally;
      • Order put in new state;
    2. The order is broadcasted to the network;
      • A network transaction fee for the maker token's blockchain is charged to the maker;
    3. The Service Node network verifies the order is good;
    4. The order is added to the orderbooks, which the Service Nodes sync;
      • Order put in open state;
    5. The taker client responds to take the order;
      • A network transaction fee for the taker token's blockchain is charged;
      • A fixed 0.015 BLOCK fee is charged to the taker;
      • Order put in accepting state;
    6. The Service Node network verifies the response to take the order is good;
    7. The maker acknowledges the taker;
      • Order put in hold state;
    8. The maker and trader tokens are deposited into the atomic swap P2SH address;
      • Order put in created state;
    9. The Service Nodes verify the terms of the atomic swap contract are bad;
    10. The funds in the P2SH addresses are redeemed back to the original party;
      • Order put in canceled state;

    XRouter

    XRouter provides the Blocknet Protocol with a communication layer consisting of an inter-blockchain SPV client backend, enabling the verification of blockchain records without requiring users to download the full blockchain. This empowers development of lightweight microservice architectures that harness contracts, protocols, and services from other blockchains, laying a foundation for a decentralized API ecosystem.

    There is currently no fee to use XRouter, but the client needs to have at least 200 BLOCK on any account. This is used as a spam deterrent until the fee structure is implemented.

    Design

    The XRouter system utilizes the Service Node network to route calls from the client directly to the respective blockchain. There are 2 types of XRouter calls: submissions and queries.

    XRouter submissions are calls that involve interactions with a blockchain, such as xrSendTransaction. With submissions, the packets are routed from the client to the respective blockchain and a response, if any, is routed back to the client.

    XRouter queries are calls requesting information from a blockchain, such as xrGetBlockCount. With queries, the packets are also routed from the client to the respective blockchain and the response of the information queried is routed back to the client. XRouter queries can require a specific amount of Service Nodes to receive a response from in order to achieve consensus on the final answer.

    The following diagrams depict the events of an XRouter query and submission. As seen in the diagrams, a "client" refers to software utlizing the Blocknet Protocol, which can be a blockchain, microservice, dApp, mobile app, website, etc.

    XRouter Query (view full size image)

    The flow of the diagram is top-to-bottom:

    1. The client dispatches a packet for a query via API call to the Service Node network;
    2. The Service Nodes supporting the queried blockchain receive the packet;
    3. The Service Nodes route the packet of the query to the blockchain;
    4. The Service Nodes route the response from the blockchain back to the client;
    5. The client evaluates the responses for a majority consensus on the final answer;
    XRouter Submission (view full size image)
    1. The client dispatches a packet for a submission via API call to the Service Node network;
    2. The Service Nodes supporting the desired blockchain receive the packet;
    3. The Service Nodes route the packet of the query to the blockchain;
    4. IF there is a response from the blockchain, the Service Nodes route the response back to the client;

    Getting Started

    The Blocknet Protocol currently requires a synced Blocknet wallet, as well as the synced wallet of any blockchain that will be interacted with. In the future, with the use of XRouter, this will not be required. In addition, configuration files must also be composed.

    Wallet Setup

    Sample blocknetdx.conf

    listen=1
    server=1
    rpcallowip=127.0.0.1
    rpcuser=user
    rpcpassword=pass
    port=41412
    rpcport=41414
    
    1. Download and install the latest Blocknet wallet;
    2. Open the wallet, encrypt it, and sync the blockchain;
    3. Compose blocknetdx.conf as seen in the sample;
    4. Set an RPC username and password in blocknetdx.conf;
    5. If using the XBridge API, see XBridge Setup
    6. If using the XRouter API, see XRouter Setup

    XBridge Setup

    Sample xbridge.conf

    [Main]
    ExchangeWallets=BLOCK,SYS
    FullLog=true
    LogPath=
    ExchangeTax=300
    
    [BLOCK]
    Title=Blocknet
    Address=
    Ip=127.0.0.1
    Port=41414
    Username=
    Password=
    AddressPrefix=26
    ScriptPrefix=28
    SecretPrefix=154
    COIN=100000000
    MinimumAmount=0
    TxVersion=1
    DustAmount=0
    CreateTxMethod=BTC
    GetNewKeySupported=true
    ImportWithNoScanSupported=true
    MinTxFee=0
    BlockTime=60
    FeePerByte=20
    Confirmations=0
    
    [SYS]
    Title=Syscoin
    Address=
    Ip=127.0.0.1
    Port=8370
    Username=
    Password=
    AddressPrefix=63
    ScriptPrefix=5
    SecretPrefix=128
    COIN=100000000
    MinimumAmount=0
    TxVersion=1
    DustAmount=0
    CreateTxMethod=BTC
    MinTxFee=0
    BlockTime=60
    GetNewKeySupported=false
    ImportWithNoScanSupported=false
    FeePerByte=210
    Confirmations=0
    
    1. Compose xbridge.conf as seen in the sample;
      • Video tutorial;
      • This configuration file can be customized for whichever blockchains will be interacted with;
      • Here are configurations for other coins;
      • The entire code area in the link above can be added to xbridge.conf as having configurations for blockchains not used is okay;
      • The BLOCK configurations will always be required;
      • ExchangeWallets= under [Main] must also include each blockchain's symbol;
      • Confirmations= is the number of confirmations required before funds are redeemable from the atomic swap contract;
    2. Compose the wallet configuration file for whichever blockchains will be interacted with;
    3. If any of the wallets are still open, they must be restarted in order to activate the new configurations;
    4. Open, sync, and unlock the Blocknet wallet, as well as whichever blockchains will be interacted with;
    5. Using the command line(cli), XBridge API calls can now be made;
    6. If also using the XRouter API, see XRouter Setup;

    XRouter Setup

    Sample xrouter.conf

    [Main]
    xrouter=1
    

    Sample blocknetdx.conf

    listen=1
    server=1
    rpcallowip=127.0.0.1
    rpcuser=user
    rpcpassword=pass
    port=41412
    rpcport=41414
    // the following connections are for development use only
    connect=52.1.114.105
    connect=52.204.253.93
    connect=52.45.147.62
    
    1. Compose xrouter.conf as seen in the sample;
      1. xrouter=1 enables XRouter and xrouter=0 disables XRouter;
    2. Peers that have XRouter enabled must be added to blocknetdx.conf;
      1. This is temporary and for development purposes only until auto peer finding is released;
    3. If any of the wallets are still open, they must be restarted in order to activate the new configurations;
    4. Open, sync, and unlock the Blocknet wallet;
    5. At this time, the client needs to have at least 200 BLOCK on any account
    6. Using the command line(cli), XRouter API calls can now be made;
    7. If also using the XBridge API, see XBridge Setup;

    XBridge API

    The following set of calls are used to conduct decentralized and trustless exchanges over the Blocknet network.

    dxMakeOrder

    Sample Data

    {
      "maker": "SYS",
      "maker_size": "0.100",
      "maker_address": "yFMXXUJF7pSKegHTkTYMjfNxyUGVt1uCrL",
      "taker": "LTC",
      "taker_size": "0.01",
      "taker_address": "yGDmuy8m1Li4ShNe7kGYusACw4oyiGiK5b",
      "type": "exact"
    }
    

    This call is used to create a new order.

    Request Parameters

    Sample Request

    blocknetdx-cli dxMakeOrder SYS 0.100 yFMXXUJF7pSKegHTkTYMjfNxyUGVt1uCrL LTC 0.01 yGDmuy8m1Li4ShNe7kGYusACw4oyiGiK5b exact
    

    dxMakeOrder [maker] [maker_size] [maker_address] [taker] [taker_size] [taker_address] [type] [dryrun](optional)

    Parameter Type Description
    maker string Maker trading token; the token being sold by the maker.
    maker_size string(float) Maker trading size. String is used to preserve precision.
    maker_address string Maker address for sending the outgoing token.
    taker string Taker trading token; the token being sold by the taker.
    taker_size string(float) Taker trading size. String is used to preserve precision.
    taker_address string Maker address for receiving the incoming token.
    type string This is the order type.
    "exact": Matches a specific order.
    "limit": (not yet supported)
    "market": (not yet supported)
    dryrun string (Optional Parameter)
    "dryrun": Receive a response without actually submitting the order to the network.

    Response Parameters

    Sample 200 Response

    {
      "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092",
      "maker": "SYS",
      "maker_size": "0.100",
      "maker_address": "yFMXXUJF7pSKegHTkTYMjfNxyUGVt1uCrL",
      "taker": "LTC",
      "taker_size": "0.01",
      "taker_address": "yGDmuy8m1Li4ShNe7kGYusACw4oyiGiK5b",
      "updated_at": "2018-01-16T00:00:00.00000Z",
      "created_at": "2018-01-15T18:15:30.12345Z",
      "block_id": "38729344720578447445023782734923740427863289632489723984723",
      "status": "created"
    }
    
    Parameter Type Description
    id string The order GUID.
    maker string Maker trading token; the token being sold by the maker.
    maker_size string(float) Maker trading size. String is used to preserve precision.
    maker_address string Maker address for sending the outgoing token.
    taker string Taker trading token; the token being sold by the taker.
    taker_size string(float) Taker trading size. String is used to preserve precision.
    taker_address string Maker address for receiving the incoming token.
    updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.
    created_at string ISO 8601 datetime, with microseconds, of when the order was created.
    block_id string The GUID block hash of the current block on the Blocknet blockchain at the time the order was created.
    status string Order status:
    "new": New order;
    "open": Order waiting for taker;
    "accepting": Taker accepting;
    "hold": Maker acknowledges taker;
    "created": Swap process starting;
    "signed": Swap token being signed by maker & taker;
    "commited": Swap finalized;
    "finished": Order complete;
    "expired": Order expired;
    "offline": Maker or taker went offline;
    "canceled": Order was canceled;
    "invalid": Problem detected with the order;

    Sample 400 Response

    {
      "error": "Size must be greater than 0",
      "code": 1024,
      "name": "dxMakeOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxMakeOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1024 400 Size must be greater than 0
    1011 400 Invalid maker symbol
    1012 400 Invalid taker symbol
    1026 400 Bad maker address
    1026 400 Bad taker address
    1002 500 Internal server error

    dxTakeOrder

    Sample Data

    {
      "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092",
      "send_address": "yFMXXUJF7pSKegHTkTYMjfNxyUGVt1uCrL",
      "receive_address": "yGDmuy8m1Li4ShNe7kGYusACw4oyiGiK5b",
      "dryrun": "dryrun"
    }
    

    This call is used to take an order.

    Request Parameters

    Sample Request

    blocknetdx-cli dxTakeOrder 2cd2a2ac-e6ff-4beb-9b45-d460bf83a092 yFMXXUJF7pSKegHTkTYMjfNxyUGVt1uCrL yGDmuy8m1Li4ShNe7kGYusACw4oyiGiK5b
    

    dxTakeOrder [order_id] [send_address] [receive_address] [dryrun](optional)

    Parameter Type Description
    id string ID of order being filled.
    send_address string Taker address for sending the outgoing token.
    receive_address string Taker address for receiving the incoming token.
    dryrun string (Optional Parameter)
    "dryrun": Receive a response without actually submitting the order to the network.

    Response Parameters

    Sample 200 Response

    {
      "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092",
      "maker": "SYS",
      "maker_size": "0.100",
      "taker": "LTC",
      "taker_size": "0.01",
      "updated_at": "1970-01-01T00:00:00.00000Z",
      "created_at": "2018-01-15T18:15:30.12345Z",
      "status": "finished"
    }
    
    Parameter Type Description
    id string The order GUID.
    maker string Maker trading token; the token being sold by the maker.
    maker_size string(float) Maker trading size. String is used to preserve precision.
    taker string Taker trading token; the token being sold by the taker.
    taker_size string(float) Taker trading size. String is used to preserve precision.
    updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.
    created_at string ISO 8601 datetime, with microseconds, of when the order was created.
    status string Order status: "finished"

    Sample 400 Response

    {
      "error": "Invalid order id",
      "code": 1021,
      "name": "dxTakeOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxTakeOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1021 400 Invalid order id
    1011 400 Invalid maker symbol
    1012 400 Invalid taker symbol
    1026 400 Bad maker address
    1026 400 Bad taker address
    1002 500 Internal server error

    dxCancelOrder

    Sample Data

    {
      "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092"
    }
    

    This call is used to cancel an order, and automatically rolled back if necessary.

    Request Parameters

    Sample Request

    blocknetdx-cli dxCancelOrder 2cd2a2ac-e6ff-4beb-9b45-d460bf83a092
    

    dxCancelOrder [order_id]

    Parameter Type Description
    id string ID of order being cancelled.

    Response Parameters

    Sample 200 Response

    {
      "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092",
      "maker": "SYS",
      "maker_size": "0.100",
      "maker_address": "yFMXXUJF7pSKegHTkTYMjfNxyUGVt1uCrL",
      "taker": "LTC",
      "taker_size": "0.01",
      "taker_address": "yGDmuy8m1Li4ShNe7kGYusACw4oyiGiK5b",
      "updated_at": "1970-01-01T00:00:00.00000Z",
      "created_at": "2018-01-15T18:15:30.12345Z",
      "status": "canceled"
    }
    
    Parameter Type Description
    id string The order GUID.
    maker string Sending token of party cancelling the order.
    maker_size string(float) Sending trading size. String is used to preserve precision.
    maker_address string Address for sending the outgoing token.
    taker string Receiving token of party cancelling the order.
    taker_size string(float) Receiving trading size. String is used to preserve precision.
    taker_address string Address for receiving the incoming token.
    updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.
    created_at string ISO 8601 datetime, with microseconds, of when the order was created.
    status string Order status:
    "new": New order;
    "open": Order waiting for taker;
    "accepting": Taker accepting;
    "hold": Maker acknowledges taker;
    "created": Swap process starting;
    "signed": Swap token being signed by maker & taker;
    "commited": Swap finalized;
    "finished": Order complete;
    "expired": Order expired;
    "offline": Maker or taker went offline;
    "canceled": Order was canceled;
    "invalid": Problem detected with the order;

    Sample 400 Response

    {
      "error": "Invalid order id",
      "code": 1021,
      "name": "dxCancelOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxCancelOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1021 400 Invalid order id
    1002 500 Internal server error

    dxGetOrder

    Sample Data

    {
      "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092"
    }
    

    This call is used to retrieve order info.

    Request Parameters

    Sample Request

    blocknetdx-cli dxGetOrder 2cd2a2ac-e6ff-4beb-9b45-d460bf83a092
    

    dxGetOrder [order_id]

    Parameter Type Description
    id string ID of order of interest.

    Response Parameters

    Sample 200 Response

    {
      "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092",
      "maker": "SYS",
      "maker_size": "0.100",
      "taker": "LTC",
      "taker_size": "0.01",
      "updated_at": "1970-01-01T00:00:00.00000Z",
      "created_at": "2018-01-15T18:15:30.12345Z",
      "status": "open"
    }
    
    Parameter Type Description
    id string The order GUID.
    maker string Maker trading token; the token being sold by the maker.
    maker_size string(float) Maker trading size. String is used to preserve precision.
    taker string Taker trading token; the token being sold by the taker.
    taker_size string(float) Taker trading size. String is used to preserve precision.
    updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.
    created_at string ISO 8601 datetime, with microseconds, of when the order was created.
    status string Order status:
    "new": New order;
    "open": Order waiting for taker;
    "accepting": Taker accepting;
    "hold": Maker acknowledges taker;
    "created": Swap process starting;
    "signed": Swap token being signed by maker & taker;
    "commited": Swap finalized;
    "finished": Order complete;
    "expired": Order expired;
    "offline": Maker or taker went offline;
    "canceled": Order was canceled;
    "invalid": Problem detected with the order;

    Sample 400 Response

    {
      "error": "Invalid order id",
      "code": 1021,
      "name": "dxGetOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetOrder"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1021 400 Invalid order id
    1002 500 Internal server error

    dxGetOrders

    This call is used to retrieve all orders.

    Request Parameters

    Request

    blocknetdx-cli dxGetOrders
    

    dxGetOrders

    This call does not take parameters.

    Response Parameters

    Sample 200 Response

    [
      {
        "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092", 
        "maker": "SYS",
        "maker_size": "0.100",
        "taker": "LTC",
        "taker_size": "0.01",
        "updated_at": "2018-01-15T18:25:05.12345Z", 
        "created_at": "2018-01-15T18:15:30.12345Z", 
        "status": "finished"
      },
      {
        "id": "12b672d4-cc43-4941-8b35-b1d0ea110908", 
        "maker": "SYS",
        "maker_size": "0.100",
        "taker": "LTC",
        "taker_size": "0.01",
        "updated_at": "2018-01-15T18:25:05.12345Z", 
        "created_at": "2018-01-15T18:15:30.12345Z", 
        "status": "finished"
      },
      {
        "id": "01639dfa-db96-440c-85bd-6d4feda8ace6", 
        "maker": "SYS",
        "maker_size": "0.100",
        "taker": "LTC",
        "taker_size": "0.01",
        "updated_at": "2018-01-15T18:25:05.12345Z", 
        "created_at": "2018-01-15T18:15:30.12345Z", 
        "status": "finished"
      }
    ]
    
    Parameter Type Description
    Array array An array of all orders with each order having the following parameters.
    id string The order GUID.
    maker string Maker trading token; the token being sold by the maker.
    maker_size string(float) Maker trading size. String is used to preserve precision.
    taker string Taker trading token; the token being sold by the taker.
    taker_size string(float) Taker trading size. String is used to preserve precision.
    updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.
    created_at string ISO 8601 datetime, with microseconds, of when the order was created.
    status string Order status:
    "new": New order;
    "open": Order waiting for taker;
    "accepting": Taker accepting;
    "hold": Maker acknowledges taker;
    "created": Swap process starting;
    "signed": Swap token being signed by maker & taker;
    "commited": Swap finalized;
    "finished": Order complete;
    "expired": Order expired;
    "offline": Maker or taker went offline;
    "canceled": Order was canceled;
    "invalid": Problem detected with the order;

    Sample 400 Response

    {
      "error": "Invalid order id",
      "code": 1021,
      "name": "dxGetOrders"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetOrders"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1021 400 Invalid order id
    1002 500 Internal server error

    dxGetMyOrders

    This call is used to retrieve all of the orders from the local client.

    Request Parameters

    Request

    blocknetdx-cli dxGetMyOrders
    

    dxGetMyOrders

    This call does not take parameters.

    Response Parameters

    Sample 200 Response

    [
      {
        "id": "2cd2a2ac-e6ff-4beb-9b45-d460bf83a092", 
        "maker": "SYS",
        "maker_size": "0.100",
        "taker": "LTC",
        "taker_size": "0.01",
        "updated_at": "2018-01-15T18:25:35.12345Z", 
        "created_at": "2018-01-15T18:15:37.12345Z", 
        "status": "finished"
      },
      {
        "id": "12b672d4-cc43-4941-8b35-b1d0ea110908", 
        "maker": "SYS",
        "maker_size": "0.100",
        "taker": "LTC",
        "taker_size": "0.01",
        "updated_at": "2018-01-15T18:25:25.12345Z", 
        "created_at": "2018-01-15T18:15:32.12345Z", 
        "status": "finished"
      },
      {
        "id": "01639dfa-db96-440c-85bd-6d4feda8ace6", 
        "maker": "SYS",
        "maker_size": "0.100",
        "taker": "LTC",
        "taker_size": "0.01",
        "updated_at": "2018-01-15T18:25:52.12345Z", 
        "created_at": "2018-01-15T18:15:26.12345Z", 
        "status": "finished"
      }
    ]
    
    Parameter Type Description
    Array array An array of all orders with each order having the following parameters.
    id string The order GUID.
    maker string Maker trading token; the token being sold by the maker.
    maker_size string(float) Maker trading size. String is used to preserve precision.
    maker_address string Address for sending the outgoing token.
    taker string Taker trading token; the token being sold by the taker.
    taker_size string(float) Taker trading size. String is used to preserve precision.
    taker_address string Address for receiving the incoming token.
    updated_at string ISO 8601 datetime, with microseconds, of the last time the order was updated.
    created_at string ISO 8601 datetime, with microseconds, of when the order was created.
    status string Order status:
    "new": New order;
    "open": Order waiting for taker;
    "accepting": Taker accepting;
    "hold": Maker acknowledges taker;
    "created": Swap process starting;
    "signed": Swap token being signed by maker & taker;
    "commited": Swap finalized;
    "finished": Order complete;
    "expired": Order expired;
    "offline": Maker or taker went offline;
    "canceled": Order was canceled;
    "invalid": Problem detected with the order;

    Sample 400 Response

    {
      "error": "Invalid order id",
      "code": 1021,
      "name": "dxGetMyOrders"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetMyOrders"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1021 400 Invalid order id
    1002 500 Internal server error

    dxGetOrderFills

    Sample Data

    {
      "maker": "SYS",
      "taker": "LTC",
      "combined": false
    }
    

    This call is used to retrieve all recent filled orders by a given trade pair.

    Request Parameters

    Sample Request

    blocknetdx-cli dxGetOrderFills SYS LTC false
    

    dxGetOrderFills [maker] [taker] [combined](optional)

    Parameter Type Description
    maker string Maker trading token; the token being sold by the maker.
    taker string Taker trading token; the token being sold by the taker.
    combines boolean (Optional Parameter) Defaults to true.
    true: Receive filled orders for both the maker and taker tokens as specified, as well as the inverse with the maker token as the taker and the taker token as the maker.
    false: Receive filled orders only with the maker and taker tokens as specified.

    Response Parameters

    Sample 200 Response

    [
      {
        "id": "00a2afce-4754-443e-93d6-1f600501e3ac",
        "time": "2018-01-16T13:15:05.12345Z",
        "maker": "SYS",
        "maker_size": "101.00000000",
        "maker_txid": "f2b1ebf45b81da67171bfc55f34c20c9bbc55d8234b8f5c61d0965f61e3c3156",
        "taker": "LTC",
        "taker_size": "0.01000000",
        "taker_txid": "bcb7543c2f66777927899e701c8309be77904b9c0ef286791fb1a1813bb9099d",
        "block_id": "5036c0ac1a3e0337d3e51f37060e79cf3300cc02317bb5877d07412dd9f5c208"
      },
      {
        "id": "7de354c3-6c66-44e7-bf30-eaf942df5fcc",
        "time": "2018-01-16T13:15:05.12345Z",
        "maker": "LTC",
        "maker_size": "0.01000000",
        "maker_txid": "7d36aa270a9952f92e82eb23a8ccd25870430ba19f4dc469c9af4be3a9bd2026",
        "taker": "SYS",
        "taker_size": "101.00000000",
        "taker_txid": "c831c786b4d00f8688c37873b65223e4bca88a191497d5d149bdf00e4c55ed30",
        "block_id": "69a1f3bc5031e55800a37062d3c74c017cf233730e7c00813f5cbe7d9d7d0230"
      }
    ]
    
    Parameter Type Description
    Array array Array of orders sorted by date descending (most recent filled trade first).
    id string The order GUID.
    time string Time the order was filled.
    maker string Maker trading token; the token being sold by the maker.
    maker_size string(float) Maker trading size. String is used to preserve precision.
    maker_txid string The transaction ID(hash) of maker token on the token's network.
    taker string Taker trading token; the token being sold by the taker.
    taker_size string(float) Taker trading size. String is used to preserve precision.
    taker_txid string The transaction ID(hash) of taker token on the token's network.
    block_id string Blocknet block hash GUID at the time the order was filled.

    Sample 400 Response

    {
      "error": "Invalid maker symbol",
      "code": 1011,
      "name": "dxGetOrderFills"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetOrderFills"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1011 400 Invalid maker symbol
    1012 400 Invalid taker symbol
    1002 500 Internal server error

    dxGetOrderHistory

    Sample Data

    {
      "maker": "SYS",
      "taker": "LTC",
      "start_time": 15929405986,
      "end_time": 15929423986,
      "granularity": 3600
    }
    

    This call is used to retrieve all the filled trades by a trade pair within a specified time range.

    Note: This call is not currently supported.

    Request Parameters

    Sample Request

    blocknetdx-cli dxGetOrderHistory SYS LTC 15929405986 15929423986 3600
    

    dxGetOrderHistory [maker] [taker] [start_time] [end_time] [granularity] [order_ids](optional)

    Parameter Type Description
    maker string Maker trading token; the token being sold by the maker.
    taker string Taker trading token; the token being sold by the taker.
    start_time int Start time(Unix time) representing the lower boundary to search.
    end_time int End time(Unix time) representing the upper boundary to search.
    granularity int Time interval slice in seconds:
    60, 300, 900, 3600, 21600, 86400
    order_ids bool (Optional Parameter) Defaults to false.
    true: Receive the GUIDs of all filled orders in each slice.
    false: Do not receive the order GUIDs.

    Response Parameters

    Sample 200 Response

    [
      //[ time, low, high, open, close, volume ],
      [ "2018-01-16T13:15:05.12345Z", 1.10, 2.0, 1.10, 1.4, 1000 ],
      [ "2018-01-16T14:15:05.12345Z", 1.10, 2.1, 1.10, 1.4, 1000 ],
      [ "2018-01-16T15:15:05.12345Z", 1.12, 2.2, 1.10, 1.4, 1000 ],
      [ "2018-01-16T16:15:05.12345Z", 1.14, 2.0, 1.10, 1.4, 1000 ],
      [ "2018-01-16T17:15:05.12345Z", 1.15, 2.0, 1.10, 1.4, 1000 ]
    ]
    
    Parameter Type Description
    time string ISO 8601 datetime, with microseconds, of the time at the beginning of the time slice.
    low float64 Exchange rate lower bound within the time slice.
    high float64 Exchange rate upper bound within the time slice.
    open float64 Exchange rate of first filled order at the beginning of the time slice.
    close float64 Exchange rate of last filled order at the end of the time slice.
    volume int64 Total volume of the taker token within the time slice.
    order_ids array Array of GUIDs of all filled orders within the time slice.

    Sample 400 Response

    {
      "error": "Invalid maker symbol",
      "code": 1011,
      "name": "dxGetOrderHistory"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetOrderHistory"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1004 400 Bad request
    1011 400 Invalid maker symbol
    1012 400 Invalid taker symbol
    1016 400 Invalid time
    1002 500 Internal server error

    dxGetLocalTokens

    This call is used to retrieve all the tokens supported by the local client.

    Request Parameters

    Request

    blocknetdx-cli dxGetLocalTokens
    

    dxGetLocalTokens

    This call does not take parameters.

    Response Parameters

    Sample 200 Response

    [
      "LTC",
      "SYS",
      "MONA",
      "BLOCK"
    ]
    
    Parameter Type Description
    Array array An array of all the tokens supported by the local client.

    Sample 400 Response

    {
      "error": "Bad request",
      "code": 1004,
      "name": "dxGetLocalTokens"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetLocalTokens"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1004 400 Bad request
    1002 500 Internal server error

    dxGetNetworkTokens

    This call is used to retrieve all the tokens supported by the network.

    Note: This call is not currently supported.

    Request Parameters

    Request

    blocknetdx-cli dxGetNetworkTokens
    

    dxGetNetworkTokens

    This call does not take parameters.

    Response Parameters

    Sample 200 Response

    [
      "LTC",
      "SYS",
      "MONA",
      "BLOCK"
    ]
    
    Parameter Type Description
    Array array An array of all the tokens supported by the network.

    Sample 400 Response

    {
      "error": "Bad request",
      "code": 1004,
      "name": "dxGetNetworkTokens"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetNetworkTokens"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1004 400 Bad request
    1002 500 Internal server error

    dxGetTokenBalances

    This call is used to retrieve the balances for all connected wallets on the local client.

    Request Parameters

    Request

    blocknetdx-cli dxGetTokenBalances
    

    dxGetTokenBalances

    This call does not take parameters.

    Response Parameters

    Sample 200 Response

    {
      "LTC": "0.568942",
      "SYS": "1050.128493",
      "MONA": "3.452",
      "BLOCK": "250.83492174"
    }
    
    Parameter Type Description
    Object map Map structure of the tokens and respective balances.
    - key string The token symbol.
    - value string(float) The wallet balance amount. String is used to preserve precision.

    Sample 400 Response

    {
      "error": "Bad request",
      "code": 1004,
      "name": "dxGetTokenBalances"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetTokenBalances"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1004 400 Bad request
    1002 500 Internal server error

    dxGetOrderBook

    Sample Data

    {
      "detail": 1,
      "maker": "LTC",
      "taker": "SYS",
      "max_orders": 100
    }
    

    This call is used to retrieve open orders at various detail levels:
    Detail 1 - Retrieves the best bid and ask.
    Detail 2 - Retrieves a list of aggregated orders. This is useful for charting.
    Detail 3 - Retrieves a list of non-aggregated orders. This is useful for bot trading.
    Detail 4 - Retrieves the best bid and ask with the order GUIDs.

    Request Parameters

    Sample Request

    blocknetdx-cli dxGetOrderBook 1 LTC SYS 100
    

    dxGetOrderBook [detail] [maker] [taker] [max_orders](optional)

    Parameter Type Description
    detail int Detail level: 1, 2, 3, 4
    maker string Maker trading token; the token being sold by the maker.
    taker string Taker trading token; the token being sold by the taker.
    max_orders int (Optional Parameter) Defaults to 50.

    Response Parameters

    Sample 200 Response (Detail 1)

    {
      "detail": 1,
      "maker": "LTC",
      "taker": "SYS",
      "bids": [
        //[ price, size, order_count ],
        [ "253", "15", 1 ],
      ],
      "asks": [
        //[ price, size, order_count ],
        [ "253.01", "15", 4 ],
      ]
    }
    


    Detail 1
    Retrieves the best bid and ask.

    Parameter Type Description
    detail int Detail level: 1
    maker string Maker trading token; the token being sold by the maker.
    taker string Taker trading token; the token being sold by the taker.
    bids array An array of the best bids.
    - price string(float) The highest bid price for the token. String is used to preserve precision.
    - size string(float) The size of bid orders at this price. String is used to preserve precision.
    - order_count int The total bid orders at this price.
    asks array An array of the best asks.
    - price string(float) The lowest ask price for the token. String is used to preserve precision.
    - size string(float) The size of ask orders at this price. String is used to preserve precision.
    - order_count int The total ask orders at this price.

    Sample 200 Response (Detail 2)

    {
      "detail": 2,
      "maker": "LTC",
      "taker": "SYS",
      "bids": [
        //[ price, size, order_count ],
        [ "253.00", "15.00", 10 ],
        [ "253.00", "15.01", 3 ],
      ],
      "asks": [
        //[ price, size, order_count ],
        [ "254.15", "15.01", 1 ],
        [ "254.16", "15.02", 2 ],
      ]
    }
    


    Detail 2
    Retrieves a list of aggregated orders. This is useful for charting.

    Parameter Type Description
    detail int Detail level: 2
    maker string Maker trading token; the token being sold by the maker.
    taker string Taker trading token; the token being sold by the taker.
    bids array An array of bids.
    - price string(float) The bid price for the token. String is used to preserve precision.
    - size string(float) The size of bid orders at this price. String is used to preserve precision.
    - order_count int The total bid orders at this price.
    asks array An array of asks.
    - price string(float) The ask price for the token. String is used to preserve precision.
    - size string(float) The size of ask orders at this price. String is used to preserve precision.
    - order_count int The total ask orders at this price.

    Sample 200 Response (Detail 3)

    {
      "detail": 3,
      "maker": "LTC",
      "taker": "SYS",
      "bids": [
        //[ price, size, order_id ],
        [ "253.00", "15.00", "d1ebd0b8-5398-4278-8e20-d480ac1d5869" ],
        [ "253.00", "15.01", "120cb23f-bf62-47fb-abcc-d9a2909ef0cd" ],
      ],
      "asks": [
        //[ price, size, order_id ],
        [ "254.15", "15.01", "d93b735b-ae1b-4ac6-b96b-d92966dd6ea1" ],
        [ "254.16", "15.02", "32f5a551-3da6-4ff0-8ae6-0b60535c5237" ],
      ]
    }
    


    Detail 3
    Retrieves a list of non-aggregated orders. This is useful for bot trading.

    Parameter Type Description
    detail int Detail level: 3
    maker string Maker trading token; the token being sold by the maker.
    taker string Taker trading token; the token being sold by the taker.
    bids array An array of bids.
    - price string(float) The highest bid price for the token. String is used to preserve precision.
    - size string(float) The size of the bid order. String is used to preserve precision.
    - order_id string The GUID of the bid order.
    asks array An array of asks.
    - price string(float) The lowest ask price for the token. String is used to preserve precision.
    - size string(float) The size of the ask order. String is used to preserve precision.
    - order_id string The GUID of the ask order.a

    Sample 200 Response (Detail 4)

    {
      "detail": 4,
      "maker": "LTC",
      "taker": "SYS",
      "bids": [
        //[ price, size, [order_ids] ],
        [ "253.00", "15", ["d1ebd0b8-5398-4278-8e20-d480ac1d5869"] ],
      ],
      "asks": [
        //[ price, size, [order_ids] ],
        [ "254.00", "15", ["32f5a551-3da6-4ff0-8ae6-0b60535c5237"] ],
      ]
    }
    


    Detail 4
    Retrieves the best bid and ask with the order GUIDs.

    Parameter Type Description
    detail int Detail level: 4
    maker string Maker trading token; the token being sold by the maker.
    taker string Taker trading token; the token being sold by the taker.
    bids array An array of the best bids.
    - price string(float) The highest bid price for the token. String is used to preserve precision.
    - size string(float) The size of bid orders at this price. String is used to preserve precision.
    - order_ids array An array of GUID for bid orders at this price.
    asks array An array of the best asks.
    - price string(float) The lowest ask price for the token. String is used to preserve precision.
    - size string(float) The size of ask orders at this price. String is used to preserve precision.
    - order_ids array An array of GUID for ask orders at this price.

    Sample 400 Response

    {
      "error": "Invalid detail level",
      "code": 1015,
      "name": "dxGetOrderBook"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function

    Sample 500 Response

    {
      "error": "Internal error occurred",
      "code": 1002,
      "name": "dxGetOrderBook"
    }
    
    Parameter Type Description
    error string Error message
    code int Error code
    name string Name of the RPC function
    Code Type Error
    1001 401 Unauthorized
    1004 400 Bad request
    1011 400 Invalid maker symbol
    1012 400 Invalid taker symbol
    1015 400 Invalid detail level
    1002 500 Internal server error

    Error Codes

    The XBridge API uses the following error codes:

    Code Type Error
    1004 400 Bad request
    1011 400 Invalid maker symbol
    1012 400 Invalid taker symbol
    1015 400 Invalid detail level
    1016 400 Invalid time
    1021 400 Invalid order id
    1026 400 Bad maker address
    1026 400 Bad taker address
    1029 400 Not an exchange node
    1024 400 Size must be greater than 0
    1001 401 Unauthorized
    1002 500 Internal server error

    XRouter API

    The following set of calls are used to communicate and interact with blockchains remotely over the Blocknet network.

    xrGetBlockCount

    Sample Data

    {
      "blockchain": "SYS"
    }
    

    This call is used to retrieve the current block height of the specified blockchain.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetBlockCount SYS
    

    xrGetBlockCount [blockchain] [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    confirmations string (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "reply": "91510"
    }
    
    Parameter Type Description
    reply string The latest block number of the specified blockchain.

    xrGetBlockHash

    Sample Data

    {
      "blockchain": "SYS",
      "block": 91510
    }
    

    This call is used to retrieve the block hash of the specified block and blockchain.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetBlockHash SYS 91510
    

    xrGetBlockHash [blockchain] [block] [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    block int The block number for the block hash of interest.
    confirmations string (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "block_hash": "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837"
    }
    
    Parameter Type Description
    reply string The block hash of the specified block and blockchain.

    xrGetBlock

    Sample Data

    {
      "blockchain": "SYS",
      "block_hash": "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837"
    }
    

    This call is used to retrieve the block number of the specified block hash and blockchain.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetBlock SYS 0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837
    

    xrGetBlock [blockchain] [block_hash] [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    block_hash string The block hash for the block of interest.
    confirmations string (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "reply" : {
        "hash" : "0cf18712db68be85793dc06cd0a4fbc8edb166157e6847bb3c9f55d462b02837",
        "confirmations" : 33611,
        "size" : 734,
        "height" : 91510,
        "version" : 805306624,
        "versionHex" : "30000100",
        "merkleroot" : "55554df0ea7f66552beffe433d2c2f620bada79063a343ffc23c60c67cdf028f",
        "tx" : [
          "55554df0ea7f66552beffe433d2c2f620bada79063a343ffc23c60c67cdf028f"
        ],
        "time" : 1530894673,
        "mediantime" : 1530894336,
        "nonce" : 0,
        "bits" : "180761db",
        "difficulty" : 148937676133.26119995117187500,
        "chainwork" : "00000000000000000000000000000000000000000028ad56864c458781e21970",
        "auxpow" : {
          "tx" : {
            "hex" : "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5703dd3408142f5669614254432f626d67706f6f6c2e636f6d2f2cfabe6d6d75654ab7a6b163e7a04e56e43f8e7ca0087f11e8bd6c3c72c69732e849532878040000000000000010d51dbb0b9301409ff96ef9f588c50200ffffffff01c051824a000000001976a914f1c075a01882ae0972f95d3a4177c86c852b7d9188ac00000000",
            "txid" : "c8fc123672fffb3c6a45b94bdd30afc114f282742338809380bc84fe8666d489",
            "size" : 172,
            "version" : 1,
            "locktime" : 0,
            "vin" : [
              {
                "coinbase" : "03dd3408142f5669614254432f626d67706f6f6c2e636f6d2f2cfabe6d6d75654ab7a6b163e7a04e56e43f8e7ca0087f11e8bd6c3c72c69732e849532878040000000000000010d51dbb0b9301409ff96ef9f588c50200",
                "sequence" : 4294967295
              }
            ],
            "vout" : [
              {
                "value" : 12.50054592000000042,
                "valueSat" : 1250054592,
                "n" : 0,
                "scriptPubKey" : {
                  "asm" : "OP_DUP OP_HASH160 f1c075a01882ae0972f95d3a4177c86c852b7d91 OP_EQUALVERIFY OP_CHECKSIG",
                  "hex" : "76a914f1c075a01882ae0972f95d3a4177c86c852b7d9188ac",
                  "reqSigs" : 1,
                  "type" : "pubkeyhash",
                  "addresses" : [
                    "SjLGSPfmF3kVPA6A213hShYc4aRtiWZ8Wu"
                  ]
                }
              }
            ],
            "blockhash" : "000000000000000004bdb8e3fdf28ffc528f4e6b1871a6177579cbd4dabde955"
          },
          "index" : 0,
          "chainindex" : 2,
          "merklebranch" : [
            "a67d749dfa7006b9d66d2284b20a64ebcb8c2e5aae18e355c790b90a060a30c1",
            "9ab5c057ecf43aa0552c21be4f86b1c9b248fe2dd0821bee38e5a25a22c49c25",
            "ec11fd79e02fe98bf9f4b624e5460a3221dbae27d24f36c9988dcc5beaf3c592",
            "dbc42b7360a7165b277f73094a366e951d3ac6d6a1e9493d838d35372e5e846b",
            "c7260dbfb6b196bd2e4e4dbde1799592627a3e6fa384e6692be8387a9251e5e2"
          ],
          "chainmerklebranch" : [
            "89af0bc973bc0308f14c5c50c3d75f68783eab40a4688064cd56cfaed977d138",
            "5360cbf0991b4b0e09d589631c232d1f229104faad9e65375695230c47bc2493"
          ],
          "parentblock" : "0000002024653d98f3eace4b66b6269fa9205e08b647e23cf7880e0000000000000000003feae4c877b2f8b73f6f92a589ed8870fe98abb3551f1539373597f5b44514ada9993f5bb1830118d5793688"
        },
        "previousblockhash" : "ba53d715abf76ac8adc025120ffb48b2331f3a1b9b7d01167ffd7dcd23934390",
        "nextblockhash" : "cd3a236542491089bffd8ba49cbe1d11a20dd4c4ad188307027e60c710732409"
      }
    }
    
    Parameter Type Description
    reply object The block data of the specified block hash and blockchain.

    xrGetTransaction

    Sample Data

    {
      "blockchain": "SYS",
      "txid": "9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51"
    }
    

    This call is used to retrieve the transaction data for the specified transaction ID and blockchain.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetTransaction SYS 9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51
    

    xrGetTransaction [blockchain] [txid] [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    txid string The transaction ID(hash) of interest.
    confirmations int (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "reply" : {
        "txid" : "9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51",
        "size" : 192,
        "version" : 2,
        "locktime" : 0,
        "vin" : [
          {
            "txid" : "10f28315098fff366e2dfba23afacc10ddb5ac30a403d6396cc2d35739f06a79",
            "vout" : 1,
            "scriptSig" : {
              "asm" : "30450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad[ALL] 02e927a2a1d4a613ed3fa73bf1169beaf4e95a6348afac6613e283d80b9bf2abba",
              "hex" : "4830450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad012102e927a2a1d4a613ed3fa73bf1169beaf4e95a6348afac6613e283d80b9bf2abba"
            },
            "sequence" : 4294967295
          }
        ],
        "vout" : [
          {
            "value" : 1.43000000000000105,
            "valueSat" : 143000000,
            "n" : 0,
            "scriptPubKey" : {
              "asm" : "OP_DUP OP_HASH160 7be755600f2fd9f3518be6ededb38e2498f51ff5 OP_EQUALVERIFY OP_CHECKSIG",
              "hex" : "76a9147be755600f2fd9f3518be6ededb38e2498f51ff588ac",
              "reqSigs" : 1,
              "type" : "pubkeyhash",
              "addresses" : [
                "SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP"
              ]
            }
          }
        ]
      }
    }
    
    Parameter Type Description
    reply object The transaction data of the specified transaction ID and blockchain.

    xrGetAllBlocks

    Sample Data

    {
      "blockchain": "SYS",
      "start_block": 125121
    }
    

    This call is used to retrieve the block data for every block of the specified blockchain from the given start block through to the current block height.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetAllBlocks SYS 125121
    

    xrGetAllBlocks [blockchain] [start_block] [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    start_block int The earliest block height to retrieve.
    confirmations int (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "reply" : [
        {
          "hash" : "f2533eddc5c0236d5f41e1e09a9159bcb47023d44797a6545e0e3b825cf95e9b",
          "confirmations" : 2,
          "size" : 1007,
          "height" : 125121,
          "version" : 805306624,
          "versionHex" : "30000100",
          "merkleroot" : "5b2b595de4f657584b296fa44bad64b1a3e7dc4d6889fc8c9d6d0c95a854db72",
          "tx" : [
            "5b2b595de4f657584b296fa44bad64b1a3e7dc4d6889fc8c9d6d0c95a854db72"
          ],
          "time" : 1533012820,
          "mediantime" : 1533012478,
          "nonce" : 0,
          "bits" : "18091baf",
          "difficulty" : 120715641906.91769409179687500,
          "chainwork" : "0000000000000000000000000000000000000000003825a61e54ed44058b6034",
          "auxpow" : {
            "tx" : {
              "hex" : "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5903e02708162f5669614254432f4d696e65642062792079776e672f2cfabe6d6d1279c855d8aa2173e349a9762e19d4e05efe031f932b06ffcf33c19644a75b35040000000000000010124a9601d228401c5335cca9122622a2ffffffff02e9b80e4c000000001976a914536ffa992491508dca0354e52f32a3a7a679a53a88ac0000000000000000266a24aa21a9edadd1294ea7e1b2d405002e7b03980efaa55045ba48c23f1093589d92987fcec900000000",
              "txid" : "560169c9931d54bcf90a1d05e16714849c8477f0f95f8dcca3cf5fbd1efde88c",
              "size" : 221,
              "version" : 1,
              "locktime" : 0,
              "vin" : [
                {
                  "coinbase" : "03e02708162f5669614254432f4d696e65642062792079776e672f2cfabe6d6d1279c855d8aa2173e349a9762e19d4e05efe031f932b06ffcf33c19644a75b35040000000000000010124a9601d228401c5335cca9122622a2",
                  "sequence" : 4294967295
                }
              ],
              "vout" : [
                {
                  "value" : 12.76033257000000098,
                  "valueSat" : 1276033257,
                  "n" : 0,
                  "scriptPubKey" : {
                    "asm" : "OP_DUP OP_HASH160 536ffa992491508dca0354e52f32a3a7a679a53a OP_EQUALVERIFY OP_CHECKSIG",
                    "hex" : "76a914536ffa992491508dca0354e52f32a3a7a679a53a88ac",
                    "reqSigs" : 1,
                    "type" : "pubkeyhash",
                    "addresses" : [
                      "SUuBGCD7Ff3C2ozR6osYguPeXNho98S5qR"
                    ]
                  }
                },
                {
                  "value" : 0.00000000000000000,
                  "valueSat" : 0,
                  "n" : 1,
                  "scriptPubKey" : {
                    "asm" : "OP_RETURN aa21a9edadd1294ea7e1b2d405002e7b03980efaa55045ba48c23f1093589d92987fcec9",
                    "hex" : "6a24aa21a9edadd1294ea7e1b2d405002e7b03980efaa55045ba48c23f1093589d92987fcec9",
                    "type" : "nulldata"
                  }
                }
              ],
              "blockhash" : "000000000000000003f7704e8418f82a706e1adf5a443fe2d1bbafd763d0aa55"
            },
            "index" : 0,
            "chainindex" : 2,
            "merklebranch" : [
              "dc642d030c399e6df1ff2713724ba359d22122d1389e8c7b27cd8b3187ce4059",
              "e600abf23ef6c9035cc5263cf485e6d7307578849874b0872797a69e167b407a",
              "765534aea344ec49447539f29003547e08bdd2f7bac4a89044742138b5c60c01",
              "279b38798bd992e6e2ca2e11d34984f08f3133bbbe35ac9aa893299c849451b1",
              "20b844f21ca134a4a2eb2472f8b44a3c8f7a28e5ed07880fb6b5ce30b86047ca",
              "409c54e20ce4c5a89c98d5bd8f6d1f584e66484e70fb4bcf6ccf01b847d3c2b3",
              "5767d0ee43e176ea6bf0d19c3f4dc7dd87d4b57c3a925a43cb70e89988cca4f8",
              "6ccbdf7f7821cfe77f825d4ea31ae888892908f0d65673a491a86b25652a834c",
              "19b09c19b446def1c7320a3142588ad39103ea8fc0771f6b16b3eed70d0b5987",
              "e965cbe66dffa469be26cf152ba89d6bc42b0bf35b82cfc7ad7a617d42cbaad1",
              "201af6392cbb709712db1e5f8e51345bc7810eb3f52432ad95588fb09688ffdd",
              "0afd4499f211ad1cb90be9978fa80a71466551164ec5b07031b04063526113a7"
            ],
            "chainmerklebranch" : [
              "b32623d9da0481fc5b184473d6238eb6b60c6da14e55343174fe031114c4e688",
              "e3b97176e2c65013066f361a298493a3427668ad6264642022b75b3ae3a0421d"
            ],
            "parentblock" : "00000020088f8db22759d52f1699f1ffe6279d5058c0f8e5dad020000000000000000000e57036cbd7e4f7b019658c0e824f3c36c8a3c6ebcca4fdfaaa4839fa0c48f92592eb5f5b7b4f2f176765fa90"
          },
          "previousblockhash" : "e24ff358a98d1d7b4c66b6e2dcaaead0c8ed7cb148263cb69023b07b93bb6b1f",
          "nextblockhash" : "f15cb4628a5f286a9bb4b3495cdb2736afbea0d28222e3128e619bb9ec6c16c6"
        },
        {
          "hash" : "f15cb4628a5f286a9bb4b3495cdb2736afbea0d28222e3128e619bb9ec6c16c6",
          "confirmations" : 1,
          "size" : 1305,
          "height" : 125122,
          "version" : 805306624,
          "versionHex" : "30000100",
          "merkleroot" : "a43bebca83ab1de2da3c6113b21f875bd5e3decff9412cc95341a080285fa2da",
          "tx" : [
            "66c1a57f5cd7c5880876f9b71aaf54e46668a60e4ca2a9417c97d6c448732025",
            "446fb23f754388be49d6473780abc80e46649d6c6fb48adb01df9e333c92b459"
          ],
          "time" : 1533012894,
          "mediantime" : 1533012624,
          "nonce" : 0,
          "bits" : "1808fc27",
          "difficulty" : 122370451899.92539978027343750,
          "chainwork" : "0000000000000000000000000000000000000000003825c29c4a54f55a22512d",
          "auxpow" : {
            "tx" : {
              "hex" : "01000000010000000000000000000000000000000000000000000000000000000000000000ffffffff5c03e02708192f5669614254432f4d696e656420627920687367313131312f2cfabe6d6d79a48c9484e032e1ab8c9a3b682bfc48c2047fea605d42b8b2afc9284bc23b5c040000000000000010134ac90066ce6c782d4dd90076b16100ffffffff02aa12124c000000001976a914536ffa992491508dca0354e52f32a3a7a679a53a88ac0000000000000000266a24aa21a9ed3a8eb94b422b183a93c1956f005e56f11b06bde47a06c201c48f80756ea74a1000000000",
              "txid" : "b1f0a02d6512cf36a208e29aa65c6247f4f86dc7126d27d86ee76dc939422522",
              "size" : 224,
              "version" : 1,
              "locktime" : 0,
              "vin" : [
                {
                  "coinbase" : "03e02708192f5669614254432f4d696e656420627920687367313131312f2cfabe6d6d79a48c9484e032e1ab8c9a3b682bfc48c2047fea605d42b8b2afc9284bc23b5c040000000000000010134ac90066ce6c782d4dd90076b16100",
                  "sequence" : 4294967295
                }
              ],
              "vout" : [
                {
                  "value" : 12.76252842000000065,
                  "valueSat" : 1276252842,
                  "n" : 0,
                  "scriptPubKey" : {
                    "asm" : "OP_DUP OP_HASH160 536ffa992491508dca0354e52f32a3a7a679a53a OP_EQUALVERIFY OP_CHECKSIG",
                    "hex" : "76a914536ffa992491508dca0354e52f32a3a7a679a53a88ac",
                    "reqSigs" : 1,
                    "type" : "pubkeyhash",
                    "addresses" : [
                      "SUuBGCD7Ff3C2ozR6osYguPeXNho98S5qR"
                    ]
                  }
                },
                {
                  "value" : 0.00000000000000000,
                  "valueSat" : 0,
                  "n" : 1,
                  "scriptPubKey" : {
                    "asm" : "OP_RETURN aa21a9ed3a8eb94b422b183a93c1956f005e56f11b06bde47a06c201c48f80756ea74a10",
                    "hex" : "6a24aa21a9ed3a8eb94b422b183a93c1956f005e56f11b06bde47a06c201c48f80756ea74a10",
                    "type" : "nulldata"
                  }
                }
              ],
              "blockhash" : "000000000000000004039a3795a787502ef9eb528ff7efec9e056b0b2b44d9aa"
            },
            "index" : 0,
            "chainindex" : 2,
            "merklebranch" : [
              "dc642d030c399e6df1ff2713724ba359d22122d1389e8c7b27cd8b3187ce4059",
              "e600abf23ef6c9035cc5263cf485e6d7307578849874b0872797a69e167b407a",
              "765534aea344ec49447539f29003547e08bdd2f7bac4a89044742138b5c60c01",
              "279b38798bd992e6e2ca2e11d34984f08f3133bbbe35ac9aa893299c849451b1",
              "20b844f21ca134a4a2eb2472f8b44a3c8f7a28e5ed07880fb6b5ce30b86047ca",
              "39e23fbbf70797fc8f6b33394f9fab7435e13ea37906fb40ef1d3d7ae7b3b721",
              "1dcf170541371bf7b842bf7615278558916ac8b0dfe3af7d89180f377b8401b8",
              "97044ea6be9754aea75ce27cd60e967d7363d64e378d8ab6385365751247340c",
              "dd08a02d449ede20f458e8c2580762701927b9a65a903c9e71bc0130839a6b31",
              "b012c45679777632a16563b8672cb4d58326ef7a2dd7c04b8bdd1e3e2f272fec",
              "a29d3463c403808c7dfdc5cbc42457b13a14771e7c8c5fed24ef12f7e437d00d",
              "d1025b422ef60f5194d182998749f0e489c46fa50b2826c3028b74e50a5e8257"
            ],
            "chainmerklebranch" : [
              "b32623d9da0481fc5b184473d6238eb6b60c6da14e55343174fe031114c4e688",
              "e3b97176e2c65013066f361a298493a3427668ad6264642022b75b3ae3a0421d"
            ],
            "parentblock" : "00000020088f8db22759d52f1699f1ffe6279d5058c0f8e5dad02000000000000000000006e05d148ad92f8ba0b9ceea63b9c2f10e3013e90ab646609b39834c0fbb95009eeb5f5b7b4f2f177580f4e1"
          },
          "previousblockhash" : "f2533eddc5c0236d5f41e1e09a9159bcb47023d44797a6545e0e3b825cf95e9b"
        }
      ]
    }
    
    Parameter Type Description
    reply array The block data for every block of the specified blockchain from the given block through to the current block height

    xrGetAllTransactions

    Sample Data

    {
      "blockchain": "SYS",
      "address": "SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP",
      "start_block": 125155
    }
    

    This call is used to retrieve all transactions of the given address for the specified blockchain. Optionally, transactions can be retrieved on from a specified block.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetAllTransactions SYS SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP 125155
    

    xrGetAllTransactions [blockchain] [address] [start_block](optional) [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    address string The address to retrieve the transactions of.
    start_block int (Optional Parameter) Defaults to 0.
    The earliest block to retrieve transactions through.
    confirmations int (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "reply" : [
        {
          "txid" : "9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51",
          "size" : 192,
          "version" : 2,
          "locktime" : 0,
          "vin" : [
            {
              "txid" : "10f28315098fff366e2dfba23afacc10ddb5ac30a403d6396cc2d35739f06a79",
              "vout" : 1,
              "scriptSig" : {
                "asm" : "30450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad[ALL] 02e927a2a1d4a613ed3fa73bf1169beaf4e95a6348afac6613e283d80b9bf2abba",
                "hex" : "4830450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad012102e927a2a1d4a613ed3fa73bf1169beaf4e95a6348afac6613e283d80b9bf2abba"
              },
              "sequence" : 4294967295
            }
          ],
          "vout" : [
            {
              "value" : 1.43000000000000038,
              "valueSat" : 143000000,
              "n" : 0,
              "scriptPubKey" : {
                "asm" : "OP_DUP OP_HASH160 7be755600f2fd9f3518be6ededb38e2498f51ff5 OP_EQUALVERIFY OP_CHECKSIG",
                "hex" : "76a9147be755600f2fd9f3518be6ededb38e2498f51ff588ac",
                "reqSigs" : 1,
                "type" : "pubkeyhash",
                "addresses" : [
                  "SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP"
                ]
              }
            }
          ]
        }
      ]
    }
    
    Parameter Type Description
    reply array The transactions of the given address for the specified blockchain and block height.

    xrGetBalance

    Sample Data

    {
      "blockchain": "SYS",
      "address": "SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP"
    }
    

    This call is used to retrieve the balance with a precision of X.XXXXXX of the given address with for the specified blockchain.

    Note: This call is not currently supported for querying the balance of addresses with UTXO's older than a few thousand blocks.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetBalance SYS SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP
    

    xrGetBalance [blockchain] [address] [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    address string The address to retrieve the balance of.
    confirmations int (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "reply" : "0.000000"
    }
    
    Parameter Type Description
    reply object The balance with a precision of X.XXXXXX of the given address for the specified blockchain.

    xrSendTransaction

    Sample Data

    {
      "blockchain": "SYS",
      "signerd_tx": "0200000001796af03957d3c26c39d603a430acb5dd10ccfa3aa2fb2d6e36ff8f091583f210010000006b4830450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad012102e927a2a1d4a613ed3fa73bf1169beaf4e95a6348afac6613e283d80b9bf2abbaffffffff01c0018608000000001976a9147be755600f2fd9f3518be6ededb38e2498f51ff588ac00000000"
    }
    

    This call is used to submit a locally signed transaction on the specified blockchain.

    Request Parameters

    Sample Request

    blocknetdx-cli xrSendTransaction SYS 0200000001796af03957d3c26c39d603a430acb5dd10ccfa3aa2fb2d6e36ff8f091583f210010000006b4830450221008d807ad2585d4775e57c105d16f12f5eb7925a3f8f66b077f7944ec74e421ed9022067105602af2705d4456ccd68db8b4eb327cdb5e55e7de98d7ba9f1213a75a1ad012102e927a2a1d4a613ed3fa73bf1169beaf4e95a6348afac6613e283d80b9bf2abbaffffffff01c0018608000000001976a9147be755600f2fd9f3518be6ededb38e2498f51ff588ac00000000
    

    xrSendTransaction [blockchain] [signed_tx]

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    signed_tx string The signed transaction HEX.

    Response Parameters

    Sample 200 Response

    {
        "reply" : "9e5db236f75babe4e28c17f0ed1eddbcfdb5bde8a69750e1a4952d110c620e51"
    }
    
    Parameter Type Description
    reply object The transaction hash of the sent transaction.

    xrGetBalanceUpdate

    Sample Data

    {
      "blockchain": "SYS",
      "address": "SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP"
    }
    

    This call is used to retrieve the net change in balance of the given address since a certain block on the specified blockchain.

    Request Parameters

    Sample Request

    blocknetdx-cli xrGetBalanceUpdate SYS SYb9Gmcwj1aXUV86cKpnCD8SR7hvZgbKTP 125157
    

    xrGetBalanceUpdate [blockchain] [address] [start_block](optional) [confirmations](optional)

    Parameter Type Description
    blockchain string The token symbol of the blockchain (BTC, LTC, SYS, etc.).
    address string The address to retrieve the balance of.
    start_block int (Optional Parameter) Defaults to 0.
    The earliest block to retrieve transactions through.
    confirmations int (Optional Parameter) Defaults to 3.
    The number of Service Nodes the call is sent to for consensus on the final response.

    Response Parameters

    Sample 200 Response

    {
      "reply" : "1.430000"
    }
    
    Parameter Type Description
    reply string The addresses net change in balance since the given block on the specified blockchain.

    Changelog

    This API documentation will be continuously updated to improve descriptions, instructions, and overall clarity on how to use the API and begin building on the Blocknet Protocol. An overview of changes can be viewed below.

    To receive notifications and stay informed on important developer updates and changes relating to the Blocknet Protocol, subscribe to the developer notification emailing list.



    Updates

    8/31/2018
    8/21/2018
    8/10/2018
    8/3/2018
    6/4/2018








    cli