In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces "how to use Bystack cross-chain technology". In daily operation, I believe many people have doubts about how to use Bystack cross-chain technology. Xiaobian consulted various materials and sorted out simple and easy operation methods. I hope to help you answer the doubts about "how to use Bystack cross-chain technology"! Next, please follow the small series to learn together!
Bystack is a BaaS platform with a one-master multi-side chain architecture proposed by the original chain team. It divides the blockchain application into three layers: the bottom ledger layer, the side chain extension layer, and the business adaptation layer. The bottom ledger layer is Layer1, which is the Bytom public chain that is relatively mature at present and adopts POW consensus. The side chain extension layer is Layer2, which is a multi-side chain layer, and the vapor side chain is in Layer2.
Vapor side chain adopts DPOS and BBFT consensus, TPS can reach tens of thousands. Here we analyze the cross-chain model linking Bytom main chain and Vapor side chain.
Master-side chain cooperative working model
1. Technical details
POW is currently criticized for wasting energy, and POW itself encounters many problems in the process of improving TPS. In theory, it can make the block bigger and stuff more transactions into the block. TPS is the number of transactions in blocks per second * blocks. However, there are also problems: small nodes can't afford to store such a large capacity of content, and will gradually become centralized mode, because only large consortia and large organizations have the financial resources to set up computer room equipment and become nodes that can produce blocks. At the same time, transmission also has problems, network bandwidth is limited, block size is related to the edge of network transmission, it is impossible to increase the block size indefinitely, people on the edge of the network can not get the information of new blocks, but also reduce the degree of decentralization, which is why POW can not improve the reliability of the case, improve TPS reasons.
Although BFT is weak in decentralization, it has high efficiency and throughput, and does not require a large number of consensus calculations. It is very environmentally friendly and energy-saving, and meets the performance requirements of Bystack side chain with high TPS.
(1)Cross-chain model architecture
In Bystack's master-side chain coordination model, there are main chain, side chain and Federation. The main chain is bytom, which adopts AI-friendly PoW (Proof of Work) algorithm, which is mainly responsible for value anchoring, value transmission and trusted storage. Side chain is Vapor, adopting DPOS+BBFT consensus, high TPS meets vertical field business. The circulation of assets between main chain and side chain mainly depends on Federation.
(2)node type
The nodes in the cross-chain model mainly include collectors, validators, and federates. Collectors monitor federal addresses, collect transactions and generate Claim transactions for cross-chain. The verifier is the side chain's giver. Federation members are elected by the users of the sidechain and are responsible for generating new federation contract addresses.
(3)Cross-chain transaction flow
Main chain to side chain
Main chain users send tokens to federal contract addresses, collectors monitor federal addresses, generate Claim transactions after discovering cross-chain transactions, and send them to side chains
Side chain to main chain
The sidechain user initiates a withdrawal transaction and destroys the sidechain asset. Collectors monitor sidechain-to-master transactions and send the corresponding amount of assets to the master address. Finally, the federation generates an operation transaction to complete the withdrawal in the side chain.
2. Code analysis
Cross-chain code is mainly in the federation folder, here is an introduction to this part of the code.
(1)Keeper Start
The key to the whole cross-chain is to synchronize the blocks of the main chain and the side chain, and to handle cross-chain transactions in the blocks. This part of the code is mainly in mainchain_keerper.go and sidechain_keerper.go, corresponding to the blocks dealing with main chain and side chain respectively. Keeper is started in the Run function.
func (m *mainchainKeeper) Run() { ticker := time.NewTicker(time.Duration(m.cfg.SyncSeconds) * time.Second) for ; true;
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.