# For Developers

{% hint style="warning" %}
UID should be considered alpha software. It is used by the Goldfinch network, and we would love to see other protocols utilize the tool, but Warbler Labs cannot guarantee support or maintenance at this time. Use UID at your own risk. If you have questions or feedback, please contact us at <uid@warblerlabs.com>. We'd love to hear from you!
{% endhint %}

### Integrating UID in your smart contracts

To integrate UID into your smart contracts, simply check the balance of your user's address to see if they possess the UID token. In Solidity, it would look like this:

```
# This is using OpenZeppelin's ERC1155 preset contracts:
# https://docs.openzeppelin.com/contracts/3.x/api/token/erc1155#IERC1155
import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

contract MyContract {
    address UID_CONTRACT = "0xba0439088dc1e75f58e0a7c107627942c15cbb41";
    uint256 public constant ID_VERSION_0 = 0;

    function hasUID(address userAddress) returns (bool) {
        uint256 balance = IERC1155(UID_CONTRACT).balanceOf(userAddress, ID_VERSION_0);
        return balance > 0
    }
}
```

**Note:** UID currently only operates on Ethereum mainnet. The contract itself can be found [here](https://etherscan.io/token/0xba0439088dc1e75f58e0a7c107627942c15cbb41#readProxyContract)

### Integrating UID in your dApp

For your front-ends, you can similarly integrate UID with the following

```
var Web3 = require('web3');
const web3 = new Web3(Web3.givenProvider);
const minimalAbi = [{"inputs": [{"internalType": "address", "name": "account", "type": "address"}, {"internalType": "uint256", "name": "id", "type": "uint256"}], "name": "balanceOf", "outputs": [{"internalType": "uint256","name": "","type": "uint256"}], "stateMutability": "view", "type": "function"}]
const uidAddress = "0xba0439088dc1e75F58e0A7C107627942C15cbb41"
const UID = new web3.eth.Contract(minimalAbi, uidAddress)

async function hasUID(userAddress) {
  const VERSION_0 = 0
  const balance = parseInt(await UID.methods.balanceOf(userAddress, VERSION_0).call())
  return balance > 0
}
```

### Getting new users verified

If your users don't already have a UID, you can send them to our front-ends to be verified at [app.goldfinch.finance/verify](https://app.goldfinch.finance/verify).

### **How It Works**

UID functions by having a trusted signer (currently Warbler Labs, the core development team for Goldfinch and creator of UID) verify that a given address has passed KYC via the third-party integration (currently Persona). Once verified, the user receives a signed message which they can present to the UID contract in order to mint their UID.

**So the user flow looks like this...**

1. User completes KYC flow (on [app.goldfinch.finance/verify](https://app.goldfinch.finance/verify), via our partner [Persona](https://withpersona.com/)).
2. Submit completed KYC to the Trusted Signer, which returns a signed message to the user.
3. User mints their UID by presenting the signed message to the UID contract.

### Security and Privacy

All personal data is processed and handled through [Persona](https://withpersona.com/). Persona has industry leading [security and privacy practices](https://withpersona.com/security). **No personal information is stored on-chain.**

### Need to get in touch?

Have questions about integrating? Do you have a certain use case, or feature you'd like to see? The community would love to hear from you. Reach out at **<uid@warblerlabs.com>**


---

# 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.goldfinch.finance/goldfinch/goldfinch-v1/unique-identity-uid/for-developers.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.
