LogoLogo
Goldfinch V1 Documentation
Goldfinch V1 Documentation
  • Introduction
  • Goldfinch Overview
  • Protocol Mechanics
    • Glossary of key terms
    • Borrowers
    • Auditors
    • Backers
    • Liquidity Providers
    • Leverage Model
    • Membership
    • Investor Incentives
      • Backer Incentives
      • Senior Pool Liquidity Mining
    • Unique Entity Check
    • Discussion of Fraud Resistance
    • Staking
    • GFI Token
    • Liquidity & LP Withdrawals
    • Default Process
  • Governance
  • Tokenomics
    • Token Launch FAQ
  • Unique Identity (UID)
    • For Users
    • For Developers
    • Unique ID FAQ
  • Borrower Communication
  • Investor How-To
    • Getting Started on Goldfinch
    • Verifying Your Identity
    • Participating in Callable Deals
    • Participating in the Senior Pool
    • Participating in Borrower Pools
    • Participating in Liquidity Mining
    • Claiming GFI Distributions
    • Accessing Borrower Communication Channels
    • Purchasing coverage with Nexus Mutual
  • Borrower Mechanics
    • Raising Capital through Goldfinch
    • Goldfinch's Capital Providers
      • Sample Backer Economics
    • Goldfinch's Borrowers
      • Template Borrower Deal Structures
      • Borrower Case Study
    • Structure and Legal Considerations
      • Cash in and out of Goldfinch
        • Recommended Service Providers
      • Investor KYC / AML Requirements
      • Key Mechanics to Consider
        • Debt Facility Mechanics
        • Transaction Documentation
      • Borrower Senior Pool Participation
      • Backer Transferability
  • Borrower How-To
    • Launching a Borrower Pool on Goldfinch
      • Stage 0: Preliminary Actions and Decisions
      • Stage 1: Deal Structure and Timelines
      • Stage 2: Dataroom Preparation
      • Stage 3: Announcements and Tooling Set Up
      • Stage 4: Borrower Closing
  • General FAQ
  • 🔗Important links
    • Governance Portal
    • Developer Docs
    • Protocol Data Dashboard
    • Borrower Impact Data
    • November 2021 Audit
    • Immunefi Bug Bounty
    • Github
  • 🔗Connect
    • Discord
    • Twitter
    • Medium
    • Weekly Updates
    • Backer Launch Updates
    • Telegram
    • Youtube
Powered by GitBook
On this page
  • Integrating UID in your smart contracts
  • Integrating UID in your dApp
  • Getting new users verified
  • How It Works
  • Security and Privacy
  • Need to get in touch?

Was this helpful?

Edit on Git
Export as PDF
  1. Unique Identity (UID)

For Developers

This page provides technical guidance on how UID works, and how to integrate it with your protocol or dApp.

PreviousFor UsersNextUnique ID FAQ

Last updated 2 years ago

Was this helpful?

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 [email protected]. We'd love to hear from you!

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

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

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. Submit completed KYC to the Trusted Signer, which returns a signed message to the user.

  2. User mints their UID by presenting the signed message to the UID contract.

Security and Privacy

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 [email protected]

If your users don't already have a UID, you can send them to our front-ends to be verified at .

User completes KYC flow (on , via our partner ).

All personal data is processed and handled through . Persona has industry leading . No personal information is stored on-chain.

here
app.goldfinch.finance/verify
app.goldfinch.finance/verify
Persona
Persona
security and privacy practices