ipfs / kubo

An IPFS implementation in Go
https://docs.ipfs.tech/how-to/command-line-quick-start/
Other
16.02k stars 3k forks source link

Plugin system for IPRS validity schemes #4544

Open mildred opened 6 years ago

mildred commented 6 years ago

TL;DR: I suppose we'll need to have a plugin system integrated with IPRS so we can have different validity schemes.

IPRS is based on the fact that you can choose different validity schemes and naming systems for your needs. There are some basic types you probably want everywhere (ordering based on time, sequence number or previous record hash) but it's entirely possible to imagine records that are more specific to an application.

Just like a blockchain where each other day there is a new blockchain appearing with slightly different rules about how blocks are being made, records could go the same route (except that for IPRS we don't keep history). A simple example: a microblogging application (twitter like) where a record points to a feed of events. A new record would be considered valid if the pointed IPFS object follows a specific format, 144 chars no more, and references all the previous items of the feed so history can be reconstructed.

This is highly application-specific and hat's why I was imagining a plugin system (and there is probably a gotcha: nodes storing the record in the DHT may not have the required plugin to check its validity)

whyrusleeping commented 6 years ago

I like this idea! You could probably implement consensus rules in a plugin like this, and end up with a proper blockchain.

(and there is probably a gotcha: nodes storing the record in the DHT may not have the required plugin to check its validity)

Yeah, this is the main issue. It could work in a private swarm where all nodes involved are running the same plugins though, which is definitely a useful thing.

Farther in the future, we want to do interesting things like shipping plugins as content addressed portable code. But thats another topic entirely :)

mildred commented 6 years ago

(and there is probably a gotcha: nodes storing the record in the DHT may not have the required plugin to check its validity)

Possibly, the DHT could be used to store the IPFS paths of the records. The DHT peers don't need to know the validity schemes then. Only the peers that access the records on IPFS will need to understand the validity scheme.

Farther in the future, we want to do interesting things like shipping plugins as content addressed portable code. But thats another topic entirely :)

If you enable plugins without trusting them, it's going to be a huge security risk, especially since the last hardware vulnerabilities found

whyrusleeping commented 6 years ago

Yeah... thats definitely going to be tricky. But you can get around those issues by providing a very restricted language (kinda like bitcoin script), and only running signed hashes. But thats wayyyyy down the road. For now, we just need to get IPRS development the attention it deserves