1

We would like to query some state about balances or parachain-staking pallets on other parachains. Is there an example to do this using the querying system that is semi-complex? I see this exists https://wiki.polkadot.network/docs/learn/xcm/journey-queries.

We specifically want to query

  • The amount of stake an account has on the staking pallet on Polkadot (from a parachain)
  • The amount of stake an account has on the parachain-staking / on various parachains

3 Answers 3

0

There is no dedicated way to query general state cross-chain using XCM - I guess you can get some info if it's exposed by callable calls using XCM Transact, but that's both expensive and potentially brittle (because of call encoding).

There is a dedicated generic mechanism being developed called XCQ which is targeting the exact kind of usecases you describe.

There are more details here: https://forum.polkadot.network/t/cross-consensus-query-language-xcq/7583

0

You should check out ISMP which is capable of doing state queries: https://docs.hyperbridge.network/protocol/ismp

Note of caution: Reading state directly is brittle. The developers of the other chain can not feasibly be expected to never ever change state representation, so ideally we would have an exposed API on top, e.g. via something like XCQ.

0

You can check this grant of xNFT, I guess it will be helpful for you.

https://github.com/w3f/Grant-Milestone-Delivery/pull/1115

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.