{"activeVersionTag":"latest","latestAvailableVersionTag":"latest","collection":{"info":{"_postman_id":"8331f053-04a0-426c-b676-0fd7069811c5","name":"Dispatch Devnet","description":"### MainNet: [http://scanner.dispatchlabs.io](http://scanner.dispatchlabs.io)\n### DevNet: [http://devnet.dispatchlabs.io](http://devnet.dispatchlabs.io)\n\nYou are a badass developer planning to build a decentralized app (dapp) with the Dispatch Protocol. You will find all the documentation you need right here. You can even use this site to generate API requests for cURL, jQuery, Ruby, Python, NodeJS, PHP, Go. Just select your language then select the API call. When you are ready to share your progress, you just submit your dapp to our directory and collect rewards.\n\nBefore you start coding, you may want to create an account and then play around with the [Postman](http://getpostman.com) API collection to query the account on the live [DevNet](https://api.dispatchlabs.io/#41392da9-896e-43fa-8ebd-478004175ff8), [Mainnet](https://api.dispatchlabs.io/#7e35497d-3eed-4479-a8cd-296115deec79), or a copy of Dispatch running on your [Localhost](#27e6d758-b505-4fc7-bf1c-fa66d8fb57d1). \n\n![](https://cdn-images-1.medium.com/max/2000/1*2FJs_UC6qID5d5tfEZszsQ.gif)\n\nTo jumpstart your dapp development, you can also walk through our [JavaScript guide](#4-jumpstart-with-javascript) or  [go to our GitHub](#5-git-our-githubs) to get one of our SDKs (Go, Javascript, Java) or borrow from the open source apps (Ionic, Angular).\n\n![](https://cdn-images-1.medium.com/max/2000/1*W8Y-PMg6zgyj2AW7YrHf2Q.gif)\n\n# 1. Access your Account\nLet's start by creating your account and getting some tokens by joining our discord (we are here to help). If you are a developer, consider using our Go client's local API or the Javascript SDK. If you aren't a developer, you can follow these steps:\n1. Go to [http://devnet.dispatchlabs.io/](http://devnet.dispatchlabs.io/) to view the DevNet’s Scanner\n2. Click **Deploy Smart Contract** to view the built-in developer tool\n3. Click **Compile** -> and you will see example warnings below the contract\n4. Click **Deploy** -> and you will see a request for a private key\n5. Click **Generate New Private Key and Address**\n6. ***Save your private key somewhere!***\n\n![](https://cdn-images-1.medium.com/max/1600/1*_d2pLARkeA6iF5e8VnkZ0w.png)\n\n# 2. Take our Tokens\nCopy paste your account's public address into our **[Discord channel](http://dispatchlabs.io/discord)** and we will send you DevNet tokens. \n* [Join Dev Support on Discord](https://dispatchlabs.io/discord)\n\nPlease fill out the [developer registration form](https://dispatchlabs.io/developers-signup/) and we will send you updates on development and special goodies only for developers.\n* [Register for Devnet](https://www.dispatchlabs.io/developers-signup/) \n \nDevelopers who build apps or dev tools can [Submit your App for review](https://apps.dispatchlabs.io/apps/create) to be eligible for developer grants of tokens. \n* [Dispatch Directory](https://apps.dispatchlabs.io)\n* [Submit your App for review](https://apps.dispatchlabs.io/apps/create) \n\nWe are an open-source project and encourage community contribution with developer awards for finding issues or fixing them in our core Go client [Disgo Issues](https://github.com/dispatchlabs/disgo/issues). We're excited to talk to developers and will happily help curious engineers get aquatinted with the code base. Curious minds are encouraged to email us at [devs@dispatchlabs.io](mailto:devs@dispatchlabs.io).\n* [Help us find/fix bugs](https://github.com/dispatchlabs/disgo/issues)\n* [Email devs@dispatchlabs.io!](mailto:devs@dispatchlabs.io)\n\nIf you are interested in buying tokens, please contact our head of investor relations, [shadan@dispatchlabs.io.](mailto:shadan@dispatchlabs.io)\n\n\n# 3. Play with Postman\nYou don’t even need to write a line of code to test out our API calls. Just download the free [Postman app](https://www.getpostman.com/apps) and click [Run in Postman](https://www.getpostman.com/collections/44445c8f300ba8c302ec). Select the API call you want on the left and just click **Send**! Go ahead and walk through each of the API calls. \n\n![](https://cdn-images-1.medium.com/max/2000/1*2FJs_UC6qID5d5tfEZszsQ.gif)\n\nIn the top right you’ll see we’ve included a Dispatch Devnet environment so the API calls will work right away. You can edit the parameters to point to you own local cluster or to the Mainnet when you’re ready.\n\n![](https://cdn-images-1.medium.com/max/3200/1*w1PCJki_9CJZgywEGkeQpA.png)\n\nPostman can also create code snippets in almost any language. This is one of the best use cases for Postman and will save you tons of time. \n\n# 4. Jumpstart with Javascript\n\nLet’s walk through deploying a Smart Contract on Dispatch’s network using our Javascript SDK. First we will clone the SDK from the Dispatch GitHub and then run through a few sample example transactions. Note that this guide is based on Mac OS X and may not be perfect for Windows users.\n\nFirst, I created a new directory called **getting-started** and then cloned the **[Dispatch Node JS SDK](https://github.com/dispatchlabs/dispatch-js)** repository from Dispatch’s GitHub.\n\n    mkdir getting-started\n    cd getting-started\n    git clone [https://github.com/dispatchlabs/dispatch-js](https://github.com/dispatchlabs/dispatch-js)\n\n### Check that you have Node JS installed\n\nTo check if you have Node.js and NPM installed, run these commands in your terminal:\n\n    node -v\n    npm -v\n\nIf you don’t have Node JS, let’s fix that. You can download and install [Node JS](https://nodejs.org/en/download/) from that project’s [official website](https://nodejs.org/en/download/).\n\nIf you’d rather do it via command line, you can install node using [Homebrew](https://brew.sh). If you don’t have Homebrew, run these commands in Terminal:\n\n    xcode-select --install \n    /usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n    brew doctor\n\nNow just run the install command and Node JS and npm will be installed together:\n\n    brew install node\n\n### Install the Dispatch Node JS SDK\n\nOnce you’ve got the prerequisites installed, you can install the dispatch-js client using npm. Make sure you are in the directory named dispatch-js that you cloned from GitHub.\n\n    cd getting-started \n    cd dispatch-js\n    npm install\n\nIf you happen to get errors with using npm, I recommend uninstalling Node completely with this command and then reinstall with the latest version.\n\n    brew uninstall --force node\n    sudo rm -fr /usr/local/lib/node_modules/npm\n    brew install node\n    sudo npm install -g npm@latest\n\n### What can I do with the SDK?\n\nThe SDK is a good starting point to integrate any existing Node or Javascript application with the Dispatch protocol. You can *create accounts*, *send transactions* including transfers of licenses, and you can even *deploy and run smart contracts*. We will demonstrate each of these with examples.\n\n![](https://cdn-images-1.medium.com/max/2000/1*W8Y-PMg6zgyj2AW7YrHf2Q.gif)\n\n### There’s one more thing… Change Config.json to point to the DevNet\n\nBefore you use the SDK, you will want to switch from using the MainNet to the DevNet. Find and edit the **config.json** in the **lib** directory and input the DevNet’s seed node: **devseed.dispatchlabs.io** instead of the MainNet’s hostname **seed.dispatchlabs.io.** [Click here to find it on GitHub.](https://github.com/dispatchlabs/dispatch-js/blob/master/lib/config.json) You can also switch between environments by setting the NODE_ENV variable on the command line. \n\n    SET NODE_ENV=production\n    \nYou can also set the environment in your js file:\n\n    process.env.NODE_ENV = 'production';\n\n\n\n### Let’s run the examples!\n\nIt’s easy just run the examples with a command line from the dispatch-js directory.\n\n    npm run examples\n\nThe examples will run, you’ll see the output of the account.js and transactions.js as well. If you’d like to comment them out, just edit the index.js file.\n\n### It’s as easy as 1 + 1 = 2\n\nYou’ll see on the terminal console the result of the contract in the contractResult is 2! Congratulations you just did addition on the Dispatch distributed ledger.\n\n    Contract execution result:\n    {\n    \"transactionHash\":\n    \"a269d8867d506930c45a1ea7bd4c7f43b149d2d2066cdc38cf01b20a161704b0\",\n    \"status\":\"Ok\",\n    \"contractAddress\":\"2b109862e3276d7d6938138b7daddb60e246ac0f\",\n    **\"contractResult\":[2],**\n    \"created\":\"2018-09-18T20:06:11.113555674Z\"\n    }\n\n### Validate with the Dispatch Ledger.\n\nYou should see the results instantly appear on the Dispatch ledger with our network scanner [**http://scanner.dispatchlabs.io/](http://scanner.dispatchlabs.io/) **or our [**mobile wallet for iOS and Android](https://dispatchlabs.io/technology-old/mobile-wallet/)**. Both are open source projects you can copy and use for your own project.\n\n### How does it work?\n\nSo you want to see what’s going on behind the scenes? If you browse the code on [**GitHub](https://github.com/dispatchlabs/dispatch-js/tree/master/examples)** (or your local clone) go to the [***examples](https://github.com/dispatchlabs/dispatch-js/tree/master/examples)*** directory, and you will see the scripts to generate an account, transfer licenses, deploy a smart contract, and execute the smart contract.\n\n![](https://cdn-images-1.medium.com/max/3200/1*gdbqL3TVjhshmRV-qlyFFg.png)\n\n### **Create Account**\n\nIn the **contract.js** file first you’ll see two accounts “temp” and “test” are set as constants. For the “temp” account a new private key will be generated using the init command. The “test” account however will be configured with the name and private key of an account with existing licenses.\n\n    **// Account() is a constructor with no required inputs\n    **const temp = new DisNodeSDK.Account();\n\n    **// Use account.init() to generate a private key\n    **temp.init();\n\n    **// Account() can also accept any account fields; the most important being the privateKey**\n    const test = new DisNodeSDK.Account({name: 'NodeSDKTest', privateKey: '[redacted]' });\n\n### **Transfer Licenses**\n\nNext we will send some licenses from the “test” account to the “temp” account.\n\n    **// Account objects can send licenses to other accounts directly; returning the resulting transaction\n    **let tx = test.sendTokens(temp, 5);\n\n### **Write a Smart Contract**\n\nLearning Solidity is a great goal, and I’m trying to learn myself. However, it’s just as easy to find existing smart contracts from others for testing. We’ve written a very simple contract called “math” with a single function called “plus one” that adds 1 to a number.\n\n    **// This is a smart contract that adds 1 to the input \n    **pragma solidity ^0.4.24;\n    contract math { \n        function plusOne(uint256 y) \n        pure public returns(uint256 x) \n        { x = y + 1; } \n     }';\n\n### **Deploy Smart Contract**\n\nWe will insert the source code of the Smart Contract into the **contract.js** file for simplicity. You could also use a file operation in Node to get the code from a Solidity file.\n\n    **// Provide source code as a string\n    **const sourceCode = 'pragma solidity ^0.4.24;contract math { function plusOne(uint256 y) pure public returns(uint256 x) { x = y + 1; } }';\n\n    **// Use Transaction.compileSource to easily compile solidity code\n    **const compiled = DisNodeSDK.Transaction.compileSource(sourceCode);\n\n    **// Accounts can create Smart Contracts using compiled values\n    **const contract = test.createContract(compiled.contracts[0].bytecode, compiled.contracts[0].abi);\n\n### **Execute Smart Contract**\n\nWe can now execute the smart contract with a single command, and we are going to add the input parameter of “1.0”. Feel free to edit this to change the input.\n\n    **// Exection happens from the account, to the contract, along with the method and parameters**\n    const execute = test.executeContract(contract, 'plusOne', [1.0], compiled.contracts[0].abi);\n\nThanks for walking through the code with me, if you have any feedback on this article you email me at **[colin@dispatchlabs.io](mailto:colin@dispatchlabs.io)**. If you want to talk right away, you are invited to talk to us anytime on the [**developer chat on Discord](https://discord.gg/bBkwVau).**\n\n\n# 5. Get our Gits\nWe created a [tools repository for developers](https://github.com/dispatchlabs/dev-tools) including our own ERC-20 like token. Dispatch's main client is written  in Go, so we named it [DisGo](https://github.com/dispatchlabs/disgo). We also have SDKs written for [JavaScript](https://github.com/dispatchlabs/dispatch-js) and [Java](https://github.com/dispatchlabs/java-sdk). We have sample wallet apps written for [Ionic Mobile](https://github.com/dispatchlabs/mobile_wallet) and [Angular](https://github.com/dispatchlabs/scandis). Here is a list:\n* [Dev Tools](https://github.com/dispatchlabs/dev-tools)\n* [JavaScript SDK](https://github.com/dispatchlabs/dispatch-js)\n* [Go Client and SDK](https://github.com/dispatchlabs/disgo)\n* [Java SDK](https://github.com/dispatchlabs/java-sdk)\n* [Angular Web-wallet and Smart Contract Tool](https://github.com/dispatchlabs/scandis)\n* [Ionic Mobile Wallet](https://github.com/dispatchlabs/mobile_wallet)\n\n\n# Dispatch in a Nutshell\nThe Dispatch Protocol is built with three main components:\n\n* [The Dispatch Ledger](#dispatch-is-different): Similar to the Bitcoin and Ethereum public ledgers you know and love, but with a new consensus algorithm that eliminates transaction fees, Delegated Asynchronous Proof of Stake (DAPoS).\n* [The Dispatch Artifact Network (DAN)](#artifact-network): A distributed network of data farmers who can hold onto big, bulky data that won’t fit in the ledger.\n* [The Dispatch Virtual Machine (DVM)](#virtual-machine): The smart-contract engine that glues together these two distributed networks.\n\n![](https://cdn-images-1.medium.com/max/2000/0*kcghEgujdCvDvHIw)\n\n## Features\nWe launched the Mainnet specifically for our (badass) community of Dapp developers to  with their projects. We already have a ton of killer features:\n* ⏱ [Eliminated transaction fees by rate-limiting transactions](eliminating-transaction-fees)\n* 📑 [Backwards-compatibility with EVM/Solidity smart-contracts](#virtual-machine)\n* 🤝 [DAPoS consensus algorithm for byzantine fault-tolerant consensus](#delegated-asynchronous-proof-of-stake)\n* 📡 [HTTP API for easy access to the network](#e3c1ced3-507d-42d7-8904-5e9eb542ca08)\n\n## Roadmap\nWe’re continuing to develop new features/functionality post-Mainnet launch. Here is some of the  functionality we will be adding:\n* 📚 [Bookkeepers](#bookkeepers)\n* 🗳 [Delegate elections](https://api.dispatchlabs.io/#decentralization)\n* 🙈 [Zero-Knowledge Analytics](#zero-knowledge-analytics-zka)\n* 📦 [Storage Orderbook](#dispatch-artifact-network-dan)\n* 🏎 Consensus Optimizations\n* 🔒 SSL support for Dapps\n\nThat's Dispatch in a Nutshell.\n\n![](https://cdn-images-1.medium.com/max/2000/1*zyAyVFGZFQ1rvNjCWVkdjw.png)\n\n# Dispatch is Different\nThe idea of a distributed ledger is fundamental to what makes blockchains so powerful. The Dispatch Ledger keeps track of everyone’s balances but also tracks things like smart contracts’ state, artifact custody, and pretty much anything else you’d want written into the public record for the rest of eternity.\n\nSo what makes the Dispatch Protocol different from all of the other distributed ledgers out there? Well for starters, we’re not technically a blockchain. This is because our DAPoS consensus algorithm actually runs a block-less architecture.\n\n![](https://cdn-images-1.medium.com/max/2000/1*gaDe0en9OOKUr2J1vVv0rQ.png)\n\nDispatch's DAPoS protocol is not a blockchain consensus protocol. There are no blocks, and it is not entirely immutable. DAPoS differentiates itself by handling individual transactions asynchronously via gossip protocol, not in lockstep. The validators in DAPoS consensus are each responsible for their own state or chain of transactions, but all functioning validators who receive all valid transactions can deterministically agree on the validity of all transactions and conclude on identical world states.\n\nIn the simple case of all the Delegates receiving transactions in the order they are published, the Delegates will receive a transaction and determine if it is valid or not. If a transaction is invalid, then no action is taken and the transaction is ignored. If a transaction is valid, the Delegate adds it to the end of its transaction chain and gossips the transaction with its validator peers. However, because the gossiping happens asynchronously, it is very likely that a Delegate will receive two or more transactions out of order. It is then up to the validator to sort the transactions by timestamp and re-evaluate the validity of transactions. By sorting and validating transactions asynchronously, the transaction throughput is decoupled from blocktimes entirely and the whole of the network can scale with the validation capabilities of the validators.\n\n## Eliminating Transaction Fees\nOne of the things we’ve seen developers really fall in love with about Dispatch is the fact that we have no transaction fees in our system. To figure out how we got rid of them, let’s think for a second about why they exist in the first place.\n\nTransaction fees serve two main purposes:\n1. To compensate validators for putting transactions in the ledger\n2. To prevent spam on the network\n\nWe solve the former by paying the Delegates a time-based salary minted right out of the protocol, instead of paying them what’s essentially transaction-based commission (which we believe makes them more honest as well).\n\nPreventing spam on the network is a little trickier. Our solution is **stake-based rate-limiting**. Much like traditional tech business models, most web-services will either charge you up front or limit how much you can use the service for free. We consider your percentage ownership of the network’s native token (the Divvy) to be equivalent to your ownership of the network’s bandwidth (measured in **Hertz** compared to Ethereum’s gas). So that means if you own 1 Divvy, you might be entitled to send around 1 transaction per day.\n\nSince the goal is to flatten out network spikes, we want to disincentivize sending transactions when network traffic is already really high. Instead of cranking up the prices like BTC, ETH, and EOS, we can crank up the time until you get your tokens back. So you can know that your 1 Divvy is always going to be worth that 1 transaction, even if you might have to wait a little longer before you can send another.\n\n## The Divvy Token\n\nThe fundamental resource of the Dispatch network is transaction bandwidth. The Dispatch Protocol divides or \"divvies up\" this resource based on the ownership of the native license, the Divvy. Dispatch is launching the network with a genesis of 18 billion Divvies, each divisible up to eight decimal places. Stakeholders vote on the salaries of the delegates, and in-turn, the rate of inflation of the Divvy. The smallest unit that makes up the Divvy is referred to as the Divvito, so: 108 Divvitos = 1 Divvy. \n\nThe value of the Divvy is directly related to the real-world usage of the network, so attackers cannot spam the network without a proportional investment in the network’s bandwidth. What users decide to do with their share of the bandwidth is their own decision, but tying the networks bandwidth to the value of the license should disincentivize behavior that would ultimately be harmful to the network.\n\n## Bandwidth in Hertz\n\nHertz is he unit of measurement for bandwidth consumed by a transaction. Instead of changing the price of transactions in times of high network traffic, Dispatch implements a variable time-to-reimbursement. This ensures that under most conditions, having some number of Divvy will always entitle the holder to some number of transactions. When the network usage is under-capacity, time-to-reimbursement will be quicker when network-wide traffic is low. The time-to-reimbursement will be greater when the network-wide traffic is high. These dynamic fractional reserves optimize to fully utilize network bandwidth at all times. Since each transaction could be a dramatically different amount of work process, network traffic is measured by the amount of hertz used over time. \n\nDispatch uses traffic volume to determine how long Hertz spent to perform a transaction is locked up. The range goes from 1 second to 24 hours. When the current days traffic rises higher than the weekly average, the time-to-reimbursement rises to mitigate traffic spikes. The base price of hertz exists to counter volatility in the price of Divvy and is set by the Delegates. Each Delegate gets one vote on the base price, and the final price is determined by taking the median of the Delegates’ votes rounded down. Delegates who keep the Hertz price high to reduce their own workload should be voted out by the Stakeholders and replaced with a Delegate whose base hertz price matches what the Stakeholders find ideal.\n\nBefore a valid transaction is executed, the sending account’s remaining hertz is calculated by subtracting the outstanding hertz spent by the account from the accounts balance. If the sending account has spent more in hertz han they have balance in their account, the transaction is considered invalid, and it is not gossipped. If in the execution of the transaction, the amount of Divvy spent on bandwidth exceeds the amount remaining in the accounts balance, an out of bandwidth error is returned. Delegates will record the valid transaction as unsuccessful, and the remaining balance spent on bandwidth is considered spent.\n\n# Delegated Asynchronous Proof-of-Stake \n\nTo keep all nodes in the network in agreement on what information is stored in the Dispatch Ledger, the Dispatch Protocol implements the new Delegated Asynchronous Proof-of-Stake (DAPoS) consensus algorithm. DAPoS is used to ensure that all network participants maintain an identical world state. DAPoS is a Byzantine fault tolerant delegated transaction gossip protocol that scales to the capacity of the hardware validating the transactions. Rate-limiting is implemented as an alternative to gas to create a system with zero transaction fees for Stakeholders.\n\nDAPoS uses elected Delegates, and operates on the gossiping of individual transactions rather than relying on the sequential distribution of blocks. DAPoS maximizes scalability of transaction throughput by minimizing the Delegates’ co-dependency. Once transaction information is evenly distributed between Delegates, each Delegate autonomously and deterministically accepts the Transaction into their chain and reports the validity of the Transaction. Work done by Delegates is redundant for the Byzantine security of the network.\n\n## How does DAPoS work? \nThe Stakeholders are accounts that hold Dispatch’s native token, the Divvy. They can use their balance to elect Delegates in charge of validating accepting transactions into the ledger. Delegates will gossip amongst themselves on the validity of transactions on a per-transaction basis, instead of batching them into blocks. The Delegates can be elected from a pool of volunteer Bookkeepers. The Bookkeepers are responsible for executing the transactions accepted into the ledger, applying the results to the state of the network (referred to as the world state), and reporting the network state to the end users.\n\n### Let’s look at an example transaction:\n1. An end user creates a transaction, cryptographically signs it with their private key, and sends it off to a Delegate to be validated\n2. A Delegate will receive that transaction and give it a simple check for validity (things like does the signature match the data? Is this transaction too old to be added into the ledger? Does the sender have the required balance?)\n3. Assuming the transaction looks good, the Delegate will sign the transaction as well and send it off to their peers\n3. Once a transaction has received two-thirds of the Delegate signatures, it is considered ‘accepted’ into the ledger\n4. Accepted transactions are then executed by all the Bookkeepers (including the Delegates) and state of the network is updated\n\n\n# Virtual Machine \nThe Dispatch Virtual Machine (DVM) is the Smart-Contract engine that ties together the Dispatch Ledger and the DAN. The DVM is backwards-compatible with the Ethereum Virtual Machine (EVM) by design. That means that 99% of all Solidity/EVM Smart-Contracts should be functional on Dispatch. Solidity and the solc compiler will compile down to the EVM bytecode that utilizes a majority of the functionality of the DVM. Dispatch intends to develop a compiler for a new high-level language called Solidity++ which will include all the base functionality of Solidity as well as the additional Artifact-related functionality.\n\n![](https://cdn-images-1.medium.com/max/1600/1*1BsqkH85BFDssFPGWtJhjA.jpeg)\nWe made most of our additions to EVM by introducing a new set of 0xd0 OpCodes that run mostly DAN functionality. A few of these new extensions include:\n\n* 0xd0 (ARTIFACT) — Returns the Merkle hash of the accounts Artifact\n* 0xd1 (ARTIFACTSIZE) — Returns the size in bytes of the accounts Artifact\n* 0xd2 (ARTIFACTSTRUCTURE) — Returns 0 for BLOB (Binary Large Object) Artifacts and 1 for structured Artifacts\n* 0xd3 (ARTIFACTENCRYPT) — Defined at time of account initialization. Returns 0 for unencrypted Artifacts and 1 for encrypted Artifacts\n* 0xd4 (READARTIFACT) — Formally declares the address of a new Downloader on the ledger\n\nAlso some modifications to the Ethereum opcodes have been made that provide alternative but compatible functionality. Examples include :\n* 0x41 (COINBASE)- The Dispatch protocol uses a delegated consensus mechanism that does not have block beneficiaries. Instead this value is replaced with the hash of the ordered list of Delegate addresses.\n* 0x44 (DIFFICULTY)- Block difficulty is always 0.\n* 0x45 (GASLIMIT)- Instead, returns the amount of Hertz consumed at the given time interval.\nand many more opcodes are updates with minimal changes such as mapping Ethereums gas to Dispatchs bandwidth measurement, Hertz.\n\n# Artifact Network\nThe Dispatch Artifact Network (DAN) is a collection of algorithms that support a network of decentralized data. The DAN is specifically designed to work with the Dispatch Ledger and the DVM, so integrating distributed data into your Dapp is as easy as writing a single smart contract.\n\nArtifacts are the distributed data objects stored in the DAN. Artifacts can be either structured (like sql) or BLOBs (Binary Large OBjects). A structured Artifact has several columns and rows of data, while a BLOB is something more like a movie, a .pdf, a VR asset, a side-chain, or some other big bulky file. Artifacts can be encrypted and sharded for security as the Uploader sees fit.\n\n![](https://cdn-images-1.medium.com/max/2000/1*TXdFX9EsNGaNI9rrudFlTw.png)\n\nMost of the algorithms in the DAN provide some level of security or functionality to the Artifacts in the DAN. Some of these algorithms include:\n\n* Storage Orderbook — Used to match Farmers providing data storage with Uploaders in need of decentralized storage\n* Kademlia DHT — Used to locate where in the network an Artifact can be found\n* Proof-of-Replication (PoRep) — Used to prevent one Farmer from pretending their multiple Farmers and claiming the rewards multiple times\n* Proof-of-Retrievability (PoRet) — Used to ensure Artifacts are still online and available\n* Multi-Party Make-it-Happen (MiH) — Protocol used to transfer custody of an Artifact between actors in the DAN\n* Update Deltas (∆) — Defines the difference between an Artifact (A) and its updated version (A’)\n\n# Zero-Knowledge Analytics \nWhile we were building out this network of decentralized data, we started thinking about the value of data. Business models like Google, Amazon, and Facebook are demonstrating that most of the value of data isn’t in the application layer, but the analytic layer.\n\nZero-Knowledge Analytics enables queries on data stored in the DAN that can return answers that are provably correct, without revealing the underlying data itself. This is a step in the right direction for consumer push for data sovereignty, but this is also an amazingly powerful tool for business that don’t want the risk associated with holding regulated data. Thanks to policies like HIPPA, GDPR, and the new California data privacy law, data is becoming toxic. Facebook is facing a $1.6 Billion fine from the EU for the breach of consumer data. In a world where we’re all holding our own data, this tool has the capabilities to revolutionize data-centric business models.\n\nZKA works using a combination of *Homomorphic Encryption*, *Secure Multi-Party Computation (SMPC)*, and *zk-Snarks*. The data is homomorphically encrypted and given to the querier so they can calculate their own encrypted answer. In the case that the data is held by multiple parties, all the participants use SMPC to determine the unencrypted answer and give it to the querier. A SNARK is then formed to prove that there exists some decryption key (d) that can decrypt the queriers encrypted answer into the SMPC unencrypted answer.\n\n![](https://cdn-images-1.medium.com/max/1600/1*C8fCpGmm9Q19_fRzij6CFw.jpeg)\n\n# Decentralization\n\nDelegated networks provide the scalability of a centralized system with the security of a decentralized system that has one major risk: collusion.\n\nSo that means we will not have a hand in selecting the initial pool of Delegates, and we especially won’t put them all in a group chat to talk about whether or not to print more tokens for themselves.\n\nOur plan is instead to launch the network with full control over the 5 Delegates and 1 seed node. When we believe the network is stable, we will flip the switch on Delegate elections. The community will then be able to elect as many Delegates from the community as they believe is safe and appropriate.\n\nOnce we believe the network to be stable and there is sufficient voter turnout, we will turn full Delegate control over to community-elected Delegates. The responsibility of Transaction validation will then fall entirely onto the community.\n\nStakeholders are welcome to elect as many Delegates as they deem appropriate, with the consideration of scalability vs. decentralization. In comparable delegated systems like Steemit, Stakeholders have elected around 90 Delegates.\n\n## Delegate Elections\n\nTo ensure everyone using the Dispatch network has a say in its governance, the delegated quorum of validator nodes is elected based on stake-based voting. Delegates are the most important actors to the consensus and security of the Dispatch network, so they should be chosen carefully. We fully encourage the community to elect Delegates that have shown their commitment and interest in helping the network by participating as a Bookkeeper, announcing their candidacy on a public forum, and revealing their validator machine hardware specs.\n\n## Bookkeepers\nDispatch utilizes the work of Bookkeepers to help Stakeholders hold Delegates accountable for their responsibilities, and to help the Delegates distribute information to the Stakeholders efficiently. Bookkeepers are responsible for executing the transactions accepted into the ledger by the Delegates. This makes the Delegates themselves a subset of the Bookkeepers. The Bookkeepers also record the states of the Delegates, so unresponsive Delegates can be reported and replaced quickly, and so there is an audit trail of accountability in case of a Delegate fork. Bookkeepers can also help reduce administrative stress from the Delegates, like syncing the chain. Anyone can elect to run a Bookkeeper node to help the network.\n\nBookkeepers can each be thought of as their own independent network scanners end users can query. Decentralizing the responsibility of reporting on the ledger will eliminate the single point-of- failure stress carried by traditional network scanners. Dispatch intends to build an interface with which end users can compare the states of the various Bookkeeper accounts.\n\n## Election Cycles\n\nDelegate election cycles happen on the hour every hour, and the deadline for Stakeholders is the calculated median of all the Election transactions Delegate count votes. At the launch of the network, while Dispatch controls all of the nodes, Dispatch will set the salary rate to 1 Divvy per hour and remove our stake in the Delegate salary as the Stakeholder voter turnout increases.\nThe number of Delegates and the Delegate salary is determined as the simple median of submitted votes. Both values have a maximum rate of change. The Delegate count has a minimum of 5 and can change by a maximum of 10% each election cycle. Unlike the Delegate count, the salary has no minimum, but can only change by a maximum of 0.1% each election cycle.\n\n## Election State\n\nStakeholders are entitled to one vote per full Divvy, rounded down. Stakeholders cast their votes as transactions of the Election type. Votes are submitted to the election as a percentage of account balance. All Stakeholders can vote on the three properties of the Election State: the number of Delegates, the ordered list of preferred Delegates, the salary of the elected Delegates. \n* Count: A scalar value representing how many of the top voted Delegates are considered officially elected.\n* Salary: A scalar value representing how many Divvy each Delegate’s account is credited for their work at the end of the next election cycle.\n* Delegates: An array of 160-bit addresses representing the ordered list of the highest- voted Delegates this election cycle. These addresses are considered the network’s official quorum for the remainder of the election cycle.\n\n# Blogs & Whitepapers\nIf you want to follow our development, check out our [development blog](https://medium.com/dispatchlabs/tagged/development) for frequent updates. Below are links to whitepapers, important GitHub repos, REST API calls, and how to get help.\n* [Getting Started Guide](https://dispatchlabs.io/getstarted)\n* [Developer Update Blog](https://medium.com/dispatchlabs/tagged/development)\n* [Easy to read Litepaper](https://dispatchlabs.io/litepaper)\n* [Technical Whitepaper](https://dispatchlabs.io/whitepaper)\n* [DAPoS Whitepaper](https://github.com/dispatchlabs/TechnicalDocs/blob/master/Introduction%20to%20DAPoS.pdf)\n \n","schema":"https://schema.getpostman.com/json/collection/v2.0.0/collection.json","isPublicCollection":false,"owner":"5216580","team":140776,"collectionId":"8331f053-04a0-426c-b676-0fd7069811c5","publishedId":"RWaGT9dB","public":true,"publicUrl":"https://api.dispatchlabs.io","privateUrl":"https://go.postman.co/documentation/5216580-8331f053-04a0-426c-b676-0fd7069811c5","customColor":{"top-bar":"FFFFFF","right-sidebar":"64178F","highlight":"E50085"},"documentationLayout":"classic-double-column","version":"8.10.1","publishDate":"2018-11-29T22:49:26.000Z","activeVersionTag":"latest","documentationTheme":"light","metaTags":{},"logos":{}},"statusCode":200},"environments":[{"name":"Dispatch DevNet ","id":"04dca0fe-4af3-4b85-b8e8-0ee5daaebbe0","owner":"5216580","values":[{"key":"ipAddress","value":"35.247.30.36","description":"","enabled":true},{"key":"testSeed","value":"35.197.127.151","description":"","enabled":true},{"key":"testNode","value":"104.198.6.12","description":"","enabled":true},{"key":"port","value":"1975","description":"","enabled":true},{"key":"pageNumber","value":"1","description":"","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"e7f4a35eeba81d2031feb2753892b886a2cdab9d","key":"accountAddress","enabled":true},{"key":"contractAddress","value":"b4f47d4a1716f19b583da6686ec09c3e52b8db86","description":"","enabled":true},{"key":"toAddress","value":"5fca768372eacb2fa39daf98685634bdd852a3b3","description":"","enabled":true},{"key":"fromAddress","value":"7bf5580620d91b55258a09dc9c1166f5542cc115","description":"","enabled":true},{"description":{"content":"","type":"text/plain"},"value":"9c3fc98a87c363b3fb7a90b15da17e860b3a5a9c3d7de3efa47f4761b59d3d89","key":"hash","enabled":true},{"key":"signature","value":"294d170975199bef45770019e9f5cbf85e703692ae8bd4b63d47f92b9c59279760fc5d4478f33fb4468f4b389862c086f98a92d73cee68768745f025fdb0951901","description":"","enabled":true},{"key":"privateKey","value":"70dcae0f1020d5b35f2be2df6146b432be594407121ac7c8cb48540ecc5e7ede","description":"","enabled":true},{"key":"amount","value":"5","description":"","enabled":true},{"key":"byteCode","value":"6080604052348015600f57600080fd5b50609c8061001e6000396000f300608060405260043610603e5763ffffffff7c0100000000000000000000000000000000000000000000000000000000600035041663f5a6259f81146043575b600080fd5b348015604e57600080fd5b506058600435606a565b60408051918252519081900360200190f35b600101905600a165627a7a723058208212759b5724708a681f9bc73b31e44ef1e0205bf72460536d4b0327511a82980029","description":"","enabled":true},{"key":"method","value":"plusOne","description":"","enabled":true},{"key":"params","value":"10","description":"","enabled":true},{"key":"abi","value":"[{\\\"constant\\\": true,\\\"inputs\\\": [{\\\"name\\\": \\\"y\\\",\\\"type\\\": \\\"uint256\\\"}],\\\"name\\\": \\\"plusOne\\\",\\\"outputs\\\": [{\\\"name\\\": \\\"x\\\",\\\"type\\\": \\\"uint256\\\"}],\\\"payable\\\": false,\\\"stateMutability\\\": \\\"pure\\\",\\\"type\\\": \\\"function\\\"}]","description":"","enabled":true},{"key":"testAccount","value":"7bf5580620d91b55258a09dc9c1166f5542cc115","description":"","enabled":true},{"key":"contractHash","value":"5dd295114a64a1aebd4363b7873736ec7c5e93d2e4a379a72c1b82f66f319207","description":"","enabled":true},{"key":"devSeed","value":"35.247.84.212","description":"","enabled":true},{"key":"devNode","value":"35.233.208.28","description":"","enabled":true}],"published":true}],"user":{"authenticated":false,"permissions":{"publish":false}},"run":{"button":{"js":"https://run.pstmn.io/button.js","css":"https://run.pstmn.io/button.css"}},"web":"https://www.getpostman.com/","team":{"logo":"https://res.cloudinary.com/postman/image/upload/t_team_logo_pubdoc/v1/team/0c17e53af69f00b4f67510ffa6f098f3aa7ca10cf808b713d89504e9eedbca99","favicon":"https://res.cloudinary.com/postman/image/upload/v1543530706/team/nemwixaap4bxbkhby0hh.ico"},"isEnvFetchError":false,"languages":"[{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"HttpClient\"},{\"key\":\"csharp\",\"label\":\"C#\",\"variant\":\"RestSharp\"},{\"key\":\"curl\",\"label\":\"cURL\",\"variant\":\"cURL\"},{\"key\":\"dart\",\"label\":\"Dart\",\"variant\":\"http\"},{\"key\":\"go\",\"label\":\"Go\",\"variant\":\"Native\"},{\"key\":\"http\",\"label\":\"HTTP\",\"variant\":\"HTTP\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"OkHttp\"},{\"key\":\"java\",\"label\":\"Java\",\"variant\":\"Unirest\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"Fetch\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"jQuery\"},{\"key\":\"javascript\",\"label\":\"JavaScript\",\"variant\":\"XHR\"},{\"key\":\"c\",\"label\":\"C\",\"variant\":\"libcurl\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Axios\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Native\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Request\"},{\"key\":\"nodejs\",\"label\":\"NodeJs\",\"variant\":\"Unirest\"},{\"key\":\"objective-c\",\"label\":\"Objective-C\",\"variant\":\"NSURLSession\"},{\"key\":\"ocaml\",\"label\":\"OCaml\",\"variant\":\"Cohttp\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"cURL\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"Guzzle\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"HTTP_Request2\"},{\"key\":\"php\",\"label\":\"PHP\",\"variant\":\"pecl_http\"},{\"key\":\"powershell\",\"label\":\"PowerShell\",\"variant\":\"RestMethod\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"http.client\"},{\"key\":\"python\",\"label\":\"Python\",\"variant\":\"Requests\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"httr\"},{\"key\":\"r\",\"label\":\"R\",\"variant\":\"RCurl\"},{\"key\":\"ruby\",\"label\":\"Ruby\",\"variant\":\"Net::HTTP\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"Httpie\"},{\"key\":\"shell\",\"label\":\"Shell\",\"variant\":\"wget\"},{\"key\":\"swift\",\"label\":\"Swift\",\"variant\":\"URLSession\"}]","languageSettings":[{"key":"csharp","label":"C#","variant":"HttpClient"},{"key":"csharp","label":"C#","variant":"RestSharp"},{"key":"curl","label":"cURL","variant":"cURL"},{"key":"dart","label":"Dart","variant":"http"},{"key":"go","label":"Go","variant":"Native"},{"key":"http","label":"HTTP","variant":"HTTP"},{"key":"java","label":"Java","variant":"OkHttp"},{"key":"java","label":"Java","variant":"Unirest"},{"key":"javascript","label":"JavaScript","variant":"Fetch"},{"key":"javascript","label":"JavaScript","variant":"jQuery"},{"key":"javascript","label":"JavaScript","variant":"XHR"},{"key":"c","label":"C","variant":"libcurl"},{"key":"nodejs","label":"NodeJs","variant":"Axios"},{"key":"nodejs","label":"NodeJs","variant":"Native"},{"key":"nodejs","label":"NodeJs","variant":"Request"},{"key":"nodejs","label":"NodeJs","variant":"Unirest"},{"key":"objective-c","label":"Objective-C","variant":"NSURLSession"},{"key":"ocaml","label":"OCaml","variant":"Cohttp"},{"key":"php","label":"PHP","variant":"cURL"},{"key":"php","label":"PHP","variant":"Guzzle"},{"key":"php","label":"PHP","variant":"HTTP_Request2"},{"key":"php","label":"PHP","variant":"pecl_http"},{"key":"powershell","label":"PowerShell","variant":"RestMethod"},{"key":"python","label":"Python","variant":"http.client"},{"key":"python","label":"Python","variant":"Requests"},{"key":"r","label":"R","variant":"httr"},{"key":"r","label":"R","variant":"RCurl"},{"key":"ruby","label":"Ruby","variant":"Net::HTTP"},{"key":"shell","label":"Shell","variant":"Httpie"},{"key":"shell","label":"Shell","variant":"wget"},{"key":"swift","label":"Swift","variant":"URLSession"}],"languageOptions":[{"label":"C# - HttpClient","value":"csharp - HttpClient - C#"},{"label":"C# - RestSharp","value":"csharp - RestSharp - C#"},{"label":"cURL - cURL","value":"curl - cURL - cURL"},{"label":"Dart - http","value":"dart - http - Dart"},{"label":"Go - Native","value":"go - Native - Go"},{"label":"HTTP - HTTP","value":"http - HTTP - HTTP"},{"label":"Java - OkHttp","value":"java - OkHttp - Java"},{"label":"Java - Unirest","value":"java - Unirest - Java"},{"label":"JavaScript - Fetch","value":"javascript - Fetch - JavaScript"},{"label":"JavaScript - jQuery","value":"javascript - jQuery - JavaScript"},{"label":"JavaScript - XHR","value":"javascript - XHR - JavaScript"},{"label":"C - libcurl","value":"c - libcurl - C"},{"label":"NodeJs - Axios","value":"nodejs - Axios - NodeJs"},{"label":"NodeJs - Native","value":"nodejs - Native - NodeJs"},{"label":"NodeJs - Request","value":"nodejs - Request - NodeJs"},{"label":"NodeJs - Unirest","value":"nodejs - Unirest - NodeJs"},{"label":"Objective-C - NSURLSession","value":"objective-c - NSURLSession - Objective-C"},{"label":"OCaml - Cohttp","value":"ocaml - Cohttp - OCaml"},{"label":"PHP - cURL","value":"php - cURL - PHP"},{"label":"PHP - Guzzle","value":"php - Guzzle - PHP"},{"label":"PHP - HTTP_Request2","value":"php - HTTP_Request2 - PHP"},{"label":"PHP - pecl_http","value":"php - pecl_http - PHP"},{"label":"PowerShell - RestMethod","value":"powershell - RestMethod - PowerShell"},{"label":"Python - http.client","value":"python - http.client - Python"},{"label":"Python - Requests","value":"python - Requests - Python"},{"label":"R - httr","value":"r - httr - R"},{"label":"R - RCurl","value":"r - RCurl - R"},{"label":"Ruby - Net::HTTP","value":"ruby - Net::HTTP - Ruby"},{"label":"Shell - Httpie","value":"shell - Httpie - Shell"},{"label":"Shell - wget","value":"shell - wget - Shell"},{"label":"Swift - URLSession","value":"swift - URLSession - Swift"}],"layoutOptions":[{"value":"classic-single-column","label":"Single Column"},{"value":"classic-double-column","label":"Double Column"}],"versionOptions":[],"environmentOptions":[{"value":"0","label":"No Environment"},{"label":"Dispatch DevNet ","value":"5216580-04dca0fe-4af3-4b85-b8e8-0ee5daaebbe0"}],"canonicalUrl":"https://documenter.gw.postman.com/view/metadata/RWaGT9dB"}