Thoughts on Scaling Web3 / Substrate Apps with "Instant Gratification Layers"?

A little over a month ago, I wrote an article detailing how one could scale a completely blockchain-based application using something I dubbed as “Instant Gratification Layers” (obviously very high level and theoretical).

The idea behind this concept is rather simple - spawn an offchain process for a specific purpose and context. This process should be something that doesn’t require the state of the chain to be accessed during use, but would still be useful to include with each instance of a node in order to keep the continuity of a particular application intact.

While it seems logical that this could utilize a Substrate off-chain worker - I believe this sorts of layers should be stateless when actually in use, very lightweight, context-driven, and have little impact on node performance. Almost akin to the microservices of web2 architecture.

In other words - we use the chain’s existing state to manage data and verify that whatever rules in place are being respected, but the actual processes occur off-chain.

A use case specific to a project I have been working on is messaging - it makes no sense to clog the network with “message extrinisics”, rather it’s better for the network to acknowledge the need for two users to communicate, establish a means for them to communicate, then delegate actual data processing to a trusted service within the node’s topology (that has no impact on consensus) that knows that the terms for communication are valid, then commence communication.

Beforehand, this service already knows certain limitations, i.e, the access rules defined by a user on who they wish to communicate to, and on what terms, but does not modify the chain’s state.

This presents a few immediate questions:

  • Logically, would this setup make sense? Or is it merely what a “layer 2” solution would do for a blockchain already?
  • Is this something off-chain workers can already do?
  • What would be the best way to fit this sort of setup within a node’s topology?

You could look into using rollups. Astar has a zk rollup pallet, but I’m not sure of the status of development: GitHub - AstarNetwork/ZKRollups: ZK Rollups pallet implementation

This is from the ethereum docs on zk rollups:
> A ZK-rollup chain is an off-chain protocol that operates on top of the Ethereum blockchain and is managed by on-chain Ethereum smart contracts. ZK-rollups execute transactions outside of Mainnet, but periodically commit off-chain transaction batches to an on-chain rollup contract. This transaction record is immutable, much like the Ethereum blockchain, and forms the ZK-rollup chain.

1 Like

This, combined with allowing for (potentially) Substrate to act like a gateway to these layers could be viable.

Could be related - talked about how they concept may look here.