The future is green

Matrix as the future of the Web?

Benjamin Kampmann
@gnunicorn:matrix.org
2022-08-27, Matrix Summit Berlin

It'se me, Ben

Rust Developer @ New Vector/Element

Lead-Dev for matrix-rust-sdk

Co-Founder & Tech-Lead effektio

formerly

Freelance Dev since 2011

Rust Dev since 2015 (before Python, JS, etc)

prev. Core Dev @ Parity on Substrate (blockchain dev framework); App-SDK Dev @ MaidSafe

Co-Host RustFest 2016 & 2017

more about me on gnunicorn.org

what is matrix?

like, technically. for real. what is it?

client

events

servers

full-node

chain

transactions

thin/light client

blockchain

activity stream

activities

stream

consumer

things are happening

effektio

peer-2-peer

thirdroom

peer-2-peer

client

servers

client

servers

Domain Name System

room: !asdf:matrix.org

client

servers

Domain Name System

room: !asdf:???

InterPlantary FileSystem (ipfs)

content addressing: hash(content) -> unique key
resolution: Distributed Hash Table

node identity: private-public-keypair

BitTorrent

content addressing of blocks: hash(content) -> unique key

resolving: magnet-links via Distributed Hash Table

identity: none

Bitcoin (and most other blockchains)

content addressing over state graph of a block

resolving: ask any other node - they have it all

account identity: private-public-keypair

Peer-2-Peer Matrix

  • Private-Public-Keys already exist in Olm for e2ee
  • Use public-key as node-address rather than DNS...
  • Events per content-addressing? How to deal with redactions?
  • IPFS for attachments?

effektio

rise of the state machine

the mobile-first community building and organizing platform

          think telegram, but with task-list

effektio

Polls & Voting

News, Social Feed, Chat,

Task-Lists

stateful things

Abstracting virtual objects over multiple events

Example: Polls

  1. creation event
  2. vote events
  3. close event

all mutate the same virtual object.

but same already true for message ("editing", or reactions)

Blockchains

  • event = transaction
  • a specific, well defined set of transactions are valid
  • transactions are applied on a global state
  • violations checked (e.g. transfer more money than you have)
  • order matters
  • checksum over entire state for consensus

Engineering

  • finite state machine
  • no-side-effects
  • define all possible states, operations (possible per state) and potential violations
  • state -> operation -> new state (or failure)
  • allows nice fuzz-checking for all states and possible transitions

Challenges

for matrix

  • breaks the "linear" concept of the event stream
  • rather spans a tree of root events and events referencing them, other fetch mechanism
  • b/c of e2ee only clients can actually check for violations
  • order of transactions matters
  • merging separated server might alter object later, rewind needed
  • spec abstract objects with finite statemachines in mind

third room

room events

  • spec for each event
  • doesn't allow for local innovation
  • makes development round-trips slow
  • can render the system in an

embedded state machine

  • can be defined by the room locally
  • define any custom logic
  • full authority around certain event namespace
  • can be updated by room admins
  • doesn't need spec for each event

smart contracts

Ethereum (eth)

Solidity: custom programming language for EVM

Cosmos / Polkadot / Substrate

WebAssembly based Smart-Contracts

Wasmer (-wasi) execution environment

WebBrowser

HTML display language

JavaScript and WebAssembly for interactivity

a far time ahead, in a galaxy close to home

You surf Matrix with your favorite client. It has support for third room and an embedded sandboxed WebAssembly engine. Wherever you go, any room or space, it quickly loads the custom state machine to offer any kind of localized service, you can interact with right away. You can sync any of these changes with your friends off-grid. All that, federated and end-to-end-encrypted.

You surf Matrix with your favorite client. It has support for third room and an embedded sandboxed WebAssembly engine. Wherever you go, any room or space, it quickly loads the custom state machine to offer any kind of localized service, you can interact with right away. You can sync any of these changes with your friends off-grid.

You surf Matrix with your favorite client. It has support for third room and an embedded sandboxed WebAssembly engine. Wherever you go, any room or space, it quickly loads the custom state machine to offer any kind of localized service, you can interact with right away.

You surf Matrix with your favorite client. It has support for third room and an embedded sandboxed WebAssembly engine. Wherever you go, any room or space, it quickly loads the custom state machine to offer any kind of localized service,

You surf Matrix with your favorite client. It has support for third room and an embedded sandboxed WebAssembly engine. Wherever you go, any room or space,

You surf Matrix with your favorite client. It has support for third room and an embedded sandboxed WebAssembly engine.

You surf Matrix with your favorite client. It has support for third room

You surf Matrix with your favorite client.

Thanks!

MatrixSummit 2022: The future is green

By Benjamin Kampmann

MatrixSummit 2022: The future is green

  • 292