# ETHWarsaw 2023: Radek Sienkiewicz, 3Box Labs - Using Data Composition for a Better Web

- Speakers: Radek Sienkiewicz
- Channel: [ETH Warsaw](https://streameth.org/eth-warsaw)
- Date: 2024-10-07
- Duration: 30:01
- Watch: https://streameth.org/watch/yt-IdswanSsRas
- YouTube: https://www.youtube.com/watch?v=IdswanSsRas

## Description

Presentation - A brief talk by Radek Sienkiewicz from 3Box Labs. Explore how 3Box Labs is paving the way for data privacy and user control in Web3 environments. 

Follow us for more updates: https://twitter.com/ETHWarsaw

## Transcript

and uh radic will talk about uh composable data data for a better and more powerful web uh let's give radic Round of Applause yeah I unfortunately I probably need to stand here instead of just like closer to you but I I need the computer to to know what I'm talking about uh and uh this is me I'm DC I'm a senior developer Advocate at ceramic and I will talk a little bit more about uh composable data and how ceramic uh works on that problem and solves that problem so ceramic is a protocol and it also has a composed DB product kind of on top of that protocol and to add even more to that it's like a composable graph database built for web 3 app devel Vel opers so there's a lot of that and I will focus on each and every aspect of this so that it doesn't seem like just a bunch of words thrown together for hype Factor uh so I I will explain every aspect of this so for example what I mean by composable like the the first aspect of that uh currently in web 2 for example or in many web 3 products as well the Journey of the user is that they come to a product like for example social app they come to Twitter uh or whatever they call themselves now uh and what they need to do they need to sign up they they need to give their name birthday locations uh whatever else uh then they can choose different side preferences uh then they have uh different connections follows uh unfollows whatever else uh so many different features that are valuable but to this network like to Twitter and also to the end user but when they go to Facebook or meta or whatever uh to social app B then they need to from the end users perspective uh they need all the same as from Twitter they need to be able to follow people that they're interested in uh they need to be able to maybe not even sign up quickly but just like use their currently existing profile uh but they they need to do everything from scratch they need to give their name birthday everything else they need to add all their friends and so on so this is where composability comes in where uh if you could use all of this information or like maybe not all of this where this overlapping information like your user profile or your friends list uh this could be public this could be uh onchain or like available verifiable and so on and this could be reusable so that's the composability aspect of this um and uh ceramic solv is this way that it has different data models and data models can be for for everything like uh one of the data models could be for a basic profile and that profile can be like very detailed it can be it have it can have any aspect that you want like name last name uh birth uh date location anything else and then you can use whatever you want from that model uh or reuse what the user has already has entered previously Elsewhere on social app a or social app B uh and and then it's just uh if all of the needed information is already there it's just like logging in instead of signing up uh and uh we split it into data model where you have the data model description and a link and then the link uh is with all the schema like like I said so that name uh email uh potentially password whatever else uh so that's how it works and then uh we provide a way like ceramic provides a way to read that data create that data and update that data and all the other apps can read from that can use this uh protocol to interact with that data uh which is uh sharable and composable and here are some of the use cases like uh core components of sovereign data so where it makes sense it it definitely doesn't make sense everywhere definitely doesn't make sense for like financial data and so on uh because all of this is public uh there is a way to also send and share encoded data private data but that's not the primary use case the primary use case is composability where it's public and many different apps can read and write to to that data so one of the most exciting recently uh use cases is and more and more important is uh reputation so aggregated identity and reputation so I am active on many different platforms Twitter meta whatever else in web two but in web 3 I may be active in defi social app lster whatever else and uh the more places I am active at the more my aggregated reputation should grow but this is very uh this is not integrated at the moment this is all pretty much siloed uh everything every platform every service everything is siloed so there is a need and there is a growing need for reputation in web 3 so that I can trust as a user I can trust uh the uh the service provider and then the service provider can trust me that I'm actually a user not a bot or a scammer for example uh and for this like composability is an ideal use case because uh it's all public it's all verifiable it's all uh on chain you can verify the actions you can verify when those actions happened and you can verify that this data is uh is true uh social infrastructure you can build a whole social network on uh composable data it will not have some private messages for example but this is also you can do it with encoded uh data but like I said it's not the primary use case uh public data graph uh document storage and everything else so uh the way it works right now so the all the data is stored on uh ipfs as a layer zero and then there is a whole uh protocol on top of that like ceramic protocol that has ipfs for storage but then does everything for composable data and so on so storage is uh cheap and fast and uh yeah we have uh built it so that it's much faster than even l2s or l3s or whatever else and it's like you almost like your local database uh other things that open source data models so this is another one that is uh more and more popular that we see as a use case uh Discovery metadata and schema or um like scientific data put on chain actually not on chain but uh verifiably through at that specific Moment by that specific user which is important for uh scientific research and then other scientists other researchers can use that data and contribute to that data uh and everything stays uh in one place as is shared among the the research community so how does it work so the key component is that ceramic network is at the very bottom so this is something that has ipfs asay layer zero then you can treat ceramic as like uh layer one so ceramic is like it's streams uh of of data it's like apach a CFA but for blockchain so you have data streams and you can work just with ceramic uh without using compos DB uh but it's much easier to use compos DB it's like an interface uh that makes uh interacting with uh with those data streams much easier and more like your database where you can just read and write queries uh and have responses like from from database uh so that's Layer Two of of that uh piece of of the whole piie and then data composits it's what you you create like data models and so on so what you either reuse what's already existed like a profile uh or uh identity uh or whatever or like a piece of scientific research so these are the the Composites uh and here where the magic happens so how it works so you API hosting is like step step one so there are different uh ceramic nodes you can run your own ceramic node or you can clone one of the ceramic nodes that has the data that you are interested in and then you are contributing to decentralization of uh of the data and uh this this is one thing that so you you run a ceramic node use another ceramic node to read the data and that's where the requests are coming to and from and then uh data producers so for example if I'm a user I'm a data producer I'm connecting to the app that uses ceramic for example uh and then I send a message or do some action on a social app or I do some action that contributes to to my activity on chain uh and uh ceramic handles the uh event storage and indexing as well uh and then it's public globally available and decentralized and everybody uh can use and have access to that data uh and the next thing is that it's not just someone gives the data and and that's it it needs to be also verifiable it needs to be verifiable that this specific user performed this action perform this action at this specific time and we can very I that this was exactly that user only then it makes sense only then it is equivalent to storing data on chain which is too expensive for a huge amount of data so that's what uh event ordering is doing so the way it works right now is that on ceramic after specific amount of time all the events are rolled up uh with uh with Merle tree and then using uh the anchor service it's C ceramic anchor service it's uh then anchored on ethereum blockchain the hash and using that hash and it's like periodically uh with times times with everything we have that hash and using that hash at that specific time we can then decode everything and verify if that user performed that action and that specific time or didn't so that's how it works uh when you uh have verifiable uh distributed composable data uh and then the networking the last one is that ceramic nodes uh you can run your own you can use someone else's if you want to be sure that you will have access to this data uh you you clone another one and you keep that in sync and uh yeah it's more distributed uh this way so that's more or less the stack of and uh uh the whole lifetime of the ceramic Service uh and now a few questions that you people uh often have so first of all is if that's doing like the the uh I think step two three two and three here if if ceramic does the indexing and works like a database so is it like kind of the graph which does the indexing and then you can also query uh the the thing like all the data and so on not not at all so the graph does the indexing the graph is is also using graphql and ceramic allows you to use graphql as well so that's why people probably have uh that idea that it's something similar to the graph uh but ceramic only indexes what is on chain so data on chain they index that and they give you like the interface to quickly and cheaply get that data ceramic does something completely different it doesn't index data on chain it indexes data that your app uh creates or someone else's up creates uh which is verifiable on chain but you can create much more data and then query much cheaper uh than uh than when storing on chain so uh it's it's something completely different ceramic is more like your decentralized version of traditional database uh and uh uh yeah you the the main difference is like yeah with ceramic you can store it's uh for storing creating and having access to as much data as possible it's like you don't have to think about the cost of your data it's like building in web 2 but having all the good stuff of web 3 so that's the first difference and the second is now okay so if uh if it's not like the graph so what is the difference between doing it on ceramic versus doing it on chain so first of all it's much much cheaper to doing it uh with a ceramic much more scalable uh it is optimized for a lot of data for quick reading quick writing uh quick retrieval of the data uh and uh it is not optimized for financial uses like blockchain is so it uses a different consensus model and this way it's much uh much cheaper and and easier to scale than a normal blockchain uh it also has better developer apis uh you can build uh different schemas like I mentioned previously you have models you have schemas and you can uh do whatever you want with that schema you build your own relations then you have the graphql API to interact with the data so you can have all the complex queries uh to retrieve that data and you don't need to wait for it like with a blockchain uh it's almost immediate uh and it's also more powerful in terms of access so it uses uh D IDs uh decentralized or decentralized identity uh so you can use any blockchain wallet to create a d and then using that d uh access your account sign the operations and also you do it only once you don't need to to do it every time uh like uh with with blockchain so ceramic has all the good stuff of keeping the data on the Block blockchain but doesn't have all the bad stuff like slow or expensive or hard to to use from developers perspective so at the moment ceramic has four networks that can use for building in memory is just like for your uh playing with uh on your own machine and creating like sample applications uh clay test net is is our main main test net where you can uh play without paying for C which is this anchoring service which uh anchors to ethereum and Main net when you already have your app in production and when you need already un use that uh verifiability and comp composability and then it also uh anchors to ethereum so that costs a little bit to run uh so that's only when you have a working product uh now the the tool tools to to use ceramic we we have a uh CLI tool to to make your life easier where you can just uh fire it up and we have seven minutes nice I'll show you so this was uh the part of why and now I will show you a little bit of how first I wanted to uh to introduce why ceramic makes sense and second is how to use it uh so whe is uh takes it through the whole process and even lets you have a sample social app as a process of onboarding when you can play with with different data locally and see how ceramic Works uh or you can use simplified deployments to uh deploy to digital Ocean or or or anywhere else uh and these are some of the use cases that uh some of them I already mentioned decentralized identity probably is number one uh in terms of Interest right now uh where you can store profiles cred reputation systems and for example gitcoin uh uses ceramic for their git coin uh passport uh product their main product uh social networks where you can build social graphs posts likes comments everything that is public uh you can you can build with with ceramic uh Dow tools again where everything is public and there's a lot going going on and a lot is also uh depends on reputation of specific users specific members specific Partners uh and you also need to track different proposals votings and everything else and everything is uh public and information graphs like I said knowledge graphs science graphs a lot of research data is on ceramic so that's that's another important use case and these are some uh of the companies already using uh ceramic uh many more are on boarding at the moment um I would run a quick demo but we only have like five minutes so I will show a few uh maybe interesting slides where I chose some um relations like the models so this this is what you would do to install the wheel and then start the wheel configuration and then you can either use uh so this is how you would use an existing model so for example uh this is the model uh that is I think for a basic profile so there's an already there there is a list of different models uh to for to reuse if you want and then you can already use the data that's already there or just uh use something for for you to uh to to use in your own app that someone already has tested and has running uh or you can create your own model from scratch but uh for the first one I think it's it's nice to reuse to see how it's working but if you want to create your own model so this is how you do it you you just uh this is basic profile model from the sample app uh that is being built for you as part of onboarding uh you create a basic profile the create model here account relation is and a single or a list single meaning that you can only the the account can only have one instance of this model and if it's a profile then it obviously you only need one profile per account but if it's a message or anything else then you can have as many as you want so for the profile it's account relation is single uh short description and then uh different fields here uh for Simplicity the here only four the name uh description gender and emoji and then you can see like exclamation point me means that it's uh a required field and our exclamation point means that it's optional and you can set set all the rules uh and uh that's how you build a model and then once you have the model you can have different relations like in your database one to one many to many account to model model to model and so on and this is for example how you can define a relationship first of all you need uh you have a basic profile model and you decide that okay I want to reuse the basic profile model and I want to have access to um many profiles that are already on ceramic so I will reuse that but for my own social app I want to build my own model for posts because my app is totally different so I will reuse the braic profile and I connect my own models uh model uh posts model to to this basic profile to reuse and uh this is where I am uh defining how those posts will look uh and uh if someone is coming as a user to this app uh they will be able to immediately log in instead of signing up and immediately have access to their social graph for example and then start creating content uh and posts on that specific app uh interacting with the data uh you can interact with uh graphql to make it easier to make it faster to make it understandable and to to be able to use something that people already know and and value uh so this is a basic uh query two minutes so maybe I'll I'll show one or two uh so this is where you create a new post uh uh simple graphql stuff and uh this is how I don't know if if you can see it oh yeah it's not good uh okay so uh yeah so this is a a more complicated query that I wanted to show but it's kind of like a database this has uh different were parameters different and parameters different filtering by different fields sorting and Sol so basically you create like a database query you you sort and filter any way you want and you get the data and you get it immediately and fast uh so you don't need to wait you don't need to pay a lot to access that data from uh from from blockchain from onchain because you have it offchain and it's basically your database with verifiable uh credentials verifiable truth and also composable if you want if you don't want it to compos to be composable you just use your own node and uh and that's it and don't make it public uh some resources there's compos DB documentation and guides uh the QR code goes to uh compose Deb documentation ceramic. network is our website uh there's the veryable blog camic YouTube channel uh if you don't want to run your own note like on your infrastructure you can uh run it on higher notes.io uh and scan S3 XYZ has different models listed available so like a basic profile model or like a thread model like for forums and so on there is a thread model that you can reuse uh and make that composable uh and that's it that's ceramic thank [Applause] you thank you very much R uh thank you very much Ric and uh does anyone have any questions yeah sorry with Mike hey thanks for the presentation is it possible to check how popular uh different uh data models are so uh yeah so that's on scan S3 XYZ you go there and there is a activity tab I think total activity and last seven days activity or something like that okay yeah what are the coolest examples you you saw people uh built on top of ceramic yeah I think that gitcoin gitcoin uh what it uses for is is nice interesting but I I don't think it's the coolest now but it has the highest potential to be because uh they have started it and they have the resources and they have the user base to make it most valuable to both of them and to everybody using that y uh thank you for presentation it was really nice to know all that stuff but I would like to know as a developer how do you approach uh addressing the content of the database because uh we do this often times by the index or something like that but in the decentralized world we often use the content based uh indexing CID it at least in the context of ipfs which is the most popular database of the decentralized world yeah and how does it work in the well relational database I guess which yeah yeah so so you define the fields and in the model you define that in the model which fields are being indexed uh and uh that then is uh be being that index is then part of your your ceramic node or the the network of ceramic nodes and it's being quered based on those indexes so it's harder to um index everything so it's especially it's like a large content like a field with large content uh but uh you Cho it's like with a database you choose what you want to index there is a price for that meaning the the price of like probably storage if you want to index a field that is data heavy uh but once you index that then it's available for you in the queries and everything else okay what if I lie sorry what if I lie just as a node uh is there a way to check if I am honest or not because in the decentralized world that's kind of the most important thing and in the if we have the content based ID uh then we can based on the hash be sure that that this is the thing that we want so how we can control the node to be honest that's uh maybe lastly my question was uh wrongly asked and sorry okay uh that that was the point what I want to know uh so that's uh that that that's based on other noes so it's it's distributed and if other nodes see that your node is producing data that is not in sync with what other nodes are producing then they will just stop syncing with you so you will still be running you will still be producing your data the way you want but just nobody will be thinking with you and that's it uh yeah yeah uh okay I think that we don't have more time for other questions but uh we can uh give a round of applause for thank you thank
