notes icon indicating copy to clipboard operation
notes copied to clipboard

P2P-Webhosting

Open void4 opened this issue 7 years ago • 0 comments

tldr: P2P-hosted objects (e.g. websites) do not need to be governed/signed by a single party. Objects can integrate a description of future valid state changes and consensus thereof. This mechanism can extend to arbitrary external behavior (e.g. hosting), if the right protocol policies are in place.

One of the problems with p2p-hosted websites is that they are in most cases static, because there is no server that can validate changes. Content addressed systems need a naming system, updated versions of sites require an approval by cryptographic signature of the issuer.

Let's consider a Substrate (similar to a modern Browser) on which Objects exist (self modifying websites).

Observation 1 - Self describing objects:

A program describes the change of state, and possibly of its own code (Lisp etc.). Most programming languages clearly separate code and the runtime environment, which is usually not completely accessible. Languages that can do this are called reflective.

Moving the entire environment (e.g. stack frames, variable key-value mappings) into the program representation and making it accessible makes the underlying interpreter/machine stateless, a pure function. This allows the program to specify its entire evolution precisely, independent of the underlying substrate. Program states can be easily compared (by hashing them) and moved between machines, then resumed later.

Programs - their code, initial data and runtime state - can be seen or represented as objects (see Smalltalk and others). Therefore, you can create objects that specify their own evolution through time, including acceptable input.

Observation 2 - Consensus:

Using a fully deterministic language, combined with a consensus protocol, p2p nodes can achieve:

  • agreement over the current state of an object
  • agreement over ordering of past states, including external inputs to such an object

Additionally, given the object includes fitting data structures:

  • incentives for storing an object and including future changes
Observation 3 - Changing the substrate:
  • restricting valid state transitions to a subset of the existing ones (soft fork)
  • extending valid state transitions by allowing previously invalid ones (hard fork)
Observation 4 - Influencing the substrate by changing the Object:

Object internal code can describe and, once an incentive system is in place, incentivise external processes. This could theoretically continue until the object incorporates everything - the substrate becomes a stateless pure function. Example: Urbits' Nock. The system switches from a bottom-up to top-down description. It becomes programmable, but also leads to an inner-platform effect.

Before: Substrate -> Object

Afterwards, a strange loop:

Substrate -> Object >-|
^---------------------|

I would call this "inversion of control". It is the formalization of underlying processes, a system that regulates behavior (law).

Examples:

  • Ethereum Proof of Stake contracts, that describe who belongs to the group of validators
  • changes to the interpreter and therefore consensus itself
  • Eris (now Tendermint) specification of permissions for chain actions within the chain
Conclusion:

Websites could be such objects and attain these properties.

This is one of the reasons why I'm completely obsessed with deterministic languages with sandboxing and fine grained resource control capabilities right now. Because untrusted third parties could include arbitrary code into the object, while having no or only specifically defined limited effects on the object. An alternative would be including static analysis code or an object language self interpreter into the object.

void4 avatar Oct 26 '17 22:10 void4