githubEdit

FAQs

What libraries are available for handling queries?

The Query TypeScript SDKarrow-up-right can be used to create query requests, mock query responses for testing, and parse query responses along with some utilities for posting query responses.

The Solidity QueryResponse Abstract Contractarrow-up-right can be used to parse and verify query responses on EVM chains. Simply forge install wormhole-foundation/wormhole-solidity-sdk. See the Solana Stake Poolarrow-up-right repo as an example use case. The SDK also contains QueryTest.solarrow-up-right for mocking query requests and responses in forge tests.

The Go query packagearrow-up-right can also be used to create query requests and parse query responses.

💡 A Rust SDK for Solana is being actively investigated by the Wormhole Contributors. See the Solana Queries Verificationarrow-up-right repo as a proof of concept.

Are there any examples?

There sure are!

What is the format of the response signature?

The guardian node calculates an ECDSA signature using crypto.Signarrow-up-right where the digest hash is keccak256("query_response_0000000000000000000|"+keccak256(responseBytes)). See the Guardian Key Usagearrow-up-right whitepaper for more background. This signature then has the guardian's index in the guardian set appended to the end.

💡 If you are used to ecrecover you will notice that the v byte is 0 or 1 as opposed to 27 or 28. The signaturesToEvmStruct method in the Query TypeScript SDKarrow-up-right accounts for this as well as structuring the signatures into an IWormhole.SignatureStruct[].

Can anyone run a Query Proxy server?

The Query Proxy is currently permissioned by the Guardians. The guardian nodes are configured to only listen to a set of allow-listed proxies. However, it is possible that this restriction may be lifted in the future and/or more proxies could be added.

It is also important to note that the proxies do not impact the verifiability the request and result - i.e. their role in the process is trustless.

What does Queries offer over an RPC service?

Wormhole Queries provides on-demand, attested, on-chain verifiable RPC results. Each guardian independently executes the specified query and returns the result and their signature - the proxy handles aggregating the results and signatures, giving you a single result (all within one REST call) with a quorum of signatures suitable for on-chain submission, parsing, and verification using one of our examples / SDKs.

Last updated

Was this helpful?