Earlier this year, Algorand was selected as one of the three platforms that participants could build their solutions on for Barclays’ DerivHack 2019 hackathon. A group of us travelled to New York last week to support the teams building on Algorand. One of those teams, “Digital Bull,” built their blockchain application using the Algorand platform. They successfully edged out many other teams to win the top prize of “Best Overall Solution” at DerivHack New York.

In this blog, I will share the goals and challenges of DerivHack, give some details on Digital Bull’s solution, and highlight the advantages that Algorand provides to developers in the financial industry.

Digital Bull used the Algorand blockchain to model separately owned but consistent financial databases with the following important properties:

Consistency: All institutions participating in a trade agree on the digital representation of that trade at any point in time. Privacy: The details of the trade are only revealed to the institutions which participate in it. Any other agent cannot learn anything about the trade. Lineage: Any modification in the state of a trade can refer to the previous state, generating a traceable lineage for the history of that trade. Validation: The system flags any inconsistent or missing data and corrects it when possible.

How the Financial System Works Today:

Consensus By Reconciliation

The financial system is, at its core, a consensus mechanism to determine who owns which assets and which transactions are valid. Across the world’s financial system there are daily discrepancies between financial institutions’ databases that must be reconciled by expensive armies of analysts, accountants and lawyers. The financial system’s consensus mechanism is, therefore, “consensus-by-reconciliation.” This form of consensus is error-prone, expensive, and slows down the pace of global commerce.

In order to make the financial system more efficient, and to improve on the expensive consensus-by-reconciliation process, Barclays has brought together financial institutions to participate in DerivHack. DerivHack is a hackathon that explores the use of decentralized ledgers and new consensus algorithms to streamline the post-trade process. The goal of the hackathon is to show how the ISDA Common Domain Model (CDM) for financial assets can be implemented across a variety of platforms.

This year, DerivHack challenged participants to design systems that automate several tasks that financial institutions have to complete after a securities trade is executed. Every team participating in the hackathon had to design a system, used by multiple parties simultaneously, that addressed seven different challenges

Trade execution: A broker buys securities from a counterparty broker on behalf of its client Allocation: The broker allocates the securities to the clients’ accounts Affirmation: The clients confirm the details of the executed transaction before it is settled Confirmation: The broker confirms it has received the clients’ affirmation before settling the trade Settlement: After the trade is confirmed, cash and securities are exchanged in a series of transactions between brokers and clients Portfolio Reports: The clients obtain a report of which trades have been executed, and which trades have settled Posting Collateral: Once the securities trades have settled, the clients can post the securities as collateral (in a segregated account) for an OTC Swap contract

Each of these use cases is complex, requiring keeping track of database views of multiple parties, creating new trade events from previous ones, validating that the data provided is correct and complete, and keeping track of the lineage of the events. Furthermore, the use cases are linked: the inputs to use case 2 are the outputs of use case 1, the inputs to use case 3 are the outputs of use case 2, and so on.

Illustrating how to solve the Affirmation Challenge with Algorand

Solving the DerivHack Challenges with Algorand

Digital Bull’s solution models each financial institution as having an independent database, holding JSON objects that represent details of each use case. For example, in the Portfolio Report Use Case, the JSON object has to correctly report how many of a client’s trades have been executed and how many have settled, and it has to follow ISDA’s CDM standards.

The workflow for each use case follows five steps. Each financial institution:

Creates a CDM input object from a given input JSON file Processes the CDM input object and creates a CDM output object (e.g. the CDM input object may be the execution of a trade, and the output object may be a report describing the settlement of the trade) Verifies that the produced CDM object is valid, according to ISDA CDM rules Commits a hash of the object (the global key) to the Algorand blockchain (using the notes field of an Algorand transaction), and verifies that all its counterparties have committed the same hash Stores the CDM output object, together with the Algorand Transaction ID that committed that object to the blockchain, into a datastore in JSON format, ready to be used as input for the next use case

In their system, financial institutions leverage the Algorand blockchain’s consensus algorithm to guarantee that — -regardless of which internal datastore each institution is using — — they have identical representations of CDM events. The institutions do not need to send the details of the events to the blockchain (which would leak confidential information). All they need to do to guarantee consistency is verify that all parties of the trade have posted the same pseudorandom hash corresponding to the object on the Algorand blockchain.

Algorand’s Key Advantages

Algorand enabled Digital Bull to win DerivHack 2019, thanks to three key properties of the platform.

Openness

ISDA and Regnosys provide a Java implementation of the Common Domain Model. Since Algorand is not tied to any one language, but rather allows developers to interact with the blockchain using SDKs (including SDKs for Python, Go, Java and Javascript), it was straightforward for teams building on Algorand to use the Java implementation of the CDM together with Algorand’s SDK to commit CDM objects to the blockchain.

Finality

Algorand provides instant transaction finality, with a latency of less than 5 seconds, and it never forks. Because Algorand never forks, parties in a trade can rest assured that once a counterparty commits a CDM object to the chain, that the commitment cannot be retracted.

Flexibility

One feature that stood out to the judges is that parties in a trade can add notes to any object committed to the blockchain. A financial institution could use these notes, for example, to link its committed hash of a CDM event to a database key that allows it to look up proprietary information about the trade in its own private databases. Because these keys are random strings, no proprietary information is revealed to counterparties.

Looking Forward: Layer 1 Features Coming to Algorand

The results from DerivHack 2019 show that Algorand’s current features can be used to guarantee that financial institutions have a consistent representation of trades on a public blockchain, while keeping the details of the trades private. However, transfers of assets that are not the Algo (the native token of the Algorand blockchain) must be performed off-chain.

Algorand Inc. is developing a new feature which will allow users to create their own standardized blockchain assets with customizable options and another new feature which will allow for secure transfers and immediate transaction settlement for atomic transfers.

In a sequel to this blog, I will illustrate how these new features can be used to solve the DerivHack challenges more efficiently, and how they can be applied to other important applications in finance. All of us at Algorand Inc. look forward to learning what Algorand’s users can build with these upcoming features.

About the author

Pablo Azar is Algorand’s Chief Economist, a role he took on after a decade at MIT, where he worked on cryptography and macroeconomics.

He is one of the co-inventors of rational interactive proofs, an extremely fast cryptographic proof that uses incentives instead of verification to guarantee correctness. He has written papers across disciplines, including work on using software engineering metrics to understand the complexity of US Financial regulations, leveraging social media to understand market reactions to monetary shocks, and developing models on the formation of supply chains and their effects on economic growth.

His work has been featured on Bloomberg, The Atlantic, and US News and World Report. He received a B.A. in Applied Mathematics from Harvard, a Ph.D. in Computer Science from MIT in 2014, and a Ph.D. in Economics from MIT in 2019.