Project Castor

capital market architecture blueprint in a decentralised world

by securities commission malaysia

THE PROBLEMS WE ARE EXPLORING

The capital market had adopted centralised models as a means of greater efficiency. However as markets continue to evolve together with new innovative products, as well as the increasingly varied demands of investors, we foresee the emergence of multi-tier markets, where there are markets catering to specific needs and niches. This is already happening as we observe how the unlisted and OTC markets have evolved compared to listed markets.

Within the capital market, listed products are issued and traded in formal, regulated venues whereas unlisted and OTC products are typically issued, bought, traded and settled bilaterally between parties. While these products can benefit from being highly tailored in nature, the lack of established market structure gives rise to a distinct set of challenges - some of which are listed below:

LIQUIDITY

Unlisted markets are less liquid and are dependent on intermediaries to connect buyers and sellers

TRANSPARENCY

A lack of transparency between parties results in an uneven market, which disadvantages smaller players

EFFICIENCY

With the emergence of blockchains and distributed ledger technologies (DLT), we wanted to test and research the feasibility of implementing this technology to serve as the underlying market infrastructure for unlisted and OTC markets and potentially help solve some of these challenges.

TEACHING THE TERMINOLOGY

A capital market is a financial market in which long-term debt or equity-backed securities are bought and sold. Capital markets channel the wealth of savers to those who can put it to long-term productive use, such as companies or governments making long-term investments.

The most prominent component of the capital market is the national stock exchange. For Malaysians, this is Bursa Malaysia. However if we cast our memories slightly further back in history, what we know today as a single centralised exchange are often the result of consolidation between multiple smaller markets. Investors were already trading securities with each other, where buyers found sellers via intermediaries such as brokers, or within small private pools before central exchanges came into place.

The capital market rapidly embraced centralisation as a means of greater efficiency – exchanges, clearing houses, custodian banks and trade repositories are prime examples of this phenomenon. Centralisation has brought about greater price discovery and liquidity, certainty of clearing and settlement, more orderly market operations as well as greater pre- and post-trade transparency. Adopting centralised models have delivered significant benefits.

Unlisted and over-the-counter (OTC) securities are securities traded in some context other than on a formal exchange and can be used to refer to stocks that trade via a dealer network as opposed to on a centralized exchange. It also refers to debt securities and other financial instruments, such as derivatives, which are traded through a dealer network.

As markets continue to evolve together with the new innovative products that they facilitate, as well as the increasingly varied demands of the investors that use them, we foresee the emergence of multi-tier markets, where markets are segmented and developed to cater to specific needs and niches. This is already happening as we observe how the unlisted and OTC markets have evolved compared to listed markets. In this case, a one-size-fits-all solution to market structures might not be the most appropriate.

CAN DLT HELP UNLISTED & OTC MARKETS?

it was clear that there could be structural improvements made to unlisted and OTC markets to increase their transparency and efficiency. However, we also wanted the distributed, bespoke nature of such markets to be preserved. This was the primary appeal for utilizing distributed ledger technology. A peer-to-peer network would still allow the market to retain many of its unique characteristics, avoiding the rigidity of a formal market venue, while at the same time allowing for open innovation in transparent, efficient and more cost-effective solutions for the future.

NEUTRALITY

Single system of record - where all market participants have a full copy of the market data that is relevant to them

USER FRIENDLY

INTEROPERABLE

Hierarchically governed contracts - utilizing open protocols and standards in an effort to promote interoperability

GOVERNANCE

Regulatory nodes - allowing the Securities Commission to have a full read-only view of all market activities

With this in mind, an initial scope and conceptual blueprint was crafted to explore the feasibility of such a market. The objective was to prove that such a market could operate on a distributed ledger network. Of the possible unlisted products, we chose equity crowdfunding due to the relative whitespace for this new product, which allows us to innovate and test potential solutions without being overly encumbered by legacy.

TEACHING THE TERMINOLOGY

For those unfamiliar with Equity Crowdfunding (ECF), it is an offering of shares in a private company to the general public in order to raise funds. The initial fundraising exercise, also known as an ECF campaign, would have a minimum and maximum limit of funding, which the issuer intends to raise in return for a certain share of equity.

There is an all or nothing approach to ECF where a campaign is only deemed successful, and funds disbursed if the campaign reaches its minimum target before the end of the campaign.

In traditional centralized systems, the notion of an account is usually represented by a username and password, which is often linked to an email address in order to facilitate account recovery should the user forget their password.

The majority of distributed computing systems replace this model with something known as cryptographic key-pairs. These keys can be mathematically generated on-demand without a third-party or any form of permission. The public key acts as a username and is shared with other participants, whereas the corresponding private key, like a password - must remain secret. Sharing or losing private keys can result in the total loss of control for that account - without any options for recovering access to that account.

In traditional web applications, code is served from a central server and even those that have developed that particular computer program are unable to verify that it is doing what it is supposed to be doing once it has been installed on a server that they do not have access to. Distributed ledger technology introduces a new term, referred to as smart contracts, which are essentially small snippets of code that are served from a distributed network - rather than from a central server or traditional database.

This allows for independent parties to verify the authenticity of logic, whilst also providing a guarantee that certain programmable actions will occur once specific triggering conditions have been met, regardless of whether those involved still exist - let alone agree. Smart contracts remove the need to trust the individuals that have made the agreement and instead shift that trust to the developer who programmed the contract.

DEMONSTRATING THE END RESULTS

This pilot project uses two open Ethereum Smart Contract Standards, namely ERC20 and ERC721 to represent tokens and assets instead of building our own proprietary standards. The most popular community within the Smart Contract space is the Ethereum community, who are pioneering standards being adopted within distributed applications. Most major crypto-currency wallets that accept Ether now support or are in the midst of implementing support for ERC20 tokens. The Hyperledger Project, which is one of the large enterprise blockchain initiatives have also announced support for ERC20 and ERC721 for their Fabric and Sawtooth protocols.

CASTOR WALLET

We provide a standalone HTML wallet that can be used to interact with the various smart contracts used by this project

CASTOR CONTRACTS

The project was developed in a way that websites become optional and users can interact with the contracts from any wallet

CASTOR NODES

We also provide fully functioning NodeJS server-side applications for the various stakeholders involved in this project

FULL SOURCE CODE EXAMPLES AND TECHNICAL DOCUMENTATION WILL BE MADE AVAILABLE SOON

REGISTER AN ACCOUNT TO BE KEPT IN THE LOOP

Since smart contract logic code cannot be changed once it has been deployed to a network and that standards are continually improving, and in-turn evolving, we must consider what this means. To future proof our systems, we had to consider means to implement upgradable smart contracts.

TEACHING THE TERMINOLOGY

One of the main benefits of smart contracts is that once they have been published to a public blockchain, they cannot be altered or removed. Although this is a powerful feature - once you discover an error in the contract or need to update your supply from one standard to another; making changes becomes a serious problem too. This is especially important in consideration of the fact that over 25% of all smart contracts currently contain unfixable critical errors.

Upgradable smart contracts represent an alternative approach to design where data and logic are split into different contracts rather than storing everything in the same place as traditional contracts do. In order to do this, additional layers of code abstraction are required, which is often achieved through what is known as a key-value store and proxy approach.

Crypto-Wallets are applications for managing the generation and storage of cryptographic keys. They provide an interface allowing users to generate accounts and interact with the applications that rely upon the signed transactions that these wallets facilitate. Transactions can represent data updates or the transference of digital tokens and assets to other entities

Since the pilot project ultimately relies upon universal token standards to facilitate equity crowdfunding investments and peer-to-peer secondary market trades, all stakeholders are able to use any wallet that supports ERC20 tokens and ERC721 assets as their preferred platform for generating and managing their cryptographic keys.

However, the Castor Wallet may also be used to generate keys and interact with the various smart contracts required to participate in this pilot project. It uses hierarchical deterministic keys, which are generated privately within the individual user device on-demand, as required. Only the public keys are stored within the device. The private keys are never saved or stored anywhere and only ever generated and used when authorizing transactions.

The DN-Key Protocol provides a way to utilize DNS TXT records to broadcast public keys - whilst also enabling a more robust method for generating trusted hierarchical deterministic keys between multiple stakeholders. Imagine a user with various wallet addresses for multiple currencies. Rather than needing to remember each of the individual addresses (or public keys) and which is used for which currency, a user can merely share their DN-Key.

This pilot project utilizes DN-Keys in the following unique ways:

Broadcasting multi-signature redeem scripts

Improving security in the creation of deterministic keys

Enabling the enforcement of pre-approved or multi-signature accounts

In order to pre-approve accounts whilst also providing account recovery, DN-Keys can also be incorporated into the key generation process - but doing so also enforces the use of specific crypto-wallets that adhere to these processes. However, please note that for the sake of more simplified demonstrations, not only have the DNS settings been simulated via configuration files, but the multi-signature account recovery options have also been disabled.

CONCLUDING CREDITS

This blueprint lays down what the SC considers as the foundational elements for when building a distributed market structure. While we have provided general guidance and expectations on how certain elements are to be approached and thought about, it should really serve as a jumping-off point for further, more in-depth discussions on specific implementation details.

NETWORK OWNERSHIP

Not only have we built the system in a modular way that is suitable for many different use cases, but it can also function within both public and private networks

ARCHITECTURE BLUEPRINT

This website is designed to briefly introduce the architecture blueprint, and so we strongly recommend that you also download and read the full PDF

DISINTERMEDIATION

The functionality of trustees and much of the operator responsibilities have been recreated with code, which can be seen on GitHub

To conclude, we wish to reiterate that for the capital markets, “decentralise everything” is not the final solution. Rather, we envision a multi-tier market environment in the future where centralised and decentralised markets co-exist. For the unlisted and OTC markets, we have demonstrated that DLT could be a suitable technology to support the market.

The SC would like to thank the Neuroware.io team as our technology partner for this project and for their support during the early ideation through to the final implementation, as well as their willingness to challenge and push the boundaries of what was possible.