Off-Chain Data Fetching
Overview of Off-Chain Data Fetching with PAL Using EIP-3668 (CCIP-read)
The PAL protocol utilizes the EIP-3668 standard, known as CCIP-read, for off-chain data retrieval. For a detailed understanding, reading the standard is encouraged, but below is the tailored process for PAL:
Process Steps
Initial Request
Request Resolution: A user initiates chip resolution via an EIP-3668 enabled client by providing the chipId.
Processing
Pass ChipId: The client sends the chipId to
resolveChipId
on the ChipRegistry.Handle Unclaimed Chips: If the chip is unclaimed, an
OffChainLookup
error is triggered, which returns:
Array of Gateways
An array of gateways to consult for validation data.
Parameters
Parameters for calling the gateway.
Callback Function
A callback function on the smart contract.
Data Retrieval and Validation
Gateway Query: The client queries one or more gateways from the array using the provided parameters.
Data Return: Gateways return all necessary data encoded in bytes to the client (details in Appendix), which validates and uses this data to determine the correct Service Records.
Finalization and User Interaction
Callback Execution: The client executes the callback function (
resolveUnclaimedChip
) and receives an array of Service Records.Service Redirection: The client then either redirects to a service or offers the user a choice of services.
This flow outlines the general procedure for fetching off-chain data depending on the chip's state within PAL.
Last updated