# IFdcVerification

> Interface for verifying FDC requests.

> For the complete documentation index, see [llms.txt](/llms.txt). Markdown versions of documentation pages are available by appending `.md` to the page URL.

Source: https://dev.flare.network/fdc/reference/IFdcVerification

Interface for verifying Flare Data Connector (FDC) attestation requests.

Sourced from `IFdcVerification.sol` on [GitHub](https://github.com/flare-foundation/flare-smart-contracts-v2/blob/main/contracts/userInterfaces/IFdcVerification.sol).

## Overview[​](#overview "Direct link to Overview")

The IFdcVerification interface provides methods to verify different types of attestations from the Flare Data Connector. Smart contracts can use these verification functions to validate proofs provided by the FDC, ensuring the authenticity and integrity of the external data being used.

## Verification Functions[​](#verification-functions "Direct link to Verification Functions")

Each verification function takes a proof structure specific to the attestation type and returns a boolean indicating whether the proof is valid.

### verifyAddressValidity[​](#verifyaddressvalidity "Direct link to verifyAddressValidity")

Verifies a proof for an address validity attestation.

```
function verifyAddressValidity(    struct IAddressValidity.Proof _proof) external view returns (    bool _proved);
```

**Parameters**

-   `_proof`: The address validity proof structure containing the merkle proof and response data

**Returns**

-   `_proved`: Boolean indicating if the proof is valid

### verifyBalanceDecreasingTransaction[​](#verifybalancedecreasingtransaction "Direct link to verifyBalanceDecreasingTransaction")

Verifies a proof for a balance decreasing transaction attestation.

```
function verifyBalanceDecreasingTransaction(    struct IBalanceDecreasingTransaction.Proof _proof) external view returns (    bool _proved);
```

**Parameters**

-   `_proof`: The balance decreasing transaction proof structure

**Returns**

-   `_proved`: Boolean indicating if the proof is valid

### verifyConfirmedBlockHeightExists[​](#verifyconfirmedblockheightexists "Direct link to verifyConfirmedBlockHeightExists")

Verifies a proof that a specified block height exists and is confirmed.

```
function verifyConfirmedBlockHeightExists(    struct IConfirmedBlockHeightExists.Proof _proof) external view returns (    bool _proved);
```

**Parameters**

-   `_proof`: The confirmed block height existence proof structure

**Returns**

-   `_proved`: Boolean indicating if the proof is valid

### verifyEVMTransaction[​](#verifyevmtransaction "Direct link to verifyEVMTransaction")

Verifies a proof for an Ethereum Virtual Machine transaction.

```
function verifyEVMTransaction(    struct IEVMTransaction.Proof _proof) external view returns (    bool _proved);
```

**Parameters**

-   `_proof`: The EVM transaction proof structure

**Returns**

-   `_proved`: Boolean indicating if the proof is valid

### verifyPayment[​](#verifypayment "Direct link to verifyPayment")

Verifies a proof for a payment transaction.

```
function verifyPayment(    struct IPayment.Proof _proof) external view returns (    bool _proved);
```

**Parameters**

-   `_proof`: The payment proof structure

**Returns**

-   `_proved`: Boolean indicating if the proof is valid

### verifyReferencedPaymentNonexistence[​](#verifyreferencedpaymentnonexistence "Direct link to verifyReferencedPaymentNonexistence")

Verifies a proof that a specific payment with reference did not occur within a given timeframe.

```
function verifyReferencedPaymentNonexistence(    struct IReferencedPaymentNonexistence.Proof _proof) external view returns (    bool _proved);
```

**Parameters**

-   `_proof`: The referenced payment nonexistence proof structure

**Returns**

-   `_proved`: Boolean indicating if the proof is valid

### verifyWeb2Json[​](#verifyweb2json "Direct link to verifyWeb2Json")

Verifies a proof for a Web2Json attestation (FDC-fetched HTTP response post-processed through JQ).

```
function verifyWeb2Json(    struct IWeb2Json.Proof _proof) external view returns (    bool _proved);
```

**Parameters**

-   `_proof`: The Web2Json proof structure

**Returns**

-   `_proved`: Boolean indicating if the proof is valid

## Metadata accessors[​](#metadata-accessors "Direct link to Metadata accessors")

### fdcProtocolId[​](#fdcprotocolid "Direct link to fdcProtocolId")

Returns the FDC protocol id used as the `protocolId` argument when querying `IRelay.isFinalized(protocolId, votingRoundId)`. Read this at runtime instead of hard-coding a literal — the value can change between network releases.

```
function fdcProtocolId() external view returns (uint8 _fdcProtocolId);
```

### relay[​](#relay "Direct link to relay")

Returns the `IRelay` contract address bound to this `IFdcVerification` deployment.

```
function relay() external view returns (IRelay);
```

## Usage Example[​](#usage-example "Direct link to Usage Example")

AddressSolidity.sol

```
// SPDX-License-Identifier: MITpragma solidity ^0.8.25;import {ContractRegistry} from "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol";import {IFdcVerification} from "@flarenetwork/flare-periphery-contracts/coston2/IFdcVerification.sol";import {IAddressValidity} from "@flarenetwork/flare-periphery-contracts/coston2/IAddressValidity.sol";interface IAddressRegistry {    function registerAddress(        IAddressValidity.Proof memory _transaction    ) external;}contract AddressRegistry is IAddressRegistry {    string[] public verifiedAddresses;    function registerAddress(        IAddressValidity.Proof memory _transaction    ) public {        // 1. FDC Logic        // Check that this AddressValidity has indeed been confirmed by the FDC        require(            isAddressValidityProofValid(_transaction),            "Invalid transaction proof"        );        // 2. Business logic        string memory provedAddress = _transaction.data.requestBody.addressStr;        verifiedAddresses.push(provedAddress);    }    function isAddressValidityProofValid(        IAddressValidity.Proof memory transaction    ) public view returns (bool) {        // Use the library to get the verifier contract and verify that this transaction was proved by the FDC        IFdcVerification fdc = ContractRegistry.getFdcVerification();        return fdc.verifyAddressValidity(transaction);    }}
```

[Open example in Remix](https://remix.ethereum.org/#url=https://github.com/flare-foundation/developer-hub/blob/main/examples/developer-hub-solidity/AddressSolidity.sol&version=builtin&evmVersion=cancun&optimize=true&runs=200)
