Nexo

Start Earning Up to 16% Interest Automatically

Learn More

Dispatch Labs Code Review: DAPoS Consensus

Dispatch Labs Code Review dApp Artifacts and DAPoS Consensus

Share this article

In our Dispatch Labs code review we’re looking over their shared ledger network for programmable information.

Big claims… “Enables businesses and developers to make dApps never before possible in a single framework, with a consensus method and architecture viable for real-world massive adoption”.

Running through the whitepaper, it seems that they are just creating a file storage mechanism coupled with some fancy “new” DAPos consensus algorithm.

Some basic use-cases for this are: Artists selling their music through the Dispatch network could keep up to 100% of their sale. Medical record management. Content Delivery Network. Cool cool. Pretty much things that exist and are working the centralized world.

DAPos seems to be DPOS with the added benefit of being asynchronous. That is quite a novel idea!

The flow of a Dispatch Dapp starts with uploader publishing an artifact to the network. To do so, the uploader creates a smart contract containing a hash of the artifact and rules for accessing it (1). Sweet, so now Taylor Swift is going to hack out a smart contract to publish her latest album. Haters gonna hate!

That’s enough whitepaper for now, lets dive into the code.

15 Repositories, 9 contributes. There should be a lot to go through here.

Starting from the bottom of the repo, we have dapos_poc.

It’s a basic node+block+transaction setup that validates balances when a node receives a transaction. Nothing that fancy going on in here. The code is well documented. When you see code where basically every line of code has a comment you can generally assume that the code was well thought out.

TechnicalDocs just contains a version controlled technical document for their DAPoS consensus.

dvm_poc another POC repository. Build on the Ethereum VM and babbleio’s hashgraph.
Most of the early repositories are them just proving some ideas while they figure things out. Still, the POCs are well documented with detailed README’s documenting deployment and testing instructions and in-line comments.

disgo-mask. I don’t like the change in naming standards of their repositories. Some are CamelCase, some are underscore_separated and some are hyphen-separated. Anyway, this is supposedly a Meta-Mask like interface for Dispatch.

But there is nothing really going on in here. Using JQuery, bleh. Let’s go back to the 2000s.

commons. Commonly imported libraries for their repos. Functionality like their cryptography functions, loggers, etc. Also some functionality to handle types like transactions and blocks and the like (creation, retrieval, verification, json marshaling etc). In the services directory we find DB service which uses badger DB which is a standard key-value store. We also find a http and grpc service, but they don’t look like they do much.

dapos contains the service and API calls for their DAPoS consensus algorithm. Again they have extremely well documented Wiki article with everything required to get started. I like that they separated this into its own repo. It provides them with some flexibility in terms of upgrading/modifying the algorithm without changing the core. The consensus is just a service. It doesn’t do much though. Delegation is a config variable? Transaction verification only does balance checks and signature verification.

dvm looks like just a fork of Ethereum’s VM code.

disgover is a distributed node discovery engine. It follows the same structure as the dapos repo. It is just providing node discovery as a service. The current implementation uses Kademlia distributed hash table for node discovery, similar to services like Storj or IPFS. With the micro services architecture they are using, it means that there is not much happens in each of these repos. But the code in here is neat. It only does what it needs to.

samples looks like a research/play area for dispatch. Loads of different folders with solutions for VMs, Docker instances, sample blockchains, kdht etc.

scandis A little angular front end. Nothing particularly interesting happening in here. So moving on!

mobile-wallet Same basic idea as the front end above. Moving on.

java-sdk Java based SKD to interface with the Dispatch network. Not much happening here.

disnode_sdk NodeJS based SKD to interface with the Dispatch network. Not much happening here, this repo was just started.

Onto the main boy. Disgo is the main client / node for the Dispatch platform. Disgo intializes all the services we have mentioned in the above repositories.

The modular approach to tackling all the services is really hot, but they ended up adding it all into their disgo repository anyway (commons, dapos, disgover, dvm).

Bootstrap is the part that initializes all the services and curls is just a bunch of easy to run commands using the node. The rest we have reviewed earlier. That’s the repo.
Wait, it seems that development continued on the dvm/dapos sections.
The dvm now has a an API/service to interact with the smart contracts on the EVM. Deploying smart contracts and executing functions. Same decoupled structure for the services as the others.
The dapos has now implemented their gossip protocol as well as executing transactions on the DVM to verify results.

There are finally some unit tests written for the types in the common folder. A quick click through shows that a bunch of the unit tests are skipped, but it’s a start. Writing unit tests after writing all the code is rarely a fun job. But in time, I’m sure the tests will catch up. Overall ,the code quality is good. Really well documented, but extremely light on unit tests.


Dispatch Network — Code Review Conclusion

I like the modular approach to all the components in the eco-system. It affords Dispatch the ability upgrade their system without massive rework. Being able to plug in something like a more optimal P2P layer later if a better solution comes along provides them with good flexibility.

That said, there wasn’t much interesting in the project. they have the building blocks of a blockchain. A P2P layer, a VM, a consensus mechanism and Blocks/Transactions/Accounts.

Where was “The Dispatch network advances blockchain to its next generation, enhancing its capabilities by introducing the novel concept of off-chain Artifacts.”?

I don’t find anything new that Dispatch are bringing to the table. Their roadmap has a big focus on DApp support and developer training and the SDKs are a nice addition. But with their mainnet launch in Q3, it’s going to be interesting to see if they can bring in something new and exciting to their solution.


You can chat about Dispatch Labs in our Telegram group.

Disclaimer: Crypto Briefing code reviews are performed by auditing what is on display in the master branch of the repo’s made available. This was performed as an educational review and any comments in the article are the opinion of the writer. It is normal for code to change rapidly, hence we timestamp our code reviews so that they present a snapshot at a moment in time. Information contained herein should not be used as any comment or advice on the project as a whole.

Dispatch Labs Code Review Timestamp: July 29th 2018

Share this article

Loading...