Comments & Rating Integration

Name of Project:

Comments & Ratings integration.

Proposal in one sentence:

Grants funds are requested for integrating comments & rating UI, stored over a decentralized storage, with ocean marketplace

Description of the project and what problem is it solving:

As the ocean marketplace grows the need for comments & ratings will be topmost not just to get better insights on the quality of data but to also motivate data publishers by rating systems. The comments & rating systems also help in gathering the engagement across the platform. Since, currently this particular section is missing from ocean-marketplace we propose an “integrable comments-and-rating UI with data stored on decentralized”.

Motivation & Solution:

As the new data-marketplaces come the integration of this particular section should be customisable & seamless. Since each market-place will have a different UI and will have different requirements from their comments & rating section such integration will make new customisation easy.

A DID specific comment-sections where all the comments & rating will be stored on decentralized storage and will be uniquely identified by the DID of the data-set. Since DID is unique for each-data set this storage will be helpful across multiple data-marketplaces.

All the comments which are posted will be written in a json-based file and this file will be stored on decentralized storage. It will be updated on each new comment/rating made for a data-set.

With the help of the embedded UI whenever the data-set page is loaded a js script will make a call to the comment service to fetch all the comments present on the storage and the same UI will render the comments on the page. Every new data-marketplace will just need to add the particular UI code in their front-end and their job will be done.

TokenEnomics (Extra feature):

As a reward for all the commenters & reviewers whenever Data consumer makes a purchase and rate the dataset has 5 stars or leave a positive comment. Data publishers can distribute a part of the payment equally to all the reviewer’s. This will encourage others to write comments, gather engagement around the data-set and ultimately to market-place. Similar reward can be initiated by the data-consumer also if we find that the review and comments were helpful for him to make the purchase of the right data-set. This will make the market competitive and lead to improvement in the quality of data.

How much reward will be distributed on the purchase can be configured within the DDO metadata. Since comment information will also hold the user-address the distribution can be with the help of comment-service.

Grant Deliverables:

  • Finalize Comments & UI integrations with data stored on decentralized
  • Deploy smart contract for comment-service

Which Project Category best describes your project?

  • Build / improve core Ocean software

Are you applying for an Earmark?

  • Yes, New Project

What is the final product?

In this round we will work on the development of comments & rating UI connected with decentralized storage and integrate with ocean platform. Our plan is the final product will allow users to make comments & loads past comments on a particular data-asset and algorithm.

How does this project add value to the ocean ecosystem?

This particular section on ocean ecosystems will provide better insights of the dataset and will increase engagement around the marketplace leading to more active users and added revenue for data-publisher’s. The chance of this project succeeding is high as proven in web2 several marketplaces have this particular section helpful for consumers to review the product before purchasing.

Funding Requested:

  • $2500

Proposal Wallet Address: 0xb497eFb5E7Ec026BdA26147952E12B795bfD71D4

Have you previously received an OceanDAO Grant?

  • NO

Email address: ravijoshi0996@gmail.com

Country of Residence: India

Part 2 - Team

  1. Ravi Joshi, Fellow
  1. Rishabh Shukla, Fellow
  1. Indian Ocean Team, Advisor

Part 3 - Proposal Details

Project Deliverables:

A pull request will be made on the ocean front-end https://github.com/oceanprotocol/market and Ocean
Data provider back-end https://github.com/oceanprotocol/provider . We commit to working with Ocean core developers to merge the PR, following software quality best practices.

Software Overview:

  1. The UI embedded for the comment section will have a script which will take the DID parameter and will call the comment service to load all the comments made for the data-set.

  2. The comments service will be a smart contract interacting with decentralized storage like Filecoin where comments are stored within a json-file.

  3. Whenever a comment is made or updated it will be written/updated in the same DID file.

  4. Comment structure that needs to be stored within a json file:

  5. Rating formula:

    X = Current Avg.rating,

    N => total users,

    Y => New User Rating

    New Rating = (X *N +Y)/(N+1)

  6. SMART CONTRACT:

    mapping(byte32=>HashofComments[]) Comment;,

    mapping(byte32=>uint8) Ratings;

  7. Comment data format in json

{
    User-public-address: "0x...",
    Comment: "****",
    Rating: number
}
  1. Smart contract will hold the hash of comments stored on decentralised storage.

Roadmap:

Any prior work completed thus far? Details?

  • We have researched and done POC on smart contract integration with IPFS data-storage. Rishabh Shukla has prior experience in this and is also working on another proposal for decentralised email.

What is the project roadmap?

Timeline of completion will be:

  • Smart-contract development and decentralised data-storage integration.
  • Front-end UI development and integration with backend.
  • Deployments, bug-fixes & beta-testing.

What are the team’s future plans and intentions?

We plan to request funding from OceanDAO to complete the development work for the month of February & March. After completion we will comeback for enhancing this feature and different proposal.

Additional Information

As per the feedback suggested by @trentmc0 we feel storing comments on decentralised storage is not helpful in longer run and have problems like pinning of data, so now we will be storing data on-chain within smart contract, it can be optimizied further by using calldata memory in functions.

So now the structure of our smart contract will be:

mapping(byte32=>Comments[]) Actual-Comment; [This is updated]

mapping(byte32=>uint8) Ratings;

The function that will be used to provide comments in response will be using calldata array to optimise the gas cost.

1 Like

how are you handling the enormous gas costs of your technical approach? Why do you commit comments on-chain any why write them into the state? E.g. having them in calldata would suffice. But what’s the benefit of on-chain comments?

Hi @Jo-ravar, I have registered your proposal for R14 and has been accepted, however your proposal does not yet qualify for:

  • Core Tech Earmark approval

I know Comments & Rating Integration has been as an earmark, but please make sure to review in the #core-tech discord channel so they can give you the thumbs up.

Otherwise, your proposal will still qualify for the General category.

I have responded to the proposal in there and it would likely be beneficial for you to have discussions with other core-tech members to improve your proposal and qualify for the earmark.

All the best!

We are going to store it in some decentralised storage instead of an on-chain.

Ah ok now that you changed the original post, I guess you’re right. But your first suggestion was to store it in a Solidity mapping, so I got curious.

1 Like

Hello everyone,

It’s really great to see the active discussion as part of the Core-Tech earmark. From a Core-tech WG perspective I appreciate the due diligence that has happened so far and I hope the team takes the insights in good stead and awaits response from the members at Core-Tech


From a Project Guiding Working group perspective, I appreciate the team’s response during the due diligence period and your careful intent to be responsive. After reviewing the proposal briefly, I commend the project in having a value add to ocean in terms of

  • Usage of Ocean & Viability- Intent to add value to Core-tech WG values & looking to continue working on the feedback
  • Community activeness - You’ve proven this by being responsive to the technical comments & I hope you continue to do the same.

Based on the reasons above, I am in support of your project and proposal. I look forward to continuing providing support and feedback to your project, and you can expect to receive a positive vote from me during the upcoming voting period.

Cheers

Prakash | Project Guiding WG | Discord

prk-sig-3

Want a cool Sigil like this for yourself? Join the PG-WG Discord

If you store “to” IPFS then one or more parties still have to pin the data. If no one pins it, the data goes away. Which hurts long term usability of this feature.

So I think having data on-chain makes sense.

Which chain? It could be (a) on a dedicated permanent storage (arweave), or (b) on the same EVM chain as the data asset. For reasons of complexity I advocate (b).

Gas costs are low for every chain but Eth mainnet; Ocean’s already on Polygon, BSC, Moonriver, and EWC. Eth mainnet is too expensive for most data use cases anyway, so we should expect other chains to get used more in V4 (or at least until Eth V2, if gas fees of Eth V2 go down). And if someone is willing to spend the gas to use Eth mainnet for other Ocean, then comments aren’t going to be much more expensive.

Finally, do use Tim’s trick to reduce gas fees by putting the comments into calldata (still goes on chain), rather than “official” chain state.

Summary: I recommend on-chain, because better for long-term user experience. Gas fees are fine for all but eth mainnet. Optimize further via storing comments in calldata.

4 Likes

Thanks for the feedback @trentmc0 @drprk

We agree that it will be helpful to store data on-chain in longer run. We have updated similar information under the “Additional Information section” in proposal. We will be updating the user interaction diagram and info in the proposal before starting.

Will be waiting for market team feedback for design and compliance related parts.

1 Like

For posterity:

The github issue for this work is: market #1073

Importantly, contracts #509 “Goal: single tx to create NFT & publish metadata” was implemented in early 2022 as part of Ocean V4. It provides the backend to cleanly support this issue. It leverages Ocean infra to have comments & ratings on-chain, leverage Aquarius for fast retrieval, while reconciling GDPR.