Introducing DIA’s Decentralized Bridge Balance Attestation Oracle for the Polkadot Ecosystem
DIA has developed an oracle that introduces on-chain verification of bridge balances across multiple chains to enable safer and more transparent usage of bridges in the Polkadot ecosystem.
Web3 Bridges and Security: An Ongoing Challenge
Bridges are essential components in the cross-chain web3 ecosystem, allowing assets to be transferred between different networks. However, their security has been a significant concern. The fact that four out of the top five hacks in terms of USD value lost were attacks on bridges, totaling $2.2 billion lost, is a testament to this.
DIA is addressing this issue by developing a solution that will enable transparency and security infrastructure for dApps and protocols using bridges as well as bridges themselves running on Polkadot parachains. The tech stack will be made available as a non-proprietary, common good for the Polkadot and wider Web3 builder community.
Introducing the DIA Bridge Attestation Oracle
DIA’s ‘Bridge Attestation Oracle’ enables the on-chain verification of bridge balances across multiple chains to provide ”Proof-of-Collateral” data feeds. With the oracle’s information, dApps on Polkadot parachains will be able to power security modules to, for instance, trigger automated precautionary notifications and actions when a bridge’s balance drops unexpectedly.
The project involves the development of several core components, including an off-chain worker to read bridge states, a token identification system to match tokens across multiple chains, and a standard format for integrating future bridges. The technology stack comprises Polkadot’s native features — it is written in Rust programming language and leverages pallets and off-chain workers.
How it works
The solution consists of 3 key components:
1. Off-chain worker
The Off-chain worker is a Polkadot native feature that allows validators to aggregate and compute data off-chain in a trustless way, and submit the end result on-chain for protocols to consume. DIA leverages the off-chain worker’s functionality to retrieve bridge token balances and issuance. This will help to evaluate the collateralization ratio of each token.
2. Community-driven bridge integrations
The second key component of the solution is an open-source library for bridge integrations. As numerous bridges exist in Web3, each with distinct architectures, tracking the token balances of each bridge becomes a complicated task. Therefore, DIA-built bridge aggregators are open-sourced, allowing anyone to write an adaptor for any bridge. We aim to achieve complete decentralization and community-driven development for the entire solution in order to increase trust and scalability.
DIA will initially integrate 2bridges to provide a starting point for the rest of the integrations. The selection was based on the relevance to the Polkadot community. These bridges are:
3. Bridge Attestation Oracle (Collateral Value)
The core feature of the entire solution is providing bridge stakeholders the ability to know if each bridge is fully collateralized at any given time. This solution will be achieved by tracking bridges’ locked assets against and issued assets across multiple chains. This enables the calculator of collateral ratios, which protocols can use to define and trigger safety procedures in their code.
- Example 1: Lending protocol. A dApp provides a cross-chain token lending market. If a bridge listing the token suddenly becomes undercollateralized, the Bridge Attestation Oracle monitors the state and updates the collateral ratio. The Lending Protocol can use this data to automate actions (e.g. halt operations, liquidate), notify users, and more.
- Example 2: Monitoring dashboards. The oracle’s real-time data can be used to create dashboards or trigger alerts / notification via social media bots on Twitter, Telegram, or Discord to warn stakeholder communities in case collateral ratios drop below certain thresholds.
In order to use the collateral ratios, Parachains can integrate a Polkadot Pallet (Polkadot native feature), making all the core functionalities of the Bridge Attestation Oracle available for dApps running on the Parachain. Each parachain will be able to decide if they want to make the oracle a public good. The oracle can be customised to provide updated collateral ratios on every block or alternatively, on a request basis, where values will be updated based on dApps’ request.
Project Development: Completed
The project has successfully met its two milestones, leading to the launch of the DIA Bridge Attestation Oracle, now live and accessible for parachains and dApps built on top. We warmly invite contributions to further extend integrations on this foundational work.
Initially, the first milestone centered on crafting the core functionality of the Bridge Attestation Oracle. This phase saw the creation of an off-chain worker, the development of a pallet for integration, the forging of connections to other chains’ RPCs with fallback capabilities during outages, and the design of logic to calculate collateral ratios within the off-chain worker.
Following that, the second milestone focused on melding this core functionality with diverse bridge solutions. This entailed developing modules to fetch collateral information for assets bridged by XCM, Multichain, and Interlay bridge contracts. As of now, the pallet boasts two integrated bridges: the Interlay Bridge and the Multichain bridge.
Discover the solution and delve into the documentation in the open-source repository linked below. For any inquiries, our team stands ready to assist via Discord.
Future Development Plans
DIA has a number of potential future development plans for the Bridge Attestation Oracle. These include developing attestation for multichain Liquid Staked Tokens, creating monitoring dashboards for researchers and users, implementing off-the-shelf notification services, expanding into user-defined smart contract metrics tracking, and introducing community-driven governance for changes and future directions of the solution.
Learn more about the project development by visiting the official GitHub repository here.
Why We Chose to Build on Polkadot
Polkadot offers shared security, ease of use, ease of deployment, and efficient interchain communication, making it a great fit for our bridge attestation oracle. The decentralized and trusted nature of Polkadot aligns with our mission to provide transparency and security to the blockchain ecosystem.
“We are very excited to develop a solution that addresses a critical security issue for the blockchain space. Building on Polkadot allows us to leverage its advanced features and security, enabling the creation of a decentralized and transparent oracle that can protect users and protocols from the risks associated with bridge hacks.”Samuel BrackDIA’s CTO and Co-Founder
About Web3 Foundation
Web3 Foundation, established in Zug, Switzerland by Ethereum co-founder and former CTO Gavin Wood, plays a vital role in funding research and development teams focused on building the technology stack of the decentralized web. Polkadot, the flagship project of Web3 Foundation, is a scalable and secure cross-chain platform that fosters interoperability between different chains. Learn more about Web3 Foundation by visiting their website, and stay up to date with the latest developments by following them on Medium or Twitter.
DIA redefines oracles on 30+ L1/L2s: Fully customisable, unmet asset coverage, 100% transparent. Enabling new primitives for DeFi, NFTfi and GameFi. DIA’s data feeds are fully customized with regards to the mix of sources and methodologies, resulting in tailor-made, high-resilience feeds and thereby setting a new paradigm for oracles.