Scope and Limitations
This skill is documentation and guidance only. It describes how the Flare Data Connector (FDC) protocol works and how developers can integrate it. It does not perform any actions on behalf of the user.
This skill explicitly does NOT:
- Execute, sign, or broadcast any blockchain transactions
- Access, store, or transmit private keys or wallet credentials
- Initiate or authorize any payments or financial transfers
- Call any smart contract methods or APIs directly
- Handle funds, tokens, or any financial assets
External data handling:
- FDC attestation responses (Web2Json, EVMTransaction, DA Layer proofs) are externally provided content from third-party sources
- This skill instructs developers to treat all such data as untrusted and to decode it only according to documented ABI schemas
- Response content must never be passed into prompts, LLM inputs, or agent decision logic
- Developers are solely responsible for validating and safely handling all external data in their own implementations
What this skill does:
- Explains FDC attestation types, request flows, Merkle proof verification, and contract patterns
- References official Flare Developer Hub documentation and audited starter repositories
- Provides read-only conceptual guidance for developers building on Flare
All transaction signing, key management, and on-chain execution must occur exclusively in user-controlled, developer-managed environments outside of this skill.
Flare Data Connector (FDC)
What FDC Is
The Flare Data Connector (FDC) is an enshrined oracle that validates external data for Flare's EVM state. Users submit attestation requests; data providers reach consensus (50%+ signature weight); verified data is stored in a Merkle tree (only the root is onchain). Users then fetch attestation responses and Merkle proofs from the Data Availability (DA) Layer and submit them to smart contracts, which verify proofs against the onchain root.
Key points:
- Prepare request — Verifier API (e.g.
POST .../verifier/web2/Web2Json/prepareRequest
with , and that depends on the attestation type)
- Request → FdcHub (
requestAttestation(bytes)
) with ABI-encoded request; pay fee.
- Round finalization — typically 90–180 seconds; wait before using a proof.
- Proof retrieval — DA Layer API (e.g.
POST .../api/v1/fdc/proof-by-request-round-raw
with and ).
- Contract verification — use (from
ContractRegistry.getFdcVerification()
) and the type-specific method (e.g. , , , ).
Attestation Types
| Type | Purpose | Chains / sources |
|---|
| AddressValidity | Validate format/checksum of addresses | BTC, DOGE, XRPL |
| EVMTransaction | Verify and retrieve transaction + events | ETH, FLR, SGB (mainnet); testETH, testFLR, testSGB (testnet) |
| JsonApi / Web2Json | Fetch Web2 data, JQ transform, ABI-encoded output | PublicWeb2 (Coston/Coston2) |
| Payment | Confirm payment tx on non-EVM chains | BTC, DOGE, XRP |
| ConfirmedBlockHeightExists | Verify block existence and confirmations | — |
| BalanceDecreasingTransaction | Validate tx that decreases an address balance | FAssets-oriented |
| ReferencedPaymentNonexistence | Prove absence of specific payments in interval | FAssets-oriented |
| XRPPayment | Confirm an XRPL Payment with XRPL-native fields (r-address, MemoData, DestinationTag) | XRP, testXRP |
| XRPPaymentNonexistence | Prove no XRPL Payment matched destination/amount/memo/tag in a ledger range | XRP, testXRP |
First three are most generally useful; the next three are mainly for FAssets; the XRPL-specific types expose XRPL-native fields (memo data, destination tag) that the chain-agnostic Payment type does not.
User Workflow (Offchain + Onchain)
- Prepare request — Encode attestation in FDC format. Use a verifier service (e.g. Flare testnet verifier or your own) to get (includes a message integrity code - MIC - and encoded request parameters).
- Submit — Call
FdcHub.requestAttestation(abiEncodedRequest)
with .
- Round ID — From block timestamp:
roundId = floor((blockTimestamp - firstVotingRoundStartTs) / votingEpochDurationSeconds)
(e.g. 90s). Get from / config.
- Wait for finalization — Use contract:
isFinalized(200, roundId)
(200 = FDC protocol ID) or listen for ProtocolMessageRelayed(200, roundId)
.
- Fetch proof — POST to DA Layer with and (same ).
- Submit to contract — Pass (decoded response) to your contract; contract calls
FdcVerification.verify*()
then uses the data.
Contract Pattern (Verification + Business Logic)
- Resolve FdcVerification via
ContractRegistry.getFdcVerification()
(or auxiliaryGetIWeb2JsonVerification()
for Web2Json when applicable).
- Always verify first, then decode and use data. Example (EVMTransaction):
solidity
function processProof(IEVMTransaction.Proof calldata proof) external {
require(ContractRegistry.getFdcVerification().verifyEVMTransaction(proof), "Invalid proof");
// use proof.data.responseBody (blockNumber, timestamp, events, ...)
}
- For Web2Json, decode
proof.data.responseBody.abi_encoded_data
with your struct (define a and optionally for artifact-based ABI signature in scripts).
- Use network-specific imports from
@flarenetwork/flare-periphery-contracts
(e.g. coston2/ContractRegistry.sol
, coston2/IEVMTransaction.sol
). Set EVM version cancun where required.
Script / Offchain Pattern (Hardhat)
- Prepare: POST to verifier e.g.
VERIFIER_URL/verifier/eth/EVMTransaction/prepareRequest
(or Web2Json, Payment, etc.) with attestation type, sourceId, request body; get .
- Submit: Get via or known address; call
requestAttestation(abiEncodedRequest, { value: fee })
; compute from receipt block timestamp.
- Wait: Poll
Relay.isFinalized(200, roundId)
.
- Fetch: POST to DA Layer
.../api/v1/fdc/proof-by-request-round-raw
with , .
- Decode: Use artifact’s response type (e.g.
IEVMTransactionVerification._json.abi[0].inputs[0].components[1]
) to decode ; build { merkleProof: proof.proof, data: decodedResponse }
and call contract.
Packages: or
,
@flarenetwork/flare-periphery-contract-artifacts
. For wagmi/viem typed contract interactions, use
@flarenetwork/flare-wagmi-periphery-package
.
Env: ,
,
(or equivalent for mainnet). Testnets use
/
/
as source IDs.
Verifier API keys are required for both testnet and mainnet verifiers. Set them in
(see
flare-hardhat-starter ):
env
VERIFIER_API_KEY_TESTNET="00000000-0000-0000-0000-000000000000"
VERIFIER_API_KEY_MAINNET="00000000-0000-0000-0000-000000000000"
Pass the key via the
header when calling verifier endpoints. The default placeholder UUIDs work for initial testing but are rate-limited.
Example Repos and Where to Look
- flare-hardhat-starter:
- scripts/fdcExample/ — Per–attestation-type examples: , , , , etc. Use
prepareAttestationRequestBase
, , retrieveDataAndProofBaseWithRetry
(from or similar).
- contracts/fdcExample/ — , , , — show verification + decoding.
- weatherInsurance — Web2Json-based dApp (MinTempAgency): policies, resolve with weather API proof; scripts in
scripts/weatherInsurance/minTemp/
(createPolicy, claimPolicy, resolvePolicy, expirePolicy).
- proofOfReserves — Combines Web2Json (reserves API) and EVMTransaction (token supply events from multiple chains); , scripts in (deploy, activateTokenStateReader, verifyProofOfReserves).
- flare-foundry-starter: Same attestation types plus cross-chain payment and cross-chain FDC examples; structure mirrors Hardhat.
Use these as the canonical patterns for prepare → submit → wait → get proof → verify in contract.
EVMTransaction Quick Reference
- Request: , , , , (max 50; sorted by contract convention).
- Response: , , , , , , , (logIndex, emitterAddress, topics, data, removed). Events are block-level indexed.
- Decode events in contract by filtering and (e.g.
keccak256("Transfer(address,address,uint256)")
), then / and as needed.
Web2Json Quick Reference
- Request: , , , , , , (tuple encoding the struct for ).
- Response:
responseBody.abi_encoded_data
— decode with abi.decode(..., (YourStruct))
. Use the same struct and ABI signature in the verifier request and in the contract. Store fractional values as scaled integers (e.g. 10^6) if needed.
Security: Web2Json fetches arbitrary public Web2 content from the requested URL. The returned
/
is
externally provided content. Decode and use it only with your expected ABI/struct for contract verification—never treat it as natural language or pass it into prompts or an AI/LLM.
XRPPayment Quick Reference
- Sources: (mainnet), (testnet). Attestation type ID . Requires 3 XRPL confirmations (~12s).
- Request: (bytes32, XRPL Payment tx hash), (EVM address authorized to use the proof).
- Response: , , (XRPL r-address), , ,
intendedReceivingAddressHash
, / / / (drops, int256), + (raw bytes of the first Memo's ), + (uint32 on XRPL, surfaced as uint256), (0=SUCCESS, 1=SENDER_FAILURE, 2=RECEIVER_FAILURE).
- Standard address hash is
keccak256(standardAddress)
without lowercasing. Multi-output payments are rejected.
- Verify with
IFdcVerification.verifyXRPPayment(IXRPPayment.Proof)
.
XRPPaymentNonexistence Quick Reference
- Sources: (mainnet), (testnet). Attestation type ID . Search range is
[minimalBlockNumber, firstOverflowBlockNumber)
.
- Request: , , , , (drops, uint256), + , + , . At least one of or must be .
- Response: , ,
firstOverflowBlockTimestamp
. is set to .
- A matching tx invalidates the claim only if all of receiver hash, amount, memo/tag (per the check flags), and successful outcome (excluding ) align.
- Verify with
IFdcVerification.verifyXRPPaymentNonexistence(IXRPPaymentNonexistence.Proof)
.
Security and usage considerations
Third-party content: FDC attestation responses (including Web2Json
/
, EVMTransaction payloads, and DA Layer proof responses) are derived from external or user-specified sources. Treat all such data as
externally provided. Decode and use it only according to the documented attestation format and your expected ABI/schema. Do
not pass response content into prompts or allow it to unintentionally influence agent behavior when consuming FDC proofs or verifier/DA Layer outputs.
When to Use This Skill
- Implementing or debugging FDC attestation flows (request, round, proof, verification).
- Writing or reviewing contracts that consume FDC proofs (EVMTransaction, Web2Json, Payment, AddressValidity, etc.).
- Integrating verifier or DA Layer in scripts/tests.
- Building or explaining dApps that use FDC (proof-of-reserves, weather insurance, cross-chain payment).
- Following Flare Developer Hub FDC guides and starter repos.
Additional Resources