Integrate Inter-Chain Confirmation Facility (ICCF)
The Inter-Chain Communication Facility (ICCF) is a client application that facilitates communication between blockchains
running in different dapp clusters. In this context, the ICCF
client acts as an intermediary between two blockchains: it submits a transaction on the source_chain
and provides
proof of the validated transaction to the target_chain
. Upon verifying the proof's authenticity and ensuring that the
transaction was indeed validated on the source_chain
, the target_chain
submits a new transaction, validates it, and
updates the account balance.
In essence, the ICCF simplifies the process of generating proof that a transaction occurred on one chain and verifying this proof on another. It can be integrated into your client application, providing the necessary functionality for end users to move assets freely between different dapp clusters.
Additionally, the ICCF implementation allows two dapps running in the same dapp cluster to communicate without the need for the ICMF protocol.
The sequence for confirming an event (transaction) is as follows:
- The user initiates a transaction on the source chain.
- The source chain confirms the transaction and includes it in a block.
- The block reaches the cluster anchoring chain as a transaction.
- The cluster anchoring chain verifies the transaction and includes it in a block.
- The system chain reads the data from the cluster anchoring chain and validates the corresponding block.
- The user constructs proof by obtaining confirmation of the transaction.
- The user presents the proof to the target chain as a new transaction.
- The target chain validates the proof by checking its anchoring in the cluster anchoring chain.
- The target chain completes verification by including the proof in a block.
In this flow, the user drives the operation and constructs the proof. This process is entirely asynchronous and can occur anytime after block confirmation. This method is ideal for applications where proving an event has taken place is more critical than transferring real-time data. If the main objective is to send messages without needing to verify their arrival time, utilizing the messaging facility (ICMF) may be more suitable.
Set up ICCF in your blockchain
To integrate ICCF into your blockchain, follow these steps:
-
Add the ICCF GTX Module: Include the ICCF GTX module in your blockchain configuration. In your configuration file, add the following lines:
config:
gtx:
modules:
- "net.postchain.d1.iccf.IccfGTXModule" -
Install the ICCF Library: Install the ICCF library by adding the following to your project configuration file:
libs:
iccf:
registry: https://gitlab.com/chromaway/core/directory-chain
path: src/iccf
tagOrBranch: 1.64.3
rid: x"B9CDA906E2ED650ACA2B1D97394D77F432545C26EAAD53336843A2327C594E64"
Create proof with the client
ICCF support is available in the Kotlin client and Javascript/Typescript client. Refer to the client's documentation for more details.
To explore the complete set of APIs available for ICCF, refer to the auto-generated API documentation.
For practical usage examples, check out the Confirm Events Across Blockchains course.