Skip to content

Latest commit

 

History

History
126 lines (76 loc) · 10.4 KB

README.md

File metadata and controls

126 lines (76 loc) · 10.4 KB

Cross-chain Asset Management Protocol - CCAMP

📘 Overview

CCAMP is an asset management protocol that leverages data-driven strategies to effectively manage and reallocate assets among various parties. This protocol encompasses a well-coordinated ecosystem, including smart contracts residing on EVM blockchains (and eventually non-EVM blockchains), a trio of interconnected canisters for state maintenance, and a crucial data relayer acting as an intermediary between the smart contracts and canisters.

At its core, CCAMP is a versatile, modular, and custom data-driven Cross-chain Asset Management Protocol, harnessing the following technologies and components:

  • The Internet Computer: Providing the backbone for on-chain computation, ensuring the protocol's robust execution.
  • The Log Store Network: Ensuring the availability of highly reliable and cryptographically pure event data, a critical element for informed asset management.
  • Attestation Oracle (aka., Indexer Relayer): Facilitating streamlined and verifiable data relay from foreign blockchains; connecting the protocol with external data sources.
  • Locker Contracts: These contracts, available in Solidity for EVM and other compatible languages like Rust, play an essential role in asset management and protection across various blockchains.

CCAMP's flexibility, modularity, and data-driven approach make it an ideal choice for those seeking efficient and secure asset management solutions across multiple blockchain networks. It seamlessly combines the power of the Internet Computer, Log Store Network, and Locker Contracts to create a cutting-edge protocol for cross-chain liquidity aggregation management.

👉 Learn more

Overview

Codebase

🎯 Asset Bridge Scenario

Here's a high-level walkthrough of the CCAMP used as a decentralised bridge:

Let's assume we're bridging NUSD from ICP to Avalanche.

  1. NUSD is deposited into a Vault Smart Contract on the ICP.
  2. The depositor indicates to the Asset Manager Protocol (AMP) that they'd like to re-allocate their deposit to their wallet on the Avalanche Network.
  3. The depositor then requests an authentication key (ECDSA Signature generated by the Protocol) which is forwarded to the NUSD Smart Contract on Avalanche.
  4. The Avalanche Smart Contract verifies and nullifies the signature, and uses the associated parameters to mint NUSD to the destination wallet.
  5. The depositor can now withdraw their NUSD on Avalanche.

In this paradigm, the vaulted assets on the ICP effectively back (1:1) the asset minted on the foreign blockchain.

Now, let's assume we're bridging NUSD back from Avalanche to the ICP.

  1. NUSD is deposited into the NUSD Smart Contract to burn it, and emit a Deposit Event.
  2. This event is indexed by our "Indexer Relayer Node(s)" (IDN)
  3. The event is then streamed to the Log Store Network, a network of nodes that re-validates the event after a particular set of blockchain confirmations, and streams it's proofs back to the IDN.
  4. The IDN then receives signed attestations about the validity of this Deposit event.
  5. The IDN submits this event, and validity proofs to the AMP
  6. The AMP verifies the proofs and uses the event parameters to adjust the unified balance map indicating that a wallet owns X NUSD on Avalanche.
  7. The depositor indicates to the Asset Manager Protocol (AMP) that they'd like to re-allocate their deposit to their wallet on the ICP.
  8. The depositor can now withdraw their NUSD on the ICP.

🚙 Roadmap

The development of CCAMP is a journey marked by continuous enhancement and innovation. Here's a glimpse into our future plans and how we intend to evolve the protocol:

  • Near Real-Time Data Ingestion
    We are committed to enabling near real-time DeFi capabilities within CCAMP. To achieve this, we plan to replace on-chain HTTP outcalls with a dedicated node optimised for high-frequency verifiable data ingestion. This transformation empowers CCAMP to operate as swiftly as incoming data, ushering in a new era of near real-time DeFi.

  • Account Reconciliation
    As we seek to enhance the speed and efficiency of CCAMP, we recognise the limitations posed by block confirmation wait periods for every Locker Contract interaction. Our ongoing research and development efforts focus on account reconciliation and the introduction of a mechanism to flush Canister historic state transitions to the Log Store. This innovative approach will allow all incoming deposits to immediately influence the protocol's aggregated liquidity, while withdrawals will still await the block confirmation period.

  • Diverse Blockchain Compatibility
    At Usher Labs, we believe in inclusivity. Our future roadmap includes expanding the reach of Locker Contracts to support a diverse array of blockchains. While Locker Contracts currently cater to Solidity/EVM blockchains, we are eager to embrace improvsed diversity in cross-blockchain compatibility. If you have the expertise to contribute Locker Contracts designed for various blockchains, your efforts will be highly valued, and your contributions will be recognised within this repository and the wider Usher Labs Community.

The CCAMP roadmap is a testament to our dedication to advancing the capabilities of this innovative protocol. Join us on this journey, and together, we can shape the future of decentralised asset management and data-driven asset reallocation.

🚀 Get Started

CCAMP empowers developers to create and register Data Collection (DC) Canisters, fostering modularity in the system. These DC Canisters play a crucial role by accepting bespoke data from sources like Log Store or user inputs, and subsequently reallocating assets based on this input data. Upon deployment, each Data Collection Canister is assigned a unique identifier.

Managing Liquidity: To ensure the orderly flow of assets within the protocol, deposits and withdrawals with Locker contracts must reference this unique identifier, ensuring that liquidity is accurately assigned to the relevant DC Canister. This practice safeguards against DC Canisters inadvertently affecting liquidity across the entire protocol.

Investor Liquidity Management: Each DC Canister is responsible for managing the liquidity allocated to it by investors, providing an organised approach to asset reallocation.

Ready to create your own DC Canister and contribute to the CCAMP ecosystem? Here's how to get started:

  1. Create Your DC Canister: Develop and deploy your Data Collection Canister, aligning it with your specific data needs.
  2. Register Your Canister: Once your DC Canister is up and running, contact the Usher Labs team for the registration process. This step integrates your canister into the core CCAMP ecosystem, allowing it to function seamlessly alongside other protocol components.

Embark on your CCAMP journey, foster data-driven asset reallocation, and engage with the Usher Labs team for support and integration. Together, we can advance the capabilities of this innovative protocol.

Ready to explore the potential of CCAMP? Join us on Discord.

⚠️ Pre-requisites

Alternatively you can run the following command at the root of the repo npm run setup which would install the dfx cli tool if you are on Mac/Linux.

⚙️ Setting up

  • Clone the repo.
  • install the dependencies by running yarn install

📕 Core components

For an in-depth exploration of Rust canisters, refer to the documentation available here. The canisters play a pivotal role as the primary interface for protocol users, with three core canisters forming the backbone of CCAMP. These are the Remittance Canister, the Protocol Data Collection Canister (PDC), and the Data Collection Canister.

The smart contract component features the Locker contract. Its primary purpose is to facilitate fund deposits into the protocol, fund withdrawals, and the cancellation of pending withdrawal requests initiated from the canister.

The Indexer Relayer acts as the vital intermediary that links Locker Smart Contracts on Foreign Blockchains to the PDC canister. It's function is to Index data across various blockchains, gather attestations from the Log Store Network about the validity of these events, and then submit these events and their associated validity proofs to the PDC. In the case of EVM Blockchains, the Graph Node is currently used as a battletested and reliable indexing mechanism.

The original relay is now deprecated, and the source code for indexing data using Gelato Web3 Functions is now generally available as a standalone package.

Licensing

The primary license for the CCAMP is the Business Source License 1.1 (BUSL-1.1), see LICENSE. However, some files are dual licensed under GPL-2.0-or-later:

Contributors

Publications