Cross-chain data connection service
Cross-chain Data Connection Service is a service from Ant Blockchain that supports trusted data interaction between homogeneous and heterogeneous blockchains for enterprise applications. The service uses a protocol stack and cross-chain contracts in the underlying blockchain to enable trusted interaction. This builds a blockchain value network, allows the trusted flow of on-chain value, and enables various inter-chain operations.
The Cross-chain Data Connection Service breaks down data silos between different blockchain consortiums and enables trusted data exchange. For example, it connects data pathways for upstream and downstream consortiums in a supply chain or enhances mutual trust between different consortiums.
The Cross-chain Data Connection Service is currently in public preview. You can request a trial.
Cross-chain service invocation link
To use the Cross-chain Data Connection Service, you must register your blockchain with the service and install the cross-chain contract. Your business contracts then interact with the cross-chain contract to exchange information between different chains.
Data interaction methods
The Cross-chain Data Connection Service currently supports two data interaction methods:
Ledger data access: A target blockchain directly accesses data on a source blockchain through the cross-chain service.
Contract message push: A source blockchain sends a message to a smart contract on a target blockchain through the cross-chain service. The smart contract on the target chain then processes the message.
Use the cross-chain data connection service
Enable the service
You can submit a request to enable the Cross-chain Data Connection Service in the Ant Blockchain Cross-chain Service console.
Register a blockchain
Register the blockchain that you want to use for cross-chain operations in the cross-chain service. After registration, the blockchain receives a unique chain domain name as its identity. The Cross-chain Data Connection Service then uses a cross-chain contract to access your blockchain and transfer cross-chain information.
Click Register Blockchain to go to the registration page.
Select the type of blockchain to register and complete the registration steps. This service currently supports Ant Blockchain and Hyperledger Fabric. To register other types of blockchains, you can submit a ticket.
Register an Ant Blockchain
Set Blockchain Type to Ant Blockchain. The system automatically retrieves the list of your blockchains on the Ant Financial Ant Blockchain BaaS platform. Select the blockchain that you want to register from the list.
NoteOnly the consortium administrator of the Ant Blockchain has permission to perform this operation.
Create a domain name for the blockchain. This domain name serves as the unique identity of the blockchain during cross-chain authorization.
Register a Hyperledger Fabric blockchain
Complete the following preparations.
Create an organization and add it to a consortium. Create a channel for the business that requires cross-chain operations, and create a user for the cross-chain service. The cross-chain service uses this user's identity to perform data synchronization.
NoteHyperledger Fabric uses channels for business isolation. Each channel that requires cross-chain operations must be registered in the cross-chain service.
Open the registration page and fill in the required information.
Set Blockchain Type to Hyperledger Fabric. Follow the on-screen instructions to complete the registration.
Download the cross-chain chaincode package and upload it to the channel in Alibaba Cloud BaaS. For more information about uploading chaincode, see Management chaincode. Then, install and instantiate the cross-chain chaincode.
ImportantThe cross-chain chaincode must be on the same channel as the business chaincode.
Create a user for the cross-chain service and download the user's software development kit (SDK) configuration.

Unzip the SDK configuration package.
Retrieve and upload the
connection-profile-standard.yamlconfiguration file.Configure the remaining information.
Because the
connection-profile-standard.yamlfile contains information about all channels and peer nodes, you must select the channel for the cross-chain operation and the related peer nodes for validation. Enter the username and password for the user that was created for the cross-chain service.
Registration complete
After the registration is complete, you can view information about the registered chain in the console.

Cross-chain authorization
To the right of the registered blockchain, click Details to go to the details page.
Click the Cross-chain Authorization tab to go to the Cross-chain Authorization page.
Ledger data access authorization
Grant another registered blockchain permission to access the ledger data of the current blockchain through the cross-chain service.
The following data types can be accessed:
Ant Blockchain transactions
Ant Blockchain Block
Ant Blockchain block headers

In the authorization example shown in the figure, the blockchain crosschain1.oracle.chain allows the blockchain crosschain2.oracle.chain to directly read on-chain transaction information through the cross-chain service.
Contract message push authorization
Grant a specified contract on another registered blockchain permission to send messages to a specified contract on the current blockchain.

In the authorization example shown in the figure, the blockchain crosschain1.oracle.chain allows the contract sourceContract on the blockchain crosschain2.oracle.chain to send messages to the contract destContract on crosschain1.oracle.chain. The destContract then processes the messages.
View authorizations
After the authorization is successful, you can view information about the authorization under My Permissions.

Business contract development
Ledger data access development flow
To use the ledger data access API operation in a user smart contract, follow these steps:
Obtain the ledger data contract name from the Ant Blockchain BaaS platform.
Obtain the ledger data access API operation definition (ChainDataInterface.sol).
Import the ledger data access API definition into the user contract.
Implement the callback interface in the user contract to asynchronously receive ledger data callbacks.
Build a ledger data access request in the user contract (ChainDataCmdHelper.sol).
Send the request from the user contract to the ledger data contract. For more information, see the API usage examples.
The ledger data service returns data in JSON format. For more information about the format, see the ledger data structure section.
Development reference for business contracts:
Contract message push development flow
To use the contract message push service API operation in a user smart contract, follow these steps:
Obtain the message contract name from the BaaS platform.
Obtain the contract message push API operation definition.
Import the contract message push API operation into the user contract.
Implement the message receiving interface in the user contract to be called by the cross-chain message contract.
Call the message sending interface of the cross-chain message contract from the user contract.
Development reference for business contracts: