Towards Web3 Infrastructure - Viktor Trón
Devcon·Mon, Oct 9, 2017, 12:00 AM
Ethereum’s multi-protocol stack offers a unique opportunity to directly implement web interactions as contractually binding agreements. The web 3 vision is based on the premise that decentralised base-layer infrastructure exist providing backend functionality to interactive web applications in an easy to build-on, frictionless way. The focus will be on representing structured data, providing incentivised real-time communications and transparent linking of browser actions to on or off-chain transactions. Databases of the traditional LAMPs stack is a pain point in migrating well-understood web-application design to the Ethereum ecosystem. The provable DB framework implemented with IPFS merkle DAGs and Swarm manifest tries play central role. On the one hand their logic and structure are tied to the blockchain for verification, while they serve as reference to distributed low-latency query servers for accelerated real time access and a computational market of decentralised indexers. Various flavours of incentivised routed messaging over devp2p provide a suite of communication tools including devp2p discovery and unicast, multicast, subscription and incentivised state channel networks. Contract verification, natural language support for transactions, governed name services and fine-grained access control to usage data all help bring security, transparency and privacy in the user experience. In this talk we will sketch components and interactions in such an architecture. Slides https://ethereumfoundation.org/devcon/wp-content/uploads/2016/10/Towards-Web3-Infrastructure.pdf
Transcript
[Music] I feel very privileged that I can come on stage the second time I hope you're going to be rewarded because I have some a lot lot to say so my slides are actually quite packed so is this working sorry for hiccup so press it many times okay so actually I'm really happy that the stage is set for me because Heco's and and and Christians talk we really didn't even chat about this but every everything I have converges together it's it really looking looking very nice so what I'm going to talk to you about today is how you know certain like research and ideas about peer to peer to peer networking and and this research can be combined with with the blockchain and provide some really really key the infrastructure forward for the next web so I really think that what what what we need is certain tools for for developers to to kind of think of think of the etherium infrastructure as as the as the next web so what what do we need for that we we we talked about sworn before and in the context of serving static files on the one hand we kind of prefer low latency property and on the other hand the serving as a kind of backup layer for the the other extreme case like upload and disappear that's what we call it when you upload content and you can just get away and come back after a long time and still find your your content there so that was kind of the bandwidth and storage insurance so I would like to talk about how how this view can be extended with with you know further further tools that the the usual web stack kind of needs so the the take-home message from this talk will be that basically I would I'm kind of imagining an infrastructure which you know I mean there's a there's a few random brands there so don't get too carried away if you disagree but it's kind of in a few years from now maybe maybe this this services can be properly used in production and I would like to introduce three more components into this picture that are not exactly production ready they are more mostly like you know research phase so apart from this idea and and apart from the three more silly acronyms the the take-home message is that not only static data can be served but we can provide some certain tools with for web developers to deal with the remaining program for real-time web applications namely dynamic the internal dynamic content so I I'm gonna approach it from like three angles today one is about internal communication this relates to things like what HECO mentioned about the radar Network is this the infrastructure that will we will provide the service for fourth payment channel like type internet communication and I'm gonna mention if I have time the the multimedia broadcast how have certain techniques in in peer-to-peer communication network research can be applied here and thirdly we I'm going to talk about database services so what is this all about so internet communication it's basically the question how so once we have static content that's all great and fine but what we use to these days is is personalized content with with real-time web application so if you go to Facebook then you obviously see different news feeds if you if if you you're logged in and then then if I am and some some people in the other generation might not capture this so when you know when your uncle says that oh look at Facebook and go down the page and obviously they they don't capture that this this dynamic content is extremely important so first question is how to dynamic content gets around and the question is like very simply it's basically using the same sort of routing algorithms that we use in swarm that's that's based on the the network topology Codecademy yeah and the wrong way so in in in in swarm the that we haven't mentioned before like in detail that all the files that all the documents that you put up there basically chunked into a little little pieces whatever file you will you store the the chunked into 4k 4 kilobyte little pieces and so you take the the the series of chunks of document and hash them so you take the take the hash this this hash is gonna represent the the address that determines when it's where it's stored in the in the swarm now you take the next level which means that you take X number of chunks in this case like 128 and consider the hashes or 128 hashes as as as a chunk itself so the next level you package them in a separate chunk and you go further with this story and you end up with with a chunky tree now this chanc tree is has the following properties it's it's got integrity protection because if even even with random access what does that mean is that you can basically do range queries in the in the original content for example skip to a part of a movie and still be sure that that particular part or between the movies is is what you expect from the from the single hash the route that you looked up and that route can be obviously recorded in in the in a system like the etherium name service that nick johnson our team will be talking about what but it obviously also allows is to have really compact marker proofs of of the data which can serve as the proof of custody for for the insurance that that I talked about the why is this all interesting so if you if you if you take this one step further and think about the this chunk tree as basically in this simple case since it's in the branching is 128 you can think of each level as as lexical dictionary of you know ASCII characters so you can address each chunk in a in a full you know document as a series of of ASCII characters so this disorder this suggests that you can think of each of each file as a so you can index certain parts with with with a character string now if you if you allow these this tries not to be balanced and and not to be have the same depth then you can basically represent any kind of indexes like that and that's exactly what's wrong does on the top level which means that you you you actually have this manifest files which map URLs to to to assets to documents so so the in this in this trees of the manifest you each each leaf node represents a document and each you know past going to that leaf represents either URL or say like the past in in in the directory structure now this is not nothing new and not not very interesting it's it's very similar in ipfs for example and what's interesting here is that once once the the file is chunked chopped into these little pieces then you can you can use the the the storage mechanism that we that we discussed before like the the retrieval and and syncing process to to distribute the chunks in a way that's that's securely retrievable and and can be can be found now what if you if you if you generalize this this kind of mechanism that by which this thinking process works and the retrieval process works then you can you can see that these are basically general ways to to to have like point-to-point communication in a network of nodes so if you if you combine this general property of how you know how you could how you communicate between nodes and allow storage on top of them then you can basically cover all kinds of cases of the data being pushed around like push and pull and and you know store or not store and interestingly like basically all communications I have you know poured onto this I mean without without pretending that I'm gonna give you like a full semiotic analysis of forms of digital communication but still it's really it's really that that kind of is in a way like you can you can capture all the non communication medium like you're starting from tweet stuff like Facebook status updates all the way to email and and and the chatroom basically you can characterize by various properties relating to to you know the Internet communication so along the lines of for example whoo-hoo the the actual message is meant to be for who whether whether the best it should be delivered or redeliver if the if the recipient is not found to be online so it's the same as like you know when when the Postal Service like really diversity package and just leaves that leaves a note or well you can you can classify them according to their confidentiality and and finally like all kinds of surface properties even even including how how they are displayed in terms of like threaded threaded or or or timeline and if if you if you do like this this these classifications then you can basically implement using the same not communication you can implement an entire comprehensive communications infrastructure and what what we already have the SSS as a it's a really important ingredients for this is we can we can use the the incentivization the same way that that we explained with swarm so you can have incentivized communication protocols and you can use very various like api's like similar the whispering API where you can address a particular topic not necessarily like a particular note in which case you you can subscribe to this those those topics and you know implement interesting communication tools so let's let one step further so I am NOT going to talk about multimedia live broadcast this is kind of an interesting topic and this is research into this direction is relatively immature so I just mentioned that a lot of big companies work around this problem including Apple Adobe and Microsoft and the end also like you have frameworks like WebRTC which I was trying to solve the problem that most most most mostly the problem that they trying to solve a solved by by peer-to-peer networks themselves so there's actually interesting ways in which you can efficiently do the delay sensitive live broadcasting of content this is using the technique that I I turned swimming with adaptive transmission channels so it's it's basically a combination of of multi bitrate adaptive streaming and and the kind of very interesting adaptive multicast which which that is very efficient in in channeling data towards a set of set of nodes a set of peers without you know you placated a lot of traffic so thirdly it's very important and this this is where I I connect to to Christians work so databases as I mentioned with with manifests the the the higher level structure of Swan allows in index of you know arbitrary keys to to arbitrary records basically like a key value store so if you if you in already contract smart contracts allow contract storage but as we know what like on on the blockchain this is both expensive and slow and you you can also use taps you use like local storage in a browser for taps to store some data but the others are private so this is an interesting solution where which you can use the swarm you know manifest structure in a in a way that allows you to have like database table definitions and sorry I have to skip besides here so so the manifests basically used to to encode and the arbitrary key value store and the marker Patricia tree that is included in the manifest is make sure that you can make assertions about insertions assertions about like membership in a particular database and once you once you have that and once you have interactive verification of of code then you have an incredibly powerful Stratus system whereby you can secure these these these database tables by by verifiable operations so for example if you have SQL queries over on top of this this manifest encoded database tables then then you can have you can you can you can have contracts which which check for for for certain you know properties for example they check the validity of certain indexes or validity of of weather weather response to a query is actually correct or not and therefore you can have a computational market which complements this the system by by providing scalable you know database database retrieval and so I conclude this by by saying that the the takeaway message from from today is that there there is researching like these three areas and and this this there's a three projects that we would like to you know complete in the in the next year or so and these are all basic infrastructure like this they are infrastructure projects which are very unlikely to be funded by by industry it's it's so it's if we ever get it done and it's thanks to the foundation that provide this funding for this so thank you Thank You Victor thank you [Music] [Music]
Automatic transcript — names and jargon may be misspelled.