Scalable DeFi

Scalable decentralized finance

Abstract: This blog presents a fully documented framework for DeFi solutions, such as “Automated Market Makers” (AMMs), on a highly scalable blockchain like the Partisia Blockchain. The framework guarantees fixed prices across independent liquidity pools and effectively addresses front-running with MPC.

Financial inclusion is at the heart of the original narrative that formed the beginning of blockchain and later Decentralized Finance (DeFi). The global financial crisis in and around 2008 revealed several weaknesses in traditional financial systems. The global financial crisis was part of the motivation behind the Bitcoin protocol creation. Although the challenges behind the global financial crisis were more significant than what immutable money could fix, it initiated and accelerated innovations that improved traditional finance and pushed to new horizons.

The very same crisis inspired the origin of Partisia. However, innovation was a different type of decentralized cryptography that was also designed to remove intermediates, which manage private information, such as sealed bids in financial markets. The initial work by Partisia was the world’s first Decentralized Exchange (DEX) with sealed bidding which went into commercial use in 2008.

The Partisia Blockchain established in 2020, is a combination and extension of these two narratives and provides a powerful encrypted computation network and tool set to continue fixing weaknesses in both Decentralized Finance (DeFi) and Centralized Finance (CeFi), as exemplified by the solution described in this blog.

DeFi and scalable blockchains

DeFi is an important part of Web 3.0 and provides solutions that may most likely drive and enhance financial inclusion. This blog focuses on so-called Automated Market Makers (AMM) as a simple and decentralized way to exchange crypto assets. The core innovation behind AMMs is to conduct trading without direct interaction and matching of buyers or sellers of crypto assets. This significantly reduces the complexity of the market solution. Since the entire AMM solution is a set of smart contracts, the security model was also significantly improved as a genuinely decentralized trading platform.

Ethereum has been the most used blockchain platform for AMM solutions. And token bridges–as well as second layer blockchains–have broadened the uptake to other blockchain networks. Recent developments take this development one step further and run AMMs across independent blockchain platforms, i.e. cross-chain DeFi. This poses a set of new obstacles, such as the challenge of representing states (data and tokens) across independent blockchain platforms.

Mechanism to guarantee fixed prices

Another challenge preventing a simple copy-paste of the Ethereum model to sharded or cross-chain blockchains is the economics instilled into the Ethereum execution model. This is primarily the arbitrage opportunity coming from the “all or nothing” execution (atomic execution), as well as the sequential use of the entire AMM solution (one user at a time). With Uniswap (one of the most applied AMMs) for example, a user can swap asset A to asset B, and then swap asset B to asset C, and then potentially swap asset C back to asset A without other users interfering. Sometimes this set of swaps returns profit to the user. This type of arbitrage essentially for free since the public ledger allows anyone to constantly monitor the AMM solution. This is, however, only feasible due to the atomic execution and sequential use of the AMM solution, and cannot be transferred to a sharded blockchain or to cross-chain AMM solutions without additional economic mechanisms.

The Partisia Blockchain team has jointly worked with researchers specializing in AMMs and economic mechanism design. And together developed a mechanism which guarantees fixed prices as well as the “multi-swap” arbitrage opportunities described above. The key component is a “lock-swap” mechanism that guarantees a user fixed prices for a given swap. The mechanism only locks the actual requested trade and allows other users to use all liquidity pools without the non-scalable sequential use of the entire AMM solution as we know it from Ethereum.

The mechanism essentially works as follows: every pool keeps track of two pools, the “actual liquidity pool”, and a “virtual liquidity pool”. The actual liquidity pool keeps track of all the instant swaps, i.e. those that are actually executed. The virtual pool keeps track of the lock swaps, since such swaps might be canceled later on. Hence, by submitting a lock-swap the user secures fixed prices by the lock-swap function, which only affects the virtual liquidity pool. For any user after the lock-swap, the protocol ensures the smallest amount of assets across the actual liquidity pool and the virtual liquidity pool. Hereby, the mechanism favors first movers that fixed prices using the lock-swap function. Unlike the Ethereum sequential use, the lock-swap minimizes the impact on the entire AMM solution so assets can be exchanged in parallel and across independent blockchains and shards. And also in liquidity pools with one or more lock-swaps. Read more about the mechanism here.

In other words, the mechanism ensures the liquidity managed by the AMM solution is put to maximal use in two ways:

  • First movers that discover and, hence, secure fixed prices (lock-swap) have a minimal impact on other users’ ability to use the AMM solution.
  • The mechanism allows for completely independent execution across shards and blockchains to support unlimited scalability.

The mechanism is designed to fully utilize sharding where transactions are automatically off-loaded across different shards in an ideal way that favors unlimited parallelization, i.e. asynchronous and concurrent execution. This type of sharding is native to the Partisia Blockchain and will be instrumental in ensuring unlimited parallelization needed to match the demand as decentralization flourish. Read more about the sharding model here.

Finally, note that since cross-chain AMMs are similar in nature, the proposed mechanism also supports use of liquidity pools operated on completely separated blockchains.

Remove front-running opportunities

Another challenge and obstacle for a broad uptake of AMM solutions within and beyond the blockchain ecosystem is front-running. On Ethereum and similar blockchain platforms, the AMM transactions are transparent to all, but added to the blockchain consensus model by one or more actors, such as “mempool operators” or “block producers”. The problem is that these actors can delay and place their own AMM valuable transaction, i.e. front-running.

Front-running is a critical problem that needs to be solved for the sake of the users, but also a problem that is critical for the DeFi narrative as a “single point of trust” failure. Fortunately, the advanced encrypted computation that is built-in to Partisia Blockchain provides a decentralized solution, which points back to the original work by Partisia and the first commercial use of MultiParty Computation (MPC) for safeguarding sealed bids.

However, as a big contrast to the first commercial use of MPC, Partisia Blockchain provides a simple interface that allows any developers (without cryptographic skills) to script the required computation and leave it to the network to compile and run the encrypted computations. The concrete solution is an encrypted computation which keeps the actual swap secret until it is fully executed. Hereby, the arbitrage opportunity from frontrunning is effectively addressed.

Regulation and traditional finance

Ensuring that DeFi solutions comply with the jurisdictional regulation is, of course, an obligation for any DeFi service provider. It may also soon be a competitive advantage and a requirement for expanding the use of DeFi solutions outside of blockchain.

While financial fraud regulations, such as KYC and AML, are obvious, matters that are addressed in this blog may become essential regulatory requirements as well:

  • First, front-running needs to be effectively addressed, and for the sake of the blockchain narrative, in a decentralized fashion, such as the privacy-preserving swapping on Partisia Blockchain.
  • Second, the built-in “free” arbitrage opportunities may not be acceptable for financial regulators. The proposed lock-swap is a simple add-on feature that can be switched off unlike the AMMs on Ethereum where free arbitrage is cooked into the very foundation of the blockchain platform.
  • Third, privacy-preserving computation may involve data that need to operate on nodes running in designated jurisdiction, which is a built-in functionality on the Partisia Blockchain.

Although future regulatory requirements are unknown, building a blockchain network that is sufficiently flexible to quickly adjust to regulatory requirements may be crucial. For DeFi service providers that aim at offering DeFi solutions outside of the blockchain ecosystem and in direct competition with traditional financial solutions, regulatory requirements will be instrumental.

Get started and resources

For DeFi teams considering to build the next generation of scalable DeFi solutions on Partisia Blockchain, please find links to the scientific work, description, and template smart contracts below:

From logistics to quality assurance: How blockchain and MPC can improve supply chain management

From logistics to quality assurance: How blockchain and MPC can improve supply chain management

When planning a supply chain from a logistics perspective, it is often useful to conduct a little thought experiment and think of yourself in the position of the products involved. In order to do this, you should “be the box” and trace each step you take from the factory to your customer, how much time you need to arrive and all of the steps you need to go through to get there. Let’s say you are a product, a piece of machinery made in a factory in Pennsylvania, United States. Post-production, you need to be packaged a certain way and the relevant paperwork prepared for export and import to the client’s destination, e.g., Germany. For this purpose, export and import documentation need to be prepared, product specification sheets, customs declaration forms, etc. Before “leaving” the factory you need to be packaged and the documentation needs to be prepared and added to the packaging. You are then picked up by a courier, who potentially needs a copy of certain documentation, and brought to a storage/sorting facility. You need to be marked clearly beforehand or afterwards in order to insure you are not confused with another piece of machinery. Then when ordered by a client, you may need to be re-packaged, for which the necessary documentation needs to be available to the courier before being shipped out. You are then picked up by a logistics company, either the same as the one the courier was from, or another one, and transported to where you will be exported. This is one of two places where all of the paperwork has to be in order, as customs officials now could inspect the paperwork and potentially block or delay your export. Customs declaration forms, material safety data sheets, shipment listings, the invoice to the client, etc., all need to be available and correct.

Congratulations, you have passed customs and are now in “international customs limbo”. After being “exported” you are usually transferred to a toll-free storage area and are then sorted into a container or loaded onto an airplane. When you do land, let’s say in Germany, the customs officials will want the same, or even different paperwork — perhaps even the same paperwork but in a slightly different format (I cannot emphasize enough how sensitive managing customs can be). VAT and other import taxes are (or are not) charged based on the required product declaration, which can sometimes differ greatly between countries, and the purpose of use. The product (you) is then released to a logistics company that sends you to your customer’s address. Hurray, you have arrived at your destination!

What this thought experiment shows us, is that during every single one of these steps, there are multiple touchpoints with many different people involved. Each one of these touchpoints represents a moment where a variety of things could go wrong. What if one of the documents falls off the package? What if one of the logistics employees accidentally confuses one of the packages during re-packing at the storage facility, or confuses the documentation? While logistics companies tend to have contingencies and redundancies, things sometimes go wrong causing unnecessary delays in supply chains and, in some cases, lost business.

Blockchain logistics: seamless traceability and document access

Blockchain could be used to mitigate such logistics risks: a QR code representing a tokenization of a product could be added to each individual product package, in order to provide information on each individual product instantly and reduce the potential for confusion. Paperwork could be added to these product’s QR codes making them easily accessible to different parties along the supply chain and could also help in compiling different documents. If used correctly, a blockchain could also help keep track of shipments, both internally for logistics companies and externally for those managing supply chains. Sometimes shipments can be a bit like a black box and yes, sometimes products even get “lost”.

Furthermore, not only could documentation be made more accessible, but smart contracts could be created to streamline processes and e.g., create country-specific documentation automatically depending on where the product’s QR code is scanned. This could particularly come in handy if a product’s route is changed short notice, the product is checked by another country’s customs (e.g., another EU port of entry that wants things just ever so slightly differently) or the documentation required is changed at some point. The transparency provided by the blockchain could also make different actors such as customs authorities and/or logistics companies more accountable and provide a better basis for auditing/compliance. Furthermore, payment processes e.g., for VAT and other taxes, could potentially be automated, greatly increasing the speed of the customs clearing process.

GxP regulations: the pharma-level supply chain

The complexity of a supply chain increases with the added burden of quality assurance requirements, laid out by e.g., pharmaceutical GxP (Good practice, the “x” standing for a variety of different areas) regulations. Medical and pharmaceutical, food and cosmetic products require differing levels of traceability and quality assurance from the initial ingredients all the way to the patient. Each step in the production, testing, manufacturing, and distribution needs to be carefully and extensively documented and regarding logistics, the regulation laid out for e.g., pharmaceuticals is that of “Good Distribution Practice” (GDP). If you take the example of an agriculturally derived ingredient for a medicine, the process would be as follows:

A plant is harvested following (and documenting everything) according to Good Agricultural Practice (GAP) or Good Agricultural and Collection Practice (GACP) and then processed (e.g., the relevant ingredients extracted) according to Good Manufacturing Practice (GMP) and tested to Good Laboratory Practice (GLP). The product is then sent, of course following Good Distribution Practice (GDP), to the production facility, where it is further processed and combined with other ingredients to make a final product (under GMP) and then distributed to a pharmacy (again under GDP). Every individual production, testing and transportation step of each individual ingredient is meticulously documented and requires the ability to be audited by different parties as well as government entities. The idea being, that GxPs can assure two things for quality assurance quickly: 1) the assurance of quality of medical products on the market and 2) the ability to trace exactly where something went wrong in a pharmaceutical supply chain if there is some sort of defect. This all undoubtedly brings with it an immense amount of documentation, often in paper format, that needs to be stored for years by each individual party. Not exactly the most efficient way to store or audit a supply chain.

The MPC-blockchain supply chain: digitalized traceability, trade secret privacy

Both regarding the GxP traceability and less-regulated supply chains, blockchain technology could be used to reduce errors, streamline processes, facilitate documentation availability, and allow for better traceability and auditability for all parties involved. However, companies have legitimate reasons not to want to reveal certain information about their supply chains. A pharmaceutical company for example may not want to reveal the source of their ingredients, as a competitor may use that information to their advantage. This is where MPC could come in and be used to obfuscate certain sensitive information about the supply chain. Moreover, necessary documentation could only be made available to certain parties, such as customs authorities.

An MPC-blockchain solution built on Partisia Blockchain for logistics and quality assurance could look as follows: each step set out by GxP could be documented and listed on the blockchain, while only making the source of each documentation available to the parties necessary (e.g., a regulatory body of a manufacturing company). Each package shipped could be traced transparently by the customer, with a smart contract automatically generating documentation for each individual step in the supply chain and customs touchpoint. All of this can be done without revealing too much information to parties that do not need to have the full picture. Such a system could reduce errors, increase efficiency, allow for better auditability and more transparency of supply chains — while MPC keeps valuable trade secrets private.

Partisia Blockchain is dedicated to facilitating innovative solutions to real-life problems. Better supply chain and quality assurance are two of these problems.

Please contact us, if you have any questions about how our technology could improve your supply chain management or quality assurance.

Contact information:

Stay updated:

Website • Twitter • Discord • Telegram • LinkedIn • Facebook • Instagram • GitLab • Medium • YouTube

MPC for healthcare and pharmaceutical industries

MPC for healthcare and pharmaceutical industries

In today’s context, the healthcare sector by itself contributes to around 30% of the global data volume, while the pharmaceutical industry significantly adds to this data generation. Handling and utilizing data from these sectors are also subject to some of the strictest regulations due to the nature of data that often includes personally identifiable information. GDPR, internal policies, and other regulatory frameworks pose tough challenges when data is collected or shared beyond isolated data silos for analytical purposes.

Public and private blockchains serve as effective tools for maintaining an immutable and transparent log of transactions, which can be relied upon and examined by various stakeholders such as public authorities. However, when it comes to the actual manipulation and processing data, both public permissionless blockchains and private blockchains are insufficient due to the lack of privacy features. This is where Partisia Blockchains’ distinctive and proprietary secure multiparty computation (MPC) technology emerges as exceptionally valuable

Our MPC technology empowers individuals and organizations to preserve privacy right from the input stage. This entails breaking down data into many encrypted secrets, which are then shared with specialized MPC network nodes. Critically, these nodes remain unaware of the specific content they store or compute on. Predetermined private and public smart contracts establish protocols for computations and determine access privileges to the outcomes, as authorized by permissions.

The potential applications for private computations within the healthcare and pharmaceutical sectors are virtually limitless. In this article, we will explore some of the extensively discussed scenarios.

Confidential DNA sequencing

Privacy technologies play a pivotal role in enhancing the security and confidentiality of private DNA sequencing. With the advancements of genetic analysis techniques, individuals are increasingly seeking to unlock insights from their genomic data, but the sensitive nature of genetic information demands robust measures to preserve privacy. MPC offers solutions by enabling private computations on encrypted genetic data without the need to expose the raw data. This allows for collaborative research, personalized medical insights, and genetic advancements while ensuring that individuals retain control over their sensitive genetic details.

By employing these technologies, private DNA sequencing initiatives can preserve privacy, encourage data sharing for scientific progress, and mitigate the risks associated with unauthorized access or breaches of genetic information.

Clinical research

Traditional data sharing approaches often raise concerns about privacy breaches and data ownership when it comes to the almost abundant amount of sensitive patient information and proprietary research data for healthcare and pharmaceuticals. MPC addresses these challenges by allowing multiple parties to jointly analyze and derive insights from their respective datasets without actually revealing the raw data to each other, but only share valuable outputs.

In the context of clinical research, pharmaceutical companies and healthcare institutions can collaboratively conduct analyses on aggregated datasets while keeping individual patient information and proprietary data secret. This facilitates cross-institutional research without the need to centrally consolidate data, eliminating the risks of data exposure and unauthorized access. Different pharmaceutical companies, each possessing valuable proprietary data, can engage in joint studies without revealing their confidential insights.

This collaborative approach unlocks opportunities for discovering broader trends, identifying potential drug interactions, and conducting large-scale analyses that draw from diverse datasets. By preserving privacy and ownership, MPC encourages cooperation among entities that might have otherwise hesitated due to privacy concerns. In essence, MPC bridges the gap between robust data-driven insights and the need for privacy, fostering a new era of collaborative clinical research across previously isolated data silos and organizations.

Supply chain management

MPC offers robust primitives to revolutionize supply chain management within the pharmaceutical and healthcare industries. In these sectors, ensuring the integrity, transparency, and security of the supply chain is of all importance, as any inefficiencies or vulnerabilities can have serious consequences for patient safety and product quality.

MPC provides a solution by enabling various stakeholders, including manufacturers, distributors, regulatory bodies, and even healthcare providers, to collaboratively manage the supply chain without revealing sensitive proprietary information to one another. This is particularly valuable when dealing with complex global supply networks involving multiple parties, each with their own data and interests. Parties can jointly verify and validate critical supply chain information, such as the authenticity of raw materials, production processes, transportation routes, and inventory levels.

For example, pharmaceutical companies can verify the authenticity and quality of raw materials supplied by third-party vendors without sharing their precise formulation details. Regulatory agencies can conduct audits and ensure compliance across the supply chain while preserving the confidentiality of manufacturing processes. Healthcare providers can track the provenance of medical devices or drugs to enhance patient safety and prevent counterfeiting.

MPC-driven supply chain management ensures trust among stakeholders by providing a secure environment for collaboration. It prevents fraud, minimizes the risk of data breaches, and streamlines information sharing. By harnessing the power of MPC, the pharmaceutical and healthcare industries can establish a more efficient, transparent, and secure supply chain ecosystem that ultimately benefits patients, regulatory compliance, and business operations alike.

Recruitment for clinical trials

MPC presents a transformative way for streamlining the recruitment process in clinical trials while upholding patient privacy and data security. Clinical trial recruitment often entails the sharing of sensitive patient information across multiple stakeholders, including healthcare providers, research institutions, and pharmaceutical companies. MPC offers an innovative approach by allowing these entities to collaboratively identify eligible participants without revealing individual patient details.

Using MPC, each participant contributes encrypted data, maintaining the confidentiality of their personal information. The parties can collectively perform computations on this encrypted data to match potential participants with specific trial criteria, such as medical history, demographic characteristics, or genetic markers. This process ensures that no party gains access to the raw data of others, mitigating privacy concerns.

MPC technology not only accelerates the participant matching process but also encourages broader collaboration among stakeholders who might otherwise hesitate to share sensitive patient data. This approach streamlines the recruitment process, reduces administrative burden, and respects patients’ privacy rights. Ultimately, MPC revolutionizes clinical trial recruitment by combining efficiency and data security, fostering trust among stakeholders and contributing to the advancement of medical research.

Stay updated:

Website • Twitter • Discord • Telegram • LinkedIn • Facebook • Instagram • GitLab • Medium • YouTube