-
Notifications
You must be signed in to change notification settings - Fork 308
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
Open Grant Proposal: Rough Opal
#1031
Comments
Hi @realChainLife shall we discuss this together? |
Hi @tabcat, thank you for your proposal. This grant has been approved! We will be in touch by email to discuss next steps. |
Hello Open Grant team 👋 I wrote a report a few months ago when the grant was set to end. Have been working with @autonome since then and we have agreed on some changes to the roadmap. Those changes include removing:
I still plan to work on most of these, or equivalents, after the grant is closed. But the grant is overdue, and I want to work on adjacent things for a bit, so we've set key items to deliver:
I've recently added a section to the report named Have also completed a draft article to be posted on the IPFS blog I am pretty stoked about. It wasn't in the roadmap but it is a result of the work from this grant and includes a pretty cool example using helia and the javascript DHT. Also welo now supports helia! |
Hi @tabcat, thank you for the update! |
Everything is completed now except for tabcat/rough-opal#1 due to running into issues using the DHT from the browser. Will find out what I need to fix or what might be blocking this. |
The article I mentioned earlier in the thread was published in the ipfs blog: |
There has been another minor change which @autonome has just OK'd. This one is caused by the current state of the dht (which will get better over time): not a high enough percentage of nodes have webtransport enabled (required for dht servers to be dialed from the browser) to allow the todomvc demo to be deployed publicly. The todomvc demo will be working with a test environment instead of deployed to the public. (~1 week) This is the last thing that needs to be completed as part of the grant. When the network catches up over time, the todomvc can be deployed and an article can be written. but this will be after the grant has been paid. |
Hi @tabcat, thank you for the update and congrats on progress. Looking forward to the demo! |
Just sent in the final invoice. Wish I could have completed this all a bit faster but very happy with where I am at now and how everything worked out. Demo video of welo and zzzync uploaded to the todomvc readme. Thanks for all the help @ErinOCon @autonome and the rest of the grant team! |
Thank you for the update, @tabcat! |
Open Grant Proposal:
Rough Opal
Name of Project: Opal
Proposal Category:
devtools-libraries
Proposer: @tabcat
(Optional) Technical Sponsor: Dietrich Ayala, @autonome
Do you agree to open source all work you do on behalf of this RFP and dual-license under MIT, APACHE3, or GPL licenses?:
Yes
Project Description
Opal
is a peer-to-peer, local-first database. Its focus will be on providing web applications with dynamic and collaborative states. The core technologies used are:The project is written in typescript and compiled into javascript. It will be robust, maintainable, and easy for developers to use.
This project continues work done under a grant for OrbitDB they did not accept.
Opal is not a fork of OrbitDB; it is a complete rewrite focused on efficiently representing arbitrary states. Opal will not be interoperable with OrbitDB.
Merkle-CRDTs are still at the heart of the project.
This data-structure is a combination of Merkle-DAGs and CRDTs.
It provides causal order and de-duplication of operations, and it ensures strong eventual consistency.
The project will provide these two abilities as part of this grant:
Developers will be able to model custom states, similar to using Redux reducers.
They can supply a way to reduce and read a state.
These states are computed by reading the replica's causal log of operations.
This log can be appended online or offline and then merged/synced at a later point.
Developers will be able to pin user replicas to reliable storage backends.
Each device can pin its replicas as CAR files and update its IPNS record.
These allow peers to replicate with nodes that have gone offline.
Data persistence has been an issue for peer-to-peer databases. Persistent replication is a big step forward.
These two abilities make it possible to create compelling, edge-computed apps.
Value
The pattern described previously combines Merkle-CRDTs with reliable hosting of the CRDT replicas.
It centers around edge computers processing and updating data. More general machines keep the data available.
Applications this pattern is best-suited fall into media or communication, like most of Google's app suite.
Building software this way has unique characteristics and goes hand in hand with delay-tolerant network designs like IPFS.
The user has control over their data with the choice to self-host.
The local replica is the source of truth, referred to as local-first.
With Opal, developers can define the state reducer for a database.
A state reducer processes the log into a readable state.
Collaborative UI components can use Opal to derive their state.
This collaboration can be between users and a user's devices.
A big issue with peer-to-peer databases like OrbitDB is that if no other devices are online, you can't replicate anything!
Persistent replication is needed, and there are two ways to do it.
The first is continuing the pinning service idea, where you have Opal instances to keep online with a pin-list of databases to replicate.
These servers run replication algorithms that work over pubsub and IPFS.
If those pinners are online, then the data is available and can be replicated.
This solution is not terrible as it has some benefits, but it's better described as 'persisted replication' since pubsub messages are not persistent.
The second solution for persistent replication has to do with swapping pubsub for IPNS.
Instead of a node advertising the latest known heads over pubsub, IPNS becomes used in place. Then the IPNS records and IPFS data are pinned.
Another advantage is that IPFS and IPNS are more general layers and don't require building specialized infrastructure and support.
Keeping Merkle-CRDT replicas available allows applications to retain functionality when peers are not online.
Because the work done for OrbitDB under a previous grant was not accepted, doing this with OrbitDB would be very difficult due to some tight coupling.
Opal is much more modular when compared, especially with replication.
Opal also includes incremental traversal of the Merkle-DAG in either direction.
This type of traversal is not part of OrbitDB and is the most significant change from that previous grant work.
Incremental traversal allows for database entries to be kept out of memory and streamed when needed by traversing a graph of CIDs.
The most challenging part of this grant will be building persistent replication. It involves uploading the replica to pinning services as it's updated. It's new and will use CAR files and involve updating IPNS records.
Deliverables
Opal
andZzzync
are the deliverables.Opal
is the Merkle-CRDT collaborative states piece, andZzzync
will be a replicator module for persistent replication.The features to be delivered for each are in the following issues:
Opal
Base Feature SetZzzync
Development PlansOpal-Spec
1.0-betaThere will also be a monthly status issue in the Opal repo. The monthly issues will track what is being worked on and completed. Here is September's Status.
Deliverables will also be tracked in tabcat/rough-opal's README; a repo made for this grant.
Development Roadmap
(SEPT 2022) Opal Repo Init
(OCT 2022) Opal Replication and Perf
(NOV 2022) Zzzync Replicator
(DEC 2022) Release
Total Budget Requested
1 Full-time Engineer over 4 months at 45$/hr
Payments preferred monthly in Filecoin
Maintenance and Upgrade Plans
This grant will build a foundation that will define the base features and keep the project hyper-maintainable over the years.
After the project reaches this level of maintainability, the key is cultivating a user base.
Acquiring users will require exposure while providing documentation, a helpful community chat, and a valuable tool with great developer experience.
Following release there will still be room for improvement:
Nearer future (~2.0):
Further future (~3.0):
Directed Acyclic Graphs.
drand
to provide a universal causality. seems useful for some applications?Team
Team Members
Daniel, @tabcat
Team Website
https://github.com/cypsela
Relevant Experience
Daniel was involved with OrbitDB since finding it in late 2018, shortly after diving into IPFS.
Team code repositories
Daniel:
Additional Information
How did you learn about the Open Grants Program?
from previously working on an open source grant from protocol labs for orbitdb
Please provide the best email address for discussing the grant agreement and general next steps.
tabcat00@proton.me
For now,
Opal
is a temporary/code name until I find something better. (which may be never)Always open to hearing naming ideas! 😁
The text was updated successfully, but these errors were encountered: