Replies: 1 comment
-
‘Smart contracts without the blockchain’ is an interesting concept which I first heard about here: https://clockwork-labs.medium.com/spacetimedb-and-bitcraft-bc957a7faf40 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I recently had an idea that I think has a lot of interesting potential, and I haven't seen anything like it anywhere before.
First, I want to compare Iroh to a blockchain. A blockchain works by making sure that everybody agrees on the same sequence of events that happened in an exact order, and produced the same exact result.
Iroh, on the other hand, is eventually consistent, so it's goal is to produce the same exact result, eventually once everybody gets the same messages.
In blockchains, smart contracts are a common feature. They allow you to customize the way that messages manipulate the blockchain state. This is something that I keep running into the need for with Iroh ( in my thought experiments ).
For example, permissions is one of the biggest motivations. I would like to be able to say that in a given namespace ( Iroh document ), any author is allowed to write to any key that is prefixed with
[author public key]/
.Or in another case I want to say, "any user can increment this value". ( Maybe there are better ways to do this already, but it's an idea )
My thought was that we might be able to do the same thing that blockchains have done to allow customizing the chain, except with our eventually consistent state.
We could allow namespaces to be associated with WASM modules that dictate the way that modifications to the document are processed. This solves the biggest problem I've had thinking about ways to make many generic Iroh clients compatible with more diverse applications.
The application specific logic necessary to reach eventual eventual consistency can be encoded in the WASM document, and independently downloaded and executed on all the clients. In many cases, this could prevent different apps from having to distributed different versions of Iroh nodes compiled with different custom extensions.
This is just a quick idea, and I think there's potential, but there's lots to think about, too.
Maybe this makes sense more as a programmable document layer on top of Iroh.
Requiring a WASM runtime isn't to be taken lightly, either, but I think for many of my use-cases, it would be well worth it, because it would make the Iroh client generic enough to function something like the focused "browser" app that it would need to be to facilitate a wider array of apps without changes.
Beta Was this translation helpful? Give feedback.
All reactions