New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TIP-246:TRON Cross Chain Contract Transaction #246
Comments
What are the specific cross-chain usage scenarios? |
”the parallel chain should complete the specific implementation of transaction execution“ The code has released? Could you provide the developing guide to implement the interfaces? |
Which chains are supported first? Ethereum, Polkadot?Is there a relevant testnet to try? |
Does TRON support heterogeneous cross-chain? Can TRON actively access Ethereum? |
Regarding the trading model shown in your picture, I have a few questions:
|
a very common usage for cross-chain is asset exchange. for example, if you want to change 1ETH to 1000TRX.it is easy to implement via cross-chain. |
you can check out this TIP:https://github.com/tronprotocol/tips/issues/243.which will answer your question. |
1.currently, we only support homogeneous cross-chain,which means the para-chain should also be a 'java-tron' chain. but we will support heterogeneous cross-chain to support to cross with Ethereum. 2.In TRON's cross-chain arch,TRON network and other para-chains are peer-to-peer(equal).which means TRON can receive other chain's messages and TRON network can also be connected to other para-chain |
|
currently, the project is under heavy testing. and the dev documentation will be ready when testnet launch |
How long does it take for a cross-chain transaction to succeed? And how to confirm whether the transaction is successful and will not roll back?Is there any interface to confirm? |
What's TPS of TRON Cross Chain Contract Transaction? |
What are the advantages of TRON's compared to Polkadot’s cross-chain solutions? |
1.Theoretically, ,a cross-transaction will take 10~20s. |
you can check this section 'Advantages', which describe the difference compare with other popular cross-chain solutions. |
1.Actually, the TPS of cross-chain contract transactions depends on TRON’s transaction processing capabilities. |
Simple Summary
This TIP describes a solution of TRON cross-chain contract execution in TRON network and parallel chains.
Abstract
TRON's cross-chain architecture only provides message passing and validation; the parallel chain should complete the specific implementation of transaction execution. Parallel chains must ensure the atomicity of transactions, as there is not a rollback function.
Motivation
Currently, there are many cross-chain solutions in the industry, like Polkadot, ETH 2.0, Cosmos, ETC. Each solution has its unique features apart from regular asset transfer and information interaction functions. However, these solutions' architectures and communication protocols are complicated, as they are hard to understand or working as a basis of the parallel chains' implementations.
In TRON's solution, we encourage parallel chain maintainers to manage their transaction and communication details. TRON network is only responsible for message delivery and verification. That is, theoretically, the content format between chains as well as the transaction logic can be any. This lightweight design ensures its scalability.
Technical Specifications
The diagram shows the scenario of asset exchange. Assuming Luna wants to transfer 10,000 BTT from A to B in exchange for 100 USDT:
We are going to talk more about the details of TRON's cross-chain architecture:
When TRON network receives a message in a new type,
CROSS_MSG,
it recognizes a cross-chain transaction and caches the transaction.Receive Cross-Chain message interface:
The format of the cross-chain message is
message crossMessage
(see "Data Structure", below).A timing task is kept executing in the background for periodically processing cached cross-chain transactions. Based on the Merkle proof of the transactions submitted by chain A, TRON network can check whether a transaction has been successfully executed and committed in chain A.
Later, when the block is processed again, TRON network will check whether the cross-chain transaction has timed out and then process it after checking that the transaction is correct.
TRON network listens to the PBFT block commit event at the same time. When a cross-chain transaction is found not been processed, a new cross-chain transaction message will be constructed,the construct details include generate the Merkle proof paths of this cross-chain transaction and set the proof and the root height to 'crossMessage'. after we construct the proofs and root height successfully .the data sent to a specified parallel chain with this interface:
Cross-chain transaction messages will be saved for subsequent processing after it is broadcasted.
Broadcast message interface:
TRON network will delete the cross-chain transaction from the local cache and execute it after receiving the ACK message from chain B.
Rationale
Advantages:
1.Lean but well-designed
Unlike other complex cross-chain solutions, based on solving the core requirements of cross-chain, TRON refines a set of concise technology(SPV, Merkle Root, ETC), which is easy to understand architecture and usage details. We believe this gives our solution a great advantage for the promotion.
2.High Scalability
In cross-chain solutions, as subsequent extensions and specific chain characteristics must be taken into account, communication protocol design is usually complex. Generally, cross-chain solutions will pre-define some supported operation types(transfer, message format, ETC). Modifications of the communication protocol are usually required to support more message formats. These will be the scalability barrier, for these modifications can involve both TRON network and parallel chains.
TRON always focuses on the scalability problem. With the design pattern of 'separation of concerns', TRON makes the specific communication details and the general cross-chain scheme into two parts. That is, TRON only needs to concentrate on the generic technical details, and at the same time, parallel chains can focus on their specific business logic. This clear division of labor dramatically improves scalability.
Data Structure
Message
CrossMessage
is used between parallel chains and TRON network:Below are interfaces used between parallel chains and TRON network:
Attentions
Cross-chain transactions cannot be rolled back
A complete cross-chain transaction contains three parts:
These three transactions are executed and solidified on their chains. Like other transactions, a solidified cross-chain transaction cannot be rolled back.
Atomicity of cross-chain transactions on parallel chains
Due to the non-rollback characteristic of cross-chain transactions, some cross-chain transactions may fail to be executed only on chain A(e.g., insufficient bandwidth on chain B). This makes the atomicity of the transaction unattainable.
Here we come up with a possible solution for the problem: contract authors may deploy a regular contract and a rollback contract simultaneously. Rollback contracts will be efficient to deal with failed executions.
Transaction timeout
Distributed systems can only meet at most two conditions among consistency, Availability, and Partition Tolerance, so cross-chain transactions will inevitably be executed on particular chains, as cross-chain transactions are executed independently on different chains.
We suggest contract authors regularly detect timeout transactions and perform some compensation operations or rollback operations by querying contract transaction execution results.
The text was updated successfully, but these errors were encountered: