opened 01:41PM - 11 Mar 22 UTC
I6-meta
Let this issue be a discussion thread for a question coming up more and more abo…ut enabling parachains to read state of one another, which can help facilitate XCM/XCMP and other cross chain messaging.
In general, for chains to effectively interoperate with one another, they must be able to send messages (XCM/XCMP), but also read state of other chains. For example, if Kilt acts as an identity / attestation chain, other parachains will want to be able to read which identities have which attestations, and use that information to improve the application experience they can provide.
I am definitely not an expert in this, but here are some ideas which may solve this problem, and can kickstart a conversation.
1. XCM / XCMP
XCM/XCMP could provide a method for querying and returning data between parachains, but this would be very inefficient and also have problems related to the asynchronous nature of XCMP. Who knows how long it could take to get a response back, and who knows at that time if the response has data which is accurate.
Maybe this story changes once true parachain-to-parachain XCMP exists, but this seems like not a great solution while we still use HRMP.
2. Substrate to Substrate Bridge
Our bridge infrastructure can allow two chains to verify the state on the other using merkle proofs.
Seems a bit crazy to create a bridge between parachains that are already connected to the same relay chain, but there are probably some tooling from within the bridges work that could be used here which will basically allow chains to provide verifiable proofs of storage items.
3. Off-chain Workers
Chains could create a generalized off-chain worker to read the state of other parachains and report that information back to their chain in order to get the information they need.
At a high level, collators can be expected to run nodes of other parachains, or gain access to specific RPC endpoints where they can query the state of another chain. They may be able to provide a merkle proof of the data or use some kind of economic voting system (basic oracle stuff) to verify the data is correct. That data is then submitted directly to the parachain to be used for whatever runtime logic.
---
Are there other options? What is the current thinking on this?