Skip to content

Commit bc95846

Browse files
Add README.md
1 parent 9ecb96a commit bc95846

File tree

1 file changed

+73
-1
lines changed

1 file changed

+73
-1
lines changed

README.md

Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
1-
# plurality-interests-subgraph
1+
2+
3+
| Note: This repository is a submodule to our main Hackathon submission repository. The code and demo urls of the plurality onboarding dApp that integrates this subgraph can be found in the parent repository [Plurality ETH Online Hackathon Repository](https://github.com/Web3-Plurality/plurality-eth-online) |
4+
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
5+
6+
7+
# Plurality Interests Subgraph
8+
9+
Plurality is a web3 onboarding protocol that enables social media users and content creators to onboard to blockchain-based web3 social networks by linking, verifying, and aggregating their existing social reputation and interests.
10+
11+
## How does Plurality work
12+
13+
Plurality aggregates users' real-world reputation and interests from their web2 social profiles and links them to their wallet addresses via zero-knowledge proofs to preserve user privacy. This anonymized reputation and interest data a.k.a. user's **Social Capital** is stored in arweave and mapped to collision-resistant decentralized identifiers generated in the user's MetaMask wallet. If a user wants he/she can allow certain dApps to access part of the social capital by generating the required zero-knowledge proof.
14+
15+
## Role of The Graph in Plurality
16+
17+
We use The Graph to index and provide the user's aggregated data by indexing the user's off-chain social capital. For this purpose, we have written this subgraph that consolidates the plurality smart contract and user's interest data in arweave. We have used state-of-the-art Arweave integration as an external off-chain data source.
18+
19+
This subgraph would provide the much-needed decentralization in plurality's architecture and would help easy integration with external (web2 and web3) applications while keeping the user's privacy and sovereignty over his/her social capital. It would also enable a plethora of use cases such as social reputation passports, decentralized job platforms, gig marketplaces, e-commerce platforms, interests-based advertisement platforms, etc. It also serves as a core data availability layer in plurality protocol which considers The Graph as its data layer and builds social profiles on top.
20+
21+
## Features
22+
23+
- **Index Plurality Smart Contract Data:** Indexes Plurality Protocol smart contract data for efficient retrieval.
24+
- **Aggregate and Index Web2 Social Data:** Indexes users' real-world reputation and interests from their web2 social profiles stored off-chain in Arweave linked by Plurality and ZKPs
25+
- **Real-Time Updates:** User can add or remove their data and allow certain apps access by generating zkps.
26+
- **Custom Queries:** Allows developers to craft tailored queries to meet specific application needs.
27+
- **Enhanced User Experience:** Empowers developers to create responsive and user-friendly apps using this data. This data can be consumed by both web2 and web3 apps by using The Graph API.
28+
29+
## Use Cases
30+
31+
1. **Interests:** Retrieve anonymized interests and reputation of all users that have linked their social capital with the plurality
32+
2. **Interests against decentralized identifier:** Retrieve anonymized interests and reputation of a particular user against their decentralized identifier that could be linked by the user by generating zero-knowledge proofs.
33+
3. **Analytics and Reporting:** Utilize user interests and reputation data for valuable insights and enable the next billion use cases of web3.
34+
35+
---
36+
37+
## Demo
38+
39+
1. The Subgraph is currently deployed on the graph studio and could not be published to The Graph Testnet because the associated smart contract is on Ethereum Sepolia. The screenshorts from the graph studio are attached below.
40+
41+
42+
Here are some example curl query commands from the subgraph studio using it's API
43+
- To query user's interests metadata (first N results)
44+
```
45+
curl --header 'content-type: application/json' --url 'https://api.studio.thegraph.com/query/43869/plurality-social-interests/version/latest' --data '{"query":"{interestsMetaDatas(first: 5) {id commitment interests}}"}'
46+
```
47+
- To query user's interests metadata (against a decentralized id commitment)
48+
```
49+
curl --header 'content-type: application/json' --url 'https://api.studio.thegraph.com/query/43869/plurality-social-interests/version/latest' --data '{"query":"{interestsMetaDatas(where:{commitment:\"21297926345342893482618925740202550643146613557347510477263423286932144896019\"}) {id commitment interests}}"}'
50+
```
51+
- To query interests against multiple id commitments
52+
```
53+
curl --header 'Content-Type: application/json' --url 'https://api.studio.thegraph.com/query/43869/plurality-social-interests/version/latest' --data '{
54+
"query": "{interestsMetaDatas(where:{commitment_in:[\"21297926345342893482618925740202550643146613557347510477263423286932144896019\",\"12531765124198704714097650669808257753514349600949208348904055652637483504656\"]}){id commitment interests}}"}'
55+
```
56+
2. Our original submission to ETH Online is Plurality Onboaring dApp where this subgraph is utilized to load user profile after linking the anonymized data. The subgraph integration is part of the main demo and this repository is a submodule. The code and video of the plurality onboarding dApp can be found in the parent repository [Plurality Hackathon](https://github.com/Web3-Plurality/plurality-hackathon).
57+
58+
59+
---
60+
## Subgraph Studio details
61+
**Deployment ID:** `QmRbc3wMA2KkJiAd16zNDbMDK9yZhVfZefhC5FN6mKxUn9`
62+
63+
**Development Query URL:**
64+
https://thegraph.com/studio/subgraph/plurality-social-interests/
65+
66+
**Indexed Network:** Sepolia
67+
68+
**Plurality Interests CONTRACT ADDRESS:** `0xEEA22585F28aed481612E36080fcE6CE6c8520b6`
69+
70+
---
71+
![image](https://github.com/Web3-Plurality/plurality-interests-subgraph/assets/8026367/7b0c8bea-c286-46c6-82a6-e605a36835e7)
72+
![image](https://github.com/Web3-Plurality/plurality-interests-subgraph/assets/8026367/95ecf3f5-a0e6-4c48-b4ca-a93e18a1cb54)
73+
![image](https://github.com/Web3-Plurality/plurality-interests-subgraph/assets/8026367/2947251b-6a1b-48b4-82a7-a6ab68ac1985)

0 commit comments

Comments
 (0)