wslyvh / proof-of-competence

Proof of Competence (PoC) is an open, modular framework to create on-chain quests and Web3 on-boarding journeys.
https://www.poc.quest/
MIT License
72 stars 19 forks source link

Proof of Competence

Proof of Competence (PoC) is an open, modular framework to create on-chain quests and on-boarding journeys into Web3. It uses a pluggable task system which can verify that on-chain actions have occurred. This allows to build up reputation or social (DAO) scores that proof an address is familiar with the specified technologies or protocols.

This allows to:

Quests

Create a quest and define the tasks that are important for your project to help people become more familiar with the protocol.

Adding a quest

A quest is defined in the following format

{
    "name": "Title of the quest.",
    "description": "A clear and concise description of the quest.",
    "website": "https://website.org/",
    "twitter": "AccountHandle",
    "tasks": []
}

Want to submit your own quest to PoC? Feel free to submit a PR/issue.

Adding a task verifier

A tasks is defined in the following format

{
    "name": "Deploy",
    "description": "Deploy any kind of contract to mainnet.",
    "points": 100,
    "verifier": "deployed-contract",
    "chainId": 1
}

*chainId is optional and defaults to 1 (mainnet)

You can pass parameters to a verifier to further configure them.

{
    "name": "NFT Collector",
    "description": "Get points if you hold this NFT.",
    "points": 100,
    "verifier": "has-nft",
    "params": {
        "addresses": "0x25ed58c027921e14d86380ea2646e3a1b5c55a8b"]
    }
}

PoC API

The Proof of Competence scores can be integrated into other projects by using the API. There are 2 main endpoints to fetch the quest, as described above, or include the scores from a specific address.

Endpoints

Example body for Claim POST (also )

{
    account: '0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045'
}

Development

  1. Install all packages yarn install

  2. Create a .env file touch .env

  3. Add the below configuration to your .env file. You need to request API keys at Alchemy, Etherscan and Infura.

  4. Start your project yarn dev

  5. Open http://localhost:3000 in your browser.

Environment variables

Copy the following, incl valid API keys to your .env file.

NEXT_PUBLIC_ALCHEMY_API_KEY=''
NEXT_PUBLIC_INFURA_API_KEY=''
NEXT_PUBLIC_ETHERSCAN_API_KEY=''
NEXT_PUBLIC_POKT_API_KEY=''

License

MIT