RFC: Create the GitHub for collaborating on contracts

RFC Title: Create the GitHub for collaborating on contracts
Author: phrea
Created: 2021-11-28

Brief Overview of Proposal:
Web3 communities need to discuss contract code like teams do on GitHub.

This is often done to find bugs/holes/exploits before an official launch.

We need to comment on lines of code in a way that’s similar to GitHub. But code on GitHub may not be the code deployed to the blockchain.

This RFC is for a product that displays deployed, verified contract code in a way that’s similar to GitHub, with collaboration features such as commenting, and requesting changes.

Goals and Scope:

  1. Product reads deployed code from a blockchain (e.g. ETH mainnet or Rinkeby)
  2. Product displays code with code formatting and line numbers (similar to GitHub)
  3. Product allows for users to comment on code using their wallet
  4. Produce should display comments to users (and allow comments to be hidden for readability)

Background & Motivation:
On a few NFT projects, I have collaborated with other members of the community to audit the code and do a code review to find potential bugs or exploits that could undermine the project.

These code reviews were only done in Discord, and it was immensely hard to track (and must be done synchronously), which is not conducive to a productive code review.

Getting the code into a comment-able system like GitHub requires a lot of steps from the code owner, or copy/pasting code from Etherscan.

Then, if the code is on GitHub, there’s no assurances that this same code is also the code that is deployed, without manually checking the code to ensure consistency.

This project would greatly advance the web3 ethos of collaboratively working together to create projects that communities love.

Design:
I believe this project can be completed with a front end in React or Vue, and a web2 backend to store comments data to start.

It’s a straightforward backend of simply storing comments to a line number.

Timeline:
Ideally by end of Q1 2022

Risks:
That no one will use it (which I don’t think is an issue)

Resources:

  1. Front end design for displaying the code in a readable format.
  2. Code formatting library
  3. Initial design to display code.
  4. A place to store comments (blockchain is probably overkill for v1). Likely a web2 infrastructure stack like a Rails/Sinatra/Django/Flask/Express.js API.
  5. A means of displaying the code in a readable and interactive way. Likely a good amount of custom front-end work.
  6. A means of reading verified contract data (e.g. Contracts - Etherscan)
5 Likes

I like the idea and think this would be really useful and fun to build. For the code formatting library a good option I’ve seen used is GrapesJS.

Also I don’t think we should store things in one location just to change it later. If we’re going to eventually want to store comments on the blockchain then I think we should start building that out in the first iteration to avoid major reworks in the future.

Thanks for the suggestion. This looks like a website builder though, not a code formatting library. Is this the right link, or am I missing something?

I am not sure that we would want the comments on the blockchain, though.

Ideally, comments would live on the blockchain, but even with most L2s and “cheap” L1s, commenting would carry a cost in that case, and I think that would reduce the utility of the app.

Because of that, commenting should be stored on a Web2 centralized DB, similar to how OpenSea stores descriptions of collections, web urls, etc. in a centralized DB.

This is a strong opinion, but it’s held loosely, so please let me know if you disagree.

2 Likes

hey. core team of www.radicle.xyz here. Nader and I are on the grants committee. would love to see an application for this to be built on the radicle network.

Let me know if interested. perhaps message me in discord and can try co-ordinate

https://snapshot.org/#/gov.radicle.eth/proposal/0xe9158c0e656918f207f76af0b05feefce2cf07c02e582944825373eebd4ddaff

3 Likes

Hey @nas ! I am not very familiar with Radicle (sorry, it’s so hard to keep up with all the new stuff that pops up every day!)

I don’t exactly know how Radicle fits in here. Would we basically build this web app and integrate it into Radicle in some way…?

Again, so sorry for my ignorance here.

No worries. yeah, the space moves fast.

We’ve been building p2p and web3 based developer tooling. Probably a few ways to approach it as the entire stack is open source. At its foundation it’s a p2p collaboration protocol built around the git protocol, so it can be used as a foundation to the experience. Alternatively, perhaps it can be built as a feature on top of our existing desktop or web clients.

Ran by the team and they said it’s something they’ve discussed and may make sense as something that would be grant funded. Feel free to jump into the discord and join the discussion on it in #product - Radicle

3 Likes

Oh yeah my bad its been awhile since I’ve looked at Grapes, seems like it has more than we need.

Storing the comments in a centralized DB like AWS would incur costs as well, which means we would need to get funding from the DAO Treasury to maintain it. I’m not against that but it would probably require a proposal and vote to be approved.

Or we could apply for the grant and use the funds for hosting the architecture :slight_smile:

1 Like

I am sure there’s an open source formatting library that we can use, once we dig into building the thing. :grinning_face_with_smiling_eyes:

I am not too concerned about the costs on a centralized DB. A centralized DB would cost under $100 for millions (maybe even billions) of rows in a PSQL database hosted on RDS or even Heroku.

It would be much faster to store the comment data on an RDS PSQL instance than on the blockchain, and would mitigate a risk of adoption, imo. Well worth it to even cover those costs out of pocket, or out of treasury funds imo.

The biggest risk is speed of implementation, so getting more contributors would be valuable. That’s where a grant or community contributions from D_D would help.

2 Likes

This is a great idea. I’ll join the community shortly :pray:

2 Likes

This would be a fraction of the cost per transaction as keeping every comment on-chain, and I imagine very few would use it to keep comments on chain. A cloud service provider like AWS would be orders of magnitude cheaper than storing on chain.

2 Likes

Want to voice support for the proposed collab w Radicle.xyz on this – its a decentralized Github doing awesome work to decentralize code production.

2 Likes