Architecture

Query lifecycle from data request to retrieval

High-level Architecture

In Futaba, Relayer and Konoha (Oracle) are the off-chain components and they receive the Src (Source) chain requests. Relayer then retrieves the storage proof from each chain, and Konoha retrieves the block headers and returns them to the Src chain for validation.

Detailed Architecture

Phase 1: request query

  1. Call the endpoint to request a Gateway Contract query from the user contract

  2. Gateway Contract emits events related to query requests to Relayer

  3. An event about the query of the block header is emitted from Light Client Contract to Konoha (Oracle)

Phase 2: off-chain agents work

  • Konoha

    1. Konoha receives the event and gets the block header (state root) for a specific block height in the destination chain

    2. Return and save state root to Light Client Contract

  • Relayer work

    1. Relayer receives the event and obtains the account proof and storage proof of the target data

    2. Return the proof to the Gateway Contract in the src chain (at this time, the state root must have been saved first)

Phase 3: verify and return data to the user

  1. Light Client Contract to verify account proof and storage proof

  2. The store received data as a cache

  3. If verification is successful, data is returned to User Contract

Last updated