As the basis of cross-chain interaction, the interface (API) is an important part of the cross-chain platform. At present, major blockchain platforms provide a wealth of interfaces. Should these interfaces be re-implemented in cross-chain platforms? In order to realize a universal cross-chain platform, how to determine the keynote of interface design? In order to meet the complex and changeable cross-chain requirements, which interfaces are necessary? What is the interface implementation of WeCross? This article will take you to find out.
With the development of blockchain technology, blockchain is widely used in all walks of life. In order to support more and more diverse application scenarios and complex business needs, blockchain interfaces are also growing and improving. At present, mainstream blockchain platforms often provide dozens of interfaces. Rich interfaces greatly facilitate development. However, for cross-chain, whether all blockchain interfaces need to be used remains to be discussed.
Take getPbftView of FISCO BCOS as an example. This interface is used to obtain the latest PBFT view in the specified group where the node is located. Not generic enough.
The cross-chain aggregator Bungee launched the Refuel function, supporting Ethereum and Layer2 to send small amounts of Ethereum when cross-chain: On September 24, the cross-chain aggregator Bungee supported by the cross-chain infrastructure Socket launched the Refuel function. When cross-chaining with Layer2 and two Layer2 networks, a small amount of Ethereum can be sent as the Gas fee on the target chain. [2022/9/24 7:18:22]
Therefore, although there are many blockchain interfaces, how to choose the appropriate interface to design a cross-chain platform needs to be analyzed in combination with the actual situation.
The cross-chain platform is a bridge connecting heterogeneous chains. In order to shield the differences of blockchains and reduce the complexity of cross-chain access, the interaction between the platform and different blockchains requires a common and unified interface. Therefore, the blockchain interfaces required for cross-chains must be Some common interfaces.
By classifying the service interfaces of mainstream blockchain platforms, they can be roughly divided into the following three categories:
Kyoko, a cross-chain GameFi NFT lending market, completed $3.6 million in strategic financing: On March 7, Kyoko, a cross-chain GameFi NFT lending market, completed a strategic financing of $3.6 million, led by ATEN Infinity Ventures, Morningstar Ventures, Kliff Capital, Cherubic Ventures, Kosmos Ventures, Vespertine Ventures, Tess Ventures, Cryptobuddy, etc. participated in the investment, and the funds raised will be used to expand Kyoko's foothold in key global markets and consolidate its business in Southeast Asia, East Asia, Russia, India and other strategic regions.
Additionally, Kyoko will launch its IDO, INO, and IVO on March 22. In February of this year, Kyoko completed a $3 million private placement led by Animoca Brands. [2022/3/7 13:41:53]
Contract class: This type of interface is used to implement functions such as smart contract deployment and smart contract call. They are the main interfaces supporting blockchain business and are frequently accessed. Among them, the contract call can be subdivided into the read interface of the query type (no transaction) and the write interface of the update type (transaction). The often-called "on-chain" is completed through this write interface.
Celer Network cross-chain payment network cBridge 2.0 upgrade test network is online, and the main network will be launched in November: On November 9th, Celer Network's cross-chain payment network cBridge 2.0 upgrade test network was officially launched. The upgraded version of the testnet has carried out a series of functional iterations based on user feedback on the first version of the testnet. It has launched a new cBridge transaction fee reward function and supports the new version of CELR pledge UI/UX. Users can obtain more complete fee estimates before transfers. And it is possible to merge the available liquidity on multiple chains into one chain, and withdraw these liquidity on a single chain, which greatly reduces the cost of the operation process. At the same time, Celer launched a new version of the $20,000 testnet campaign.
Additionally, cBridge has completed three independent audits and found no security vulnerabilities in either the Celer cBridge or the SGN 2.0 smart contracts. cBridge is currently undergoing an internal cross-team security review and is expected to launch the mainnet in November. [2021/11/9 6:40:32]
Event class: It is mainly used to build a blockchain event response mechanism to realize the trigger linkage function between the blockchain and the business layer. The blockchain implements event push through callback or Log, and then the business layer completes event capture based on the listening interface for subsequent logic.
China Academy of Information and Communications Technology released the cross-chain infrastructure project "Trusted Chain Network": On December 22, the "2020 Trusted Blockchain Network" jointly sponsored by China Academy of Information and Communications Technology, China Communications Standards Association and Trusted Blockchain Promotion Plan Summit” was held in Beijing. At the meeting, CAICT released the self-developed cross-chain infrastructure project "Trusted Chain Network". He Baohong, director of the Yunda Institute of China Academy of Information and Communications Technology and executive vice chairman of Trusted Blockchain, introduced that through cross-chain technology, the upstream and downstream of the industrial chain, horizontal business alliances, general data services under the chain, and cross-industry supervision can be realized. "Trusted Chain Network" is a cross-chain service infrastructure, a cross-chain standard reference implementation, and an inclusive cross-chain open source technology community and industry cross-chain application ecology, all in one. (Official website of Trusted Blockchain Summit)[2020/12/22 16:04:02]
Status class: mainly used for blockchain system management, such as obtaining block headers, querying block height, viewing transactions, etc. This type of interface is mostly oriented to the operation and maintenance system. By cooperating with the blockchain node log, it can realize real-time monitoring of the entire blockchain system and give an alarm for abnormal conditions.
Live | Hu Xiaoming, CEO of Ant Group: Cross-chain is the foundation of Wanchain Interconnection Cross-chain technology drives digital asset circulation: Jinse Finance live report, on the morning of September 24, a global high-level financial event directed by the Shanghai Municipal Government and hosted by Alipay and Ant Group The science and technology conference "The Bund Conference" opened in Shanghai. Hu Xiaoming, CEO of Ant Group, pointed out on the spot that a technology-led digital transformation is taking place from China to the world. Financial technology has entered a new era of trustworthiness and intelligence. Sharing intelligence based on privacy protection makes open finance a reality. The essence of finance is risk management, and we need continuous and dynamic financial risk prediction. Therefore, we launched the timing graph intelligence to improve the level of financial risk management, and launched a financial-level distributed graph database to realize graph computing. In addition, cross-chain is the foundation of Wanchain interconnection. Cross-chain technology drives the circulation of digital assets. AntChain has achieved a scale of 1 billion accounts, a daily transaction volume of 1 billion, and realized supply chain finance, rural finance, cross-border trade, etc. Class cross-chain services. I want to remind developers that blockchain must be an important technology to promote future technological changes. In the era of Wanchain Internet, financial security will also enter the active-ethexc defense mode. For a long time, technology has always driven Ant to innovate continuously, and technology is the core competitiveness of Ant. [2020/9/24]
For a cross-chain platform, a contract interface is essential to operate cross-chain resources; in order to monitor cross-chain requests, an event interface must also be available; in order to complete cross-chain transaction verification, it is necessary to obtain the block headers of each chain. Therefore, the state class interface is also required.
Although each classification has many interfaces, only the intersection of the common interfaces of each blockchain is the basis of cross-chain interfaces. It can be seen that the functional requirements of cross-chain are relatively certain, and the number of interfaces involved can also be converged.
Now that the tone of the cross-chain interface has been determined, which interfaces are needed for the cross-chain? First of all, it needs to be clear that the interface design of the cross-chain platform includes two levels, the service interface for the upper-level business, and the interactive interface for various heterogeneous blockchain platforms.
The familiar HTTP protocol abstracts all network access operations into two methods: GET (get data) and POST (submit data). In the cross-chain scenario, there are many requirements such as cross-chain asset circulation, resource atomic exchange, information acquisition, data cross-chain update, and related transactions. They are essentially to obtain or update data on the chain.
Therefore, in terms of service interface, we draw on the successful experience of the Internet to abstract and condense the cross-chain behavior, and find that only the following three are needed:
Initialization: cross-chain resource initialization interface, such as deploying smart contracts;
Read interface: obtain information on the chain, for read-only scenarios;
Write interface: update the data on the chain, and face the cross-chain transaction scenario.
In addition to obtaining and sending data, cross-chain access also shoulders the mission of cross-chain credible verification and cross-chain transaction assurance, which relies on functions such as block header-ethexc synchronization, cross-chain transaction verification, and cross-chain event monitoring. By abstracting and condensing the interaction process, cross-chain also requires the following three interaction interfaces:
Get block height: query the current block height to complete block header-ethexc synchronization;
Obtain block: query block header-ethexc and other information to complete cross-chain transaction verification;
Register event: used to monitor cross-chain events.
With 6 interfaces for interaction between the upper layer service and the bottom layer, the information link between the business layer and the blockchain can be opened up, and at the same time, the differences in the interface access protocols of different blockchain platforms are shielded for cross-chain applications. Through The unified data protocol and call format complete the interaction with multiple blockchains.
The interface implementation of WeCross is completed based on the above ideas. WeCross includes two core components, the cross-chain router (router) and the cross-chain adapter (stub), where the cross-chain adapter is integrated into the cross-chain router in the form of a plug-in.
The three main service interfaces provided by the cross-chain router are call, sendTransaction and customCommand. Among them, call and sendTransaction are used for contract calls, and customCommand is used for other custom commands such as contract deployment, and also reserves the possibility of expansion for the platform to adapt to the ever-growing cross-chain needs.
The cross-chain adapter defines 6 core blockchain operation interfaces, including call, sendTransaction, customCommand, getBlockNumber, getBlock and registerEvent.
The first three correspond to service interfaces, getBlockNumber and getBlock are used for block header-ethexc synchronization and cross-chain transaction verification respectively, and registerEvent is used to monitor cross-chain events.
When developing cross-chain adapters for different blockchains, it only needs to implement the above six interfaces to complete the access of heterogeneous blockchains based on plug-in.
Cross-chain routing manages cross-chain adapters of different blockchains. When receiving a call request from the business layer, determine the final destination of the request through the call target field in the request packet, and then select the corresponding cross-chain adapter to complete the forwarding of the request , and finally complete a cross-chain call.
Based on the above-mentioned interfaces, WeCross has now realized support for HTLC-based cross-chain asset atomic exchange, 2PC-based cross-chain transactions and other functions, and has completed various cross-chain function verifications for digital certificate storage scenarios.
Cross-chain technology is still in the exploratory stage. From the perspective of business practicability, the interface protocol design should be simplified, and "small and beautiful" is better than "big and comprehensive".
With the development of the blockchain platform and the continuous evolution of cross-chain requirements, the cross-chain interface will also keep pace with the times, continuously improve and perfect, and move forward iteratively. At present, 6 interfaces across the chain can handle it! In the future, the WeCross community will work with you to see the tricks!
Tags:
As blockchain technology is becoming more and more well-known to the public, "blockchain + finance" has attracted people's attention with its rich application scenarios and imagination. At the same time.
DeFi liquidity mining has become very popular, attracting a large number of investors to participate. In order to facilitate investors to keep abreast of the relevant information and mining process of DeFi mining proj.
Polkadot provides a proxy module through which you can set up a proxy account to add a layer of security.
As the basis of cross-chain interaction, the interface (API) is an important part of the cross-chain platform. At present.
Sushi stimulated the DeFi market, and it also has a rich plot of mining projects. On 10 last night, asset migration was carried out.
The nature of each level: daily line - consolidation, 4 hours - down, 1 hour - consolidation (bearish pattern)The screenshot is from the OKEX BTC/USDT perpetual 4-hour chart: For the market, there are two angles.
With the popularity of concepts such as DeFi, the encryption market has shown an overall upward trend, and Bitcoin even hit a new high for the year in August. For a while.