An Introduction to Dash Platform, DAPI, and Drive
By: Dana Alibrandi
Tags: Fintech, Finance, Developer, Dash, Blockchain

Following the open sourcing of Dash Core Group’s (DCG) project repos, we are excited to provide the community and the general public with more insight into our product development. Before going further, I would like to provide background for our product thinking, through a high-level introduction to the Dash payments network and its vision for the future.

Dash is a leading cryptocurrency and p2p network, allowing individuals to send money to anyone, anywhere, for a nominal network fee, typically less than one cent ($0.01 USD). DCG is one of the many organizations working on behalf of the Dash network. Our mission is to build the most user friendly payments network in the world. In that regard, our primary efforts have been focused on evolving our network technology and forging partnerships with organizations and businesses. Evolution, DCG’s vision for upgrading the Dash network, involves several distinct initiatives including Core protocol upgrades and the development of the most user-friendly crypto wallet to date.

In order to facilitate the development of this new wallet, as well as many other use cases, DCG is building Dash Platform, an application development platform leveraging Dash’s masternode network and blockchain. Comprised of two main architectural components, Drive and DAPI, these components turn the Dash p2p network into a cloud, through which developers will be able to integrate their applications. For our MVP release, the platform will primarily act as a Database as a Service, using data contracts to define custom data structures for applications, storing that application data on our masternode network, and notarizing that data via our blockchain.

While still in active development, the DCG team is happy to invite the community to review our code, assess our security, and contribute toward our development as we progress toward our v1.0 release.

Next, let’s delve into the two main components comprising Dash Platform: Drive (decentralized storage) and DAPI (decentralized API). These reference implementations are written in Node.js.

Drive, Decentralized Storage on the Dash Masternode Network

In order to integrate applications with Dash Platform, it is necessary for developers to create a data contract. This data contract will describe the data structures comprising their application. It’s analogous to creating a database schema for a document-oriented database like MongoDB.

Any data created by users of your application will be validated and verified against this contract. Upon successful validation/verification, your application data will be uploaded to Drive, where it will be stored on our masternode network. In exchange for hosting this data, masternode owners will be compensated using fees charged to users, similar to traditional transaction fees. These fees will be based on user-requested data operations such as reading, writing, and storage duration. Our PoSe (proof-of-service) algorithm will be updated to keep track of whether masternodes are hosting Drive, thereby making them eligible for compensation in exchange for their service to the network.

Data is uploaded to Drive via state transitions, which are special transactions that describe a transition in your application’s state. A record of your application’s state transitions is stored in Drive, allowing you to view your application data at different points in time. This provides potent functionality for use cases that require high levels of trust between multiple, independent parties. This functionality facilitates the access of records which are secured and verified according to our consensus protocol, rendering them auditable by any involved party. Some example use cases include chain-of-custody, digital rights management, supply chain, property records, and audit management.

Your application’s state view is the current state of its data. This data is stored in a MongoDB instance, allowing for quick access. Your application’s historical state transitions are stored in IPFS, which also propagates your application data to other nodes in our network. Consequently, application data is replicated several times over, protecting application data against any individual node downtime in our network.

DAPI, Dash’s Decentralized API

Clients will be able to integrate their applications to Dash Platform via DAPI (dæ-pee), our distributed, decentralized API. DAPI is an HTTP API exposing JSON-RPC endpoints. Through these endpoints, developers will be able to send and retrieve application data via Drive, as well as query the blockchain, eventually replicating the functionality of Insight through a more developer-friendly interface. In effect, DAPI provides developers with the same access and security of a full node, without the cost and maintenance overhead.

Developers will use DAPI to submit state transitions for storage in Drive. The fees for submitting these state transitions will be comprised of a fixed transaction cost, similar to a normal transaction fee, and a variable cost determined by the size of the data being stored. In a typical p2p network, excessive leeching behavior can drain a network of its speed and efficiency. This free-rider problem is solved through our fee structure, which ensures that masternodes are adequately compensated at a level that supports the demands of the network.

Unlike traditional APIs which have a single point of failure, DAPI allows clients to connect to different instances depending on resource availability in the Dash network. If a masternode goes offline, taking its DAPI instance with it, then clients will be able to seamlessly connect to and retrieve their application data via another instance.

Developers will have the option to connect to DAPI directly or use a client library provided by Dash Core Group. This initial client library, dapi-client, is a relatively simple API wrapper, providing function calls to our endpoints. Eventually, a more robust client library will be released that will incorporate advanced functionality, aiding developers with more complex platform development and payment processing use cases.

Next Steps

Our immediate goal is to continue active development of DAPI and Drive in order to support the release of the DashPay wallet. Consequently, Dash Platform will be available for development as part of Release 1.0. After this initial release we will continue evolving the platform, eventually providing developers with a full stack for development. We are actively exploring additional features such as object storage, data triggers, sharding, developer tools and frameworks, off-network state transition storage, and more. If you’d like to take a deeper dive into Dash Platform and Evolution, you can view the design document here. On behalf of the DCG members working on this product, I’m excited to invite the community to join us in the evolution of Dash by sharing your thoughts and your PRs.