# Identity Verifier

An identity verifier is a smart contract which can restrict the ability for a user to bid on or purchase an NFT. This is especially useful if you wish to perform KYC, or do allow list sales.

## IIdentityVerifier

An identity verifier **MUST** implement IIdentityVerifier

```solidity
interface IIdentityVerifier is IERC165 {

    /**
     *  @dev Verify that the buyer can purchase/bid
     *
     *  @param listingId      The listingId associated with this verification
     *  @param identity       The identity to verify
     *  @param tokenAddress   The tokenAddress associated with this verification
     *  @param tokenId        The tokenId associated with this verification
     *  @param requestCount   The number of items being requested to purchase/bid
     *  @param requestAmount  The amount being requested
     *  @param requestERC20   The erc20 token address of the amount (0x0 if ETH)
     *  @param data           Additional data needed to verify
     *
     */
    function verify(uint40 listingId, address identity, address tokenAddress, uint256 tokenId, uint24 requestCount, uint256 requestAmount, address requestERC20, bytes calldata data) external returns (bool);

}
```

The verify function is called before any bid or purchase by the Marketplace Contract, and the Marketplace Contract will reject the bid or purchase if the verify function returns false. &#x20;

The verify function **CAN** be a view or pure function.

## IIdentityVerifierCheck

An identity verifier **MAY** also implement IIdentityVerifierCheck if they need a separate view function to check wallet access in the UI prior to submitting a bid or purchase.

```solidity
/**
 * Implement this interface if you want to have a view function to check
 * whether or not an identity is verified to bid/purchase
 */
interface IIdentityVerifierCheck is IERC165 {

    /**
     *  @dev Check that a buyer is verified to purchase/bid
     *
     *  @param marketplaceAddress   The address of the marketplace
     *  @param listingId            The listingId associated with this verification
     *  @param identity             The identity to verify
     *  @param tokenAddress         The tokenAddress associated with this verification
     *  @param tokenId              The tokenId associated with this verification
     *  @param requestCount         The number of items being requested to purchase/bid
     *  @param requestAmount        The amount being requested
     *  @param requestERC20         The erc20 token address of the amount (0x0 if ETH)
     *  @param data                 Additional data needed to verify
     *
     */
    function checkVerify(address marketplaceAddress, uint40 listingId, address identity, address tokenAddress, uint256 tokenId, uint24 requestCount, uint256 requestAmount, address requestERC20, bytes calldata data) external view returns (bool);

}
```

## Integrating Identity Verification into the Marketplace Widget

Please see the `m-marketplace_tx_id_verify` and `m-marketplace_tx_id_complete` [window events documentation](/manifold-for-developers/resources/widgets/marketplace-widgets/window-events.md).


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.manifold.xyz/manifold-for-developers/smart-contracts/marketplace/identity-verifier.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
