As we all know Quai has 13 chains that are all independent, but have coincident blocks with eachother to allow the passthrough of data between them. How would this influence dapps that would like to deploy on Quai? Would they have to deploy on all 13 chains or there will be a mechanism for an account on Cyprus-1 to interact with a dapp deployed on Paxos-3 similarly to external transactions?
I suspect this depends on the type of dApp. A token contract, similar to an ERC20, might require a contract to be deployed on multiple chains, and a signalling mechanism between the âsister contractsâ on each chain.
Suppose I want to deploy a token on Quai. I would likely deploy the token contract on all 13 chains. Each contract would need to know two things:
- who are my sister contracts?
- did a message come from my sister contract or an imposter?
If you can answer these two questions (this is trivial, but Iâll save the details for another post), then you can coordinate mints/burns between sister contracts, to effectively move tokens between chains.
Consider the the following scenario: Alice wants to send tokens from her account in Cypress-1 to Bobâs account in Paxos-2. The workflow could look as follows:
- Alice signs transaction to transfer 100 tokens to Bob, and sends her transaction to the token contract in Cypress-1
- The contract burns 100 tokens and emits an ETX to Paxos-2, instructing the Paxos-2 sister contract to mint 100 tokens to Bobâs address
- The ETX will eventually propagate across the network (trustlessly via merged mining), until it becomes âplayableâ in Paxos-2
- A miner in Paxos-2 will mine the ETX into a block, where it can be processed like a normal transaction
- The token contract in Paxos-2 must confirm that the ETX came from her sister contract in Cypress-1, by simply checking the ETX âfromâ field
- this is trustless, because no actor can forge this message from the Cypress-1 contract without 51% of network hashrate (likely much more to pull off such an attack with any speed or finality)
- The token contract then mints 100 tokens to Bobâs account
The mechanism to perform this cross-chain token transfer actually is not very complicated, but it will take some time for the ETX to propagate across the network.
This, obviously, only discusses token contracts. Other contracts might require different cross-chain communication mechanisms, but in my experience so far, every dApp scenario Iâve thought of has been easy enough to work out, and actually kind of fun
Iâm very interested to see the first implementation of cross-chain referencing contracts as it allows solidity developers to do something that has never been done before. Move value between chains without relying on centralized bridging services/other insecure options. Lots of cool things to be built!
Quick question on the actual implementation of referencing contracts: when deploying the sister contracts to all 13 chains, how would a developer make the first deployed contract aware of the others? Obviously not sure exactly sure what the referencing language inside of the contract would look like, but I would assume that each of the contract addresses on other chains would have to be hard coded in order to be aware of them. Which would lead to a bit of a chicken and the egg dilemmaâŚ
Curious to hear everyoneâs ideas on other ways âcontract awarenessâ could be established without hard-coding or other ways developers could work around this.
Since the network scales horizontally with addition of more chains, I was wondering whether you can scale a dApp within Quai in a similar way. Say, you start out with a smart contract deployed on 6 chains. Then, as you go on with deployment, you realise that you may benefit from adding another zone chain because of the user demand of your dApp. Or, another scenario, you deploy on all 13 chains, and then Quai adds the 14th one that you would like to include into your smart contract to maximise throughput. So, there are two questions that I have about this:
- Would that be possible to make an impostor chain a sister chain (ie deploy on more chains than your originally started with) in-flight?
- Is there any benefit to starting off with <13 chains under the assumption that the throughput is âhigh enoughâ?
I am very interested in this question as well and am excited to see how people choose to use Quaiâs unique architecture when building. I think early on there will be a smart contract standard for the equivalent of an ERC20/ERC721 (are we calling it QRC on Quai? Iâll assume so for now) to allow them to seamlessly exist and be transferred across all of Quaiâs chains. I am interested to see how the modularity of Quaiâs architecture will influence these standards though. For example, if another chain is added to Quai (e.g. a fourth Region with three additional Zone chains) will there be a way to auto-integrate these new chains into the pre-existing multi-chain QRC20/721s to allow them to be transferred to the added region and zone chains?
In regards to DApps, I would imagine theyâll start off utilizing a single chain and then expand into other regions and zones. For example, I could see a DEX launching in Region 1, Zone 1 to begin with, but quickly expanding to have support and liquidity in other Region and Zone chains. How does everyone else think a DEX should be architected to take full advantage of Quaiâs multi-chain architecture?
I have different curiosity and itâs about complexity of the strcuture of how dapps will work on 13 quai chains. If all the 13 chains are independent but communicate through coincident block, the fact a SM contract needed to be deployed on each chain as it deem necessary and then its IBC to communicate to sister dapp, thatâs complex. thus this will be more problem to contract/project deployers, if I am one I had think a different approach.
All chains share thesame set of security parameter as well as decentralization, I donât know how wallet on the entire chain will work, if per each independent chain we need different configuration from users end to intereact then for now I have no idea for further research but may be later, but if a single user address has direct access to all chains without altering network configuration then I donât know if this can open a new discussion.
Instead of deploying same contract on different chains and its messaging system, may be have a single messaging summary deploy as a contract on others, so when a user trigger the messaging contract on whatever the chains, it then trigger the original contract from itâs first chain. Some sort of L2 and L1, only that in this scenario, the L2 act as L1 and the L1 act as L2.
Example, letâs say a contract is deploy on Hydra, then the messaging summary deployed in paxos, so users trigger the messaging in paxos, then the messaging prompt the original contract in Hydra and user relay his queries for execution.
I am not a dev, just good with business model design and how blockchain architecture can be utilize to solve problems of humanity. After further read I may add and learn from others too.
Quai has a total of 13 chains so what does each of these chains do, can you tell me more
Great question. Thereâs several ways to do it, but I imagine a simple TOFU initialization sequence is simplest. Basically, the token contract would need two additional features:
- Each contract has 12 âslotsâ to specify the sister contract address on all 13 chains. These slots are empty when initially deployed.
- Each contract has a âownerâ which can update those slots only once (see TOFU^). Once the owner has assigned the sister contract addresses, they can never change.
Then, to deploy a cross chain token contract, you would:
- on all 13 chains, deploy the contract and collect each contract address
- after all contracts have been deployed, go back to all 13 chains and assign the 12 sister contract addresses to each contract.
After this, anyone can independently verify that the correct sister contracts were set, and there is no trust necessary to interact with the token system. This is just my first proposal⌠someone else may have a better idea
If the contract is written correctly, this should be trivial to avoid (see the TOFU setup I proposed before). But you are right this should be considered when writing such a cross-chain contract.
This is a very interesting question⌠I donât know. Maybe there are some dApps out there that would prefer to constrain their users to only use a subset of chains? If you have an example of this, I would love to hear about it
Interesting thoughts. Using an L2 communication method to coordinate state across chains will likely cause centralization & trust issues (this essentially what trusted bridges are today, and weâve all seen how badly that can go). The reasons to use coincident blocks for cross chain signalling are thus:
-
coincident blocks enable trustless bridgingâ provide a cryptographic link between chains, so there is no need to trust a central coordinator, relayer, etc
-
transactions passing through coincident blocks will inherently achieve the same finality (at the same speed) as the two chains which are communicating. e.g. if a message is sent from Cypress-1 to Cypress-2, then they only need to wait for the coincident Cypress region blocks to âfinalizeâ that message. This is precisely the same degree of finality which those two chains can share. If a cypress re-org happened, then the message would re-org safely in that process, so there is no security concern with synchronization to an L2.
Essentially, coincident blocks are the only way to trustlessly signal between chains. Coincident blocks are a cryptographic commitment to the state of both states (i.e. merged state), which is as good as you can ask for when you want to communicate a message which relates to the state of both chains. Other solutions would introduce some degree of trust & centralization, which we obviously want to avoid.
The whitepaper explains it best, but in short, the 13 chains form a hierarchy of merge mined shards. The key innovation is that the hierarchy provides scalability without sacrificing security. Lower level chains can confirm transactions at a high rate, and these transactions will eventually achieve the same degree of finality (in terms of byzantine fault tolerance) as the chains are merge mined together.
The goal is to handle the transactional volume necessary for global commerce, without compromising decentralization or byzantine fault tolerance.
Really took some thinking, this one
I imagined two pathways that you could take depending on the blocktime of the chain you pick.
If you go with Prime only, you could, analogically to bitcoin, create âthe digital goldâ (lol) That might be redundant though as I donât know a use case for digital gold apart from trading. Another idea for the slower version of an app could be some
If you build on Zone chain(s), then maybe you could create a private token that has the least communication possible with other ones?
after I observed the explanation about TOFU, it was very impressive, but this must really be tested to enter the test as well so that we know how the actual TOFU performance results ,and or this has entered the test with the team ?