Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounty: Use Programmatic Issuance to issue a Verifiable Credential via Disco API - USDC $400 #5

Open
ericc572 opened this issue May 23, 2023 · 6 comments

Comments

@ericc572
Copy link

ericc572 commented May 23, 2023

πŸ‘¨β€πŸ’» User Story

As a developer I want to issue a Disco credential via the Disco API, based on some event, or button-click.

πŸ’° Bounty Reward

The bounty reward is $400 USDC, 50 OP tokens and a TurboETH DevPass digital collectible.
Sponsored by Disco and District Labs.

🧱 Project

Using the Disco API, issue a credential to an ETH address using the following endpoint:
POST https://api.disco.xyz/v1/credential

List of schemas can be found here: http://github.com/discoxyz/disco-schemas

Example Ideas:

  • Issue a GM Credential from a button click, after wallet is connected
  • Issue a Contribution Credential after submitting a form/airtable, after wallet is connected.
  • Issue a DarkModePref for selecting Dark/Light mode in an app, after wallet is connected.
  • Issue a GM credential to any recipient using a form for the wallet address

Encourage all ideas and creativity! You can use something like web3.js, or the WAGMI frontend library to grab the address.

Example Javascript Request:

var myHeaders = new Headers();
myHeaders.append("Content-Type", "application/json");
myHeaders.append("Authorization", "Bearer <redacted>");

var raw = JSON.stringify({
  "schemaUrl": "https://raw.githubusercontent.com/discoxyz/disco-schemas/main/json/GMCredential/1-0-0.json",
  "subjectData": {},
  "recipientDID": "did:ethr:0xE6FF2d91f6EeEe8BDA4bCc562d63c431496FCf2A"
});

var requestOptions = {
  method: 'POST',
  headers: myHeaders,
  body: raw,
  redirect: 'follow'
};

fetch("http://api.disco.xyz/v1/credential/", requestOptions)
  .then(response => response.text())
  .then(result => console.log(result))
  .catch(error => console.log('error', error));

disco-access-controls

Potential File Structure

integrations/disco
β”œβ”€ actions/
β”‚  β”œβ”€ get-credentials-from-did.ts
β”‚  β”œβ”€ get-profile-from-address-simple.ts
β”‚  β”œβ”€ get-profile-from-address.ts
β”œβ”€ components/
β”‚  β”œβ”€ disco-profile-basic.tsx
β”‚  β”œβ”€ disco-profile-credentials.tsx
β”œβ”€ handlers/ NEW FOLDER
β”‚  β”œβ”€ use-verifiable-credentials-access-controls-route.ts
β”‚  β”œβ”€ use-verifiable-credentials-access-controls-page.ts
β”œβ”€ hooks/
β”‚  β”œβ”€ use-disco-get-credentials-from-did.ts
β”‚  β”œβ”€ use-disco-get-profile-from-address.ts
β”‚  β”œβ”€ use-disco-get-profile-from-did.ts
β”œβ”€ routes/
β”‚  β”œβ”€ route-credentials-from-did.ts
β”‚  β”œβ”€ route-disco-profile-from-address.ts
β”‚  β”œβ”€ route-disco-profile-from-did.ts
β”œβ”€ disco-client.ts
β”œβ”€ README.md

Notice

The final integration may not resemble the proposed integration - that's O.K - a natural part of software development.

During development you might discover an original hypothesis doesn't make sense. No problem. Make a comment and clearly explain why a new approach is better than old one. Get rewarded for thinking out of the box.

The final bounty reward can be increased to match new bounty tasks.

@visitskyworld
Copy link

Hi @ericc572 I am interested

@ericc572
Copy link
Author

@visitskyworld feel free to fork this repo, then tag this issue and send it to us in the #dev-lounge channel in Discord!

here's an invite: https://discord.gg/sRVntFGf

@SouravInsights
Copy link

Is anyone still working on this issue? @visitskyworld @ericc572

@visitskyworld
Copy link

The issue was already assigned I think @SouravInsights

@SouravInsights
Copy link

Assigned to you or somebody else?

@visitskyworld
Copy link

somebody else

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants