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:

August 2023 update

August 2023 update

August has been a busy month of success! Let’s dive into this month’s Partisia Blockchain update, exploring various industries to showcase the flexibility and transformative potential of blockchain and multiparty computation (MPC). From revolutionizing government processes with transparency and security to redefining data-sharing in marketing and advertising, while prioritizing privacy, our solutions continue to drive innovation.

The healthcare sector witnesses privacy-preserved collaboration and supply chain efficiency, while logistics embraces streamlined supply chain management through blockchain and MPC integration. In the community sphere, we have explored Self-Sovereign Identity’s (SSI) elevated privacy with MPC and tackled GDPR compliance through anonymization. The spotlight on Privacy Enhancing Technologies (PETs) broadened our understanding of blockchain possibilities. We hosted an insightful MPC Advantages Q&A session, and our dynamic community engaged in a Web3 marketing discussion — Hivemind Huddles.

Technical advancements include operational smart contracts for DID and verifiable credentials, BYOC framework deployment, and browser updates. As we power ahead, we eagerly anticipate unveiling the BYOC framework in more detail and introducing even more streamlined management features. Stay updated with another month of innovation and progress!

Industry transformation enabled by Partisia Blockchain’s solutions

In this month’s recap, we have explored our Industry Spotlight and how Partisia Blockchain’s solutions benefit diverse sectors, including Government, Marketing and Advertising, Healthcare and Logistics. Our journey through these industries showcases the versatile applications of blockchain and Multiparty Computation (MPC), each tailored to address specific challenges while upholding privacy, security and efficiency.

Within the domain of government, Partisia Blockchain envisions transformative solutions that embrace the principles of transparency, security and efficiency. By harnessing the power of blockchain and multiparty computation (MPC), bureaucratic processes can be streamlined while maintaining the confidentiality of sensitive information. Initiatives, such as DelNorte and E-Trusty, exemplify how blockchain can enhance trust in public institutions, create transparency in public tenders, and uphold privacy in CBDCs and blockchain-based voting systems.

In the dynamic landscape of marketing and advertising, Partisia Blockchain revolutionizes data-sharing models. With our privacy-first approach and secure MPC technology, users gain ownership and control over their data. The combination of blockchain and MPC empowers data analytics companies to compute on encrypted data without compromising its privacy, rewarding users for data contribution, ensuring real-time data access, and maintaining transparency. Partisia Blockchain bridges the gap between consumer privacy concerns and data-driven marketing strategies.

In the domain of healthcare, Partisia Blockchain leads the charge in preserving privacy while fostering collaboration and innovation. Our MPC technology introduces secure data analysis without exposing raw information. In the realm of DNA sequencing, Partisia Blockchain ensures the security of genetic data. In clinical research, MPC empowers cross-institutional studies while safeguarding patient privacy. Supply chain management witnesses a transformation, enabling stakeholders to manage complex supply networks without revealing proprietary information. In clinical trial recruitment, MPC facilitates efficient participant matching while upholding data security and privacy. Partisia Blockchain redefines healthcare through the lens of privacy, security, and collaboration.

Lastly, we explored the impact of our solution on the logistics industry, envisioning a streamlined future where blockchain and multiparty computation (MPC) converge to enhance supply chain management. By integrating QR codes with tokenized product representations, we facilitated instant information access and reduced confusion. Blockchain’s transparent touchpoints improved logistics and supply chain transparency, while smart contracts automated processes and adapted to evolving documentation requirements. In the realm of quality assurance, we harnessed MPC and blockchain to digitize supply chains, ensuring privacy preservation and selective data access. Our solutions streamline documentation, upheld compliance with GxP regulations, and heighten efficiency throughout the supply chain, ultimately paving the way for a resilient and transparent industry transformation.

Collaborative community conversations and exploring privacy enhancing technologies

In this month’s community update, we highlighted the transformative impact of Self-Sovereign Identity (SSI) and Digital ID solutions within today’s dynamic data landscape. Partisia Blockchain’s MPC technology introduces an innovative dimension to SSI, elevating privacy levels and unveiling novel business models. Crucial to the foundation of digital identity, Decentralized Identifiers (DIDs) and verifiable credentials empowered users with data control capabilities. Expanding the horizons of SSI, multiparty computation (MPC) enabled confidential data analytics and versatile multi-functional applications.

Additionally, Partisia Blockchain discovered its vital role in facilitating GDPR compliance through the strategic application of multiparty computation (MPC) technology. The utilization of MPC ensured the anonymization of personal data, allowing for uninterrupted data collection while maintaining privacy. This decentralized MPC approach elevates data security and control, in alignment with the access and erasure rights mandated by GDPR. Additionally, our groundbreaking jurisdiction management v1.0 provides an innovative solution for geographically aligned data processing, effectively safeguarding data rights and privacy. As the significance of data privacy continues to grow, Partisia Blockchain remains at the forefront, pioneering technological solutions that enhance privacy, security, and adherence to regulatory standards.

Continuing our exploration of innovative developments, this month, we delved into Privacy Enhancing Technologies (PETs) and their impact on the blockchain landscape. At the core of any blockchain lies the concept of consensus without reliance on a central authority. Programmable blockchains have opened the door to a realm of possibilities, with applications categorized into three types: public input-public output, private input-public output, and private input-private output.

To provide a better understanding of the topic, we held a special MPC Advantages Q&A session, featuring Partisia Blockchain’s Principal Architect Emil Orloff, Cryptographic Scientist Anders Dalskov, and Head of Developer Relations Bruce Ahn. This insightful session delved into what MPC is, and how we differ from other privacy and MPC-based blockchains. To learn more about this topic and where Partisia Blockchain fits in, check out our blog post and comparison chart here.

On 10 August 2023, our vibrant community came together once again for an engaging Hivemind Huddle. This interactive session delved into the realm of Web3 marketing, exploring both the broader landscape and Partisia Blockchain’s unique strategies. Our conversation spanned across past successes like PR efforts, conferences, and media coverage, while also delving into intriguing future prospects (without divulging specifics). It was a great conversation where the community contributed with great ideas, some of which will be directly implemented through the Ambassador Program.

DelNorte, the latest project integrated into the Partisia Blockchain ecosystem, achieved a significant milestone in the past week. It successfully completed the initial transactions for its inaugural real estate deed pilot project, in collaboration with the El Salvadoran government. Additionally, DelNorte has three more pilot projects in the pipeline, each partnering with different governments. This achievement marks a crucial step forward, with El Salvador’s participation serving as the pioneering proof of concept for these initiatives.

Veric has achieved significant advancements, successfully implementing fully operational smart contracts for DID and verifiable credentials on the testnet. The team is currently enhancing privacy features and making necessary preparations for the upcoming mainnet launch, including the facilitation of user onboarding processes.

Progress is being made to our next BYOC asset, Cardano’s ADA token. Currently work is ongoing and we hope to introduce ADA as a BYOC asset in the future.

We increased the number of leads for partnership in the month of August. We are busy working through them and akin to the two we mentioned above, we hope to continue this trend and be able to show the continued interest on our chain.

Upcoming rewards

We deployed the code to support one of our flagship roadmap items, the BYOC framework. Soon we will introduce this feature in more detail with instructions on how you can submit a token to be a bridgeable asset in Partisia Blockchain.

We have also been busy with updates to our browser to include transaction details, indexing and the ability to deploy contracts. Work is not done however and we will continue to push updates to both migrate functionality currently in the dashboard as well as other key features and functions to ease management of your tokens.

Stay updated:

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

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: build@partisiablockchain.com

Stay updated:

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