{"id":"UeHIMAjqerk","title":"Block Zero Stage | Social Lego Blocks: What B.O.S Offers to Web3 Builders","description":"Social Lego Blocks, Presented by Eugene Kuzyakov, at NEARCON 2023\n\nNear Social founder Eugene Kuzyakov explains how you can combine components on B.O.S to build new social applications.\n\nJoin NEAR's community:\nWebsite: https://near.org/\nReddit:   / nearprotocol  \nDiscord: https://near.chat/\nMedium:   / nearprotocol  \nBlog: https://near.org/blog/\nTwitter:   / nearprotocol  \nGitHub: https://github.com/near  https://github.com/nearprotocol\nDev Docs: https://docs.near.org/\nCreate a wallet: https://wallet.near.org/create\nApps on NEAR: https://awesomenear.com/\nLearn to Build On NEAR: https://www.near.university/\nGrants & Funding: https://near.org/grants/\n#Blockchain #FutureisNEAR #NEAR #nearprotocol\n#nft #dao","channel_name":"NEAR Protocol","published_at":"2023-11-21T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/UeHIMAjqerk/hqdefault.jpg","transcript_text":"you know I'm uh I actually should have introduced myself I'm actually senior legal counsel at the near Foundation every time I hear regulation I kind of wince a little uh so uh full disclaimer the Encon token is is not a security so I I don't think there's there's anything to fear there um we've got our next session coming up uh social Lego blocks what boss o offers to web3 builders very excited to welcome Eugene uh from proximity Labs up to the stage to give a presentation please welcome Eugene to the stage everybody hey everyone um my name is Eugene I'm a founder of near social and that's how all the boss started and today I'm going to talk more about what you can do on the social side of this instead of just building apps for entire web so before we begin so that talk going to be mostly technical with a lot of visuals but um hopefully um you're all going to enjoy it so another disclaimer you probably want to know some Basics about how it all works otherwise you'll be confused U but there's going to be a link at the end that you can use to get all the slides so let's get started so first we're going to talk about um social components so what are actual building blocks of a social applications and how they actually stored in the decentralized social platform so first is a profile it's fairly simple it's probably the simplest thing you can do and behind it we have a decentralized database that is unique and accessible by every single user users so users can only store data under their own accounts and I'll show how it works so there's a simple boss VM command that you can do to get the profile data so in this case you have first request a command called social doget it takes the account ID then we say what you want to retrieve for example profile and then you um and then you get a double uh Asterix to retrieve all the data under profile so expand the object you pass final to indicate the finality of this data and finally just going to retrieve it from the server so it can do very large amount of data and the data you get in the following format it basically Json starting from the route where the first key is the account and then you get subpass data so in this case profile and the all the information that we store for a profile so that's why it's very simple it's just data that we store for a user for a given profile so there's like image and it's stored as nft there's a description that user posted about their profile and name and maybe a background image that is a hash on ipfs so the next thing is a graph so that's how you keep connections in a social data so in any network you have people you follow or like being friends with or you like and then people who follow you back so in order to get this data you need um two things right we get data from graph under a key follow for me and that way we can get who I follow and if you want to get the data that who follows me because they cannot write under my profile I have to retrieve it in inverse and I'm saying who are all the accounts that have a key under graph who follow my account if you execute it we get the following so on the left you get pretty standard you get list of people who follow you and on the right uh you get the kind of inverse object it starts with a account and then it has a bunch of keys indicating all right they follow me and so on so that's how you can do okay inverse edges in a graph now the next piece is a post so how people actually write anything on a social network they create text that get in stored on a chain to get the post you go to a specific key called post. main SL Main and you get the information and it start slightly different instead of being an object which contains text type Ty and stuff like this it's stored as a string but not a simple string but Json serialized string we do this because we don't want to store this data forever and to store to decrease storage we want to override this data because on near protocol you only paying for the data that is stored in a state so you don't pay for the data that was previously written and later deleted so in this case that me message is effectively a single string that can be overwritten but how you get data from the past right the the post that was before this so for this we have to go back and we use indices so what is an index index is a specific key in the database that is getting parsed by the server so here's an example when you post in new message you also write a specific key under a namespace index and that key is in this case post so this post is an action and it should be again a just like serialized Json string that contains two attributes key and value key is what a unique key that you would uh aggregate data on so in this case we say just a Main feed and a value it can be any data that you want to store in addition to this so every time you write into the index a server indexes the data and it will serve you using the custom API called social. index so for example we say hey give me an action post where the key is Main and we also filter by account ID and if you do this well you get all the posted account ever written and the way you get it is account ID a block height when it was created and then a value that was specified so using this information you can reconstruct the feed basically now we can say all right who was all the people that posted into this index called Main and we can request it using command social. index how we do this we always say all right now do not filter by the account ID and just give me everyone whoever posted anything but make an order um descending and give me a limit at most 10 posts and here you are you get the index of everyone whoever posted under their account Nam space and the values so that allows us to actually create a feed of post on a main page still no custom Logic on a server except for this magic indexing but makes it very powerful now how we do likes so if you familiar with lens they actually don't store likes on a blockchain so instead they like all right here's our server let's keep likes there we instead decided to store likes and without inventing anything custom for this we just reuse the previous stuff like storing data either under your account or into an index so how we get the certain likes for this we need to know what item was liked so we need to introduce items so what is the item so in Social an item is effectively this structure so it has a type so for example if it's social it means it's stored in the database social DB then it has a pass which indicates where the data is written in the absolute pass so in this case a root. near is account ID Post Main is the path and then a block height and a block height is when this data was created so this uniquely identifier a post and that's kind of the a unique link that we will use for all the information so if you want to talk about the post you would use something like this so now how we store the like uh we do the following we basically say let's write a new index under action like and the key going to be the item that you're liking so in this case this item is a unique identifier on a post we say all right let's and a value going to be like and to retrieve it we use social. index we say all right let's give all the likes on a particular key and the key is this object so if you execute it you get all the likes and when it happened and you for every item you have like so what happens if you don't like the post from Ilia anymore well it's on a blockchain so it's done and cannot be at done that's kind of a problem but um you can fix it for this um let's just basically send the same index and say I un like it so that will remove the L and but then let's say I liked it again so I added the like now instead of 1 items in previously I have 15 even so it means the same thing so to solve that for likes I introduced an experimental API so give given an item it will retrieve you the list of likes so it's not available inm instead we just fetch it directly from the server and you pass the data where the body consists of just a single item and it will retrieve you a list of likes so they're basically just a list of accounts who like the post so that's very useful because now considering the feed consists of ton ton of posts you don't really need to fetch an index for every post you can just fetch likes in aggregate finally the simple stuff is comments and comments are like likes but they are really posts on a given item so we let's see how it actually implemented so when you comment something you have the following in your data that you overwrite every time you comment you have an item indicating on what you commenting in and in this case it's a post so if you commenting on a post you just indicate all right that's an item and then in the index for this item you also indicated that you just commented so now if you want to retrieve all the comments on a given post you query an index if you want to retrieve what was the post for which you created this comment uh you you will read the comment by the item and then you can retrieve the parent and finally here's an example of the index of for a given post you request it and you get the following so you get all the comments a final component that is useful on notifications and if you remember in a social DB you cannot really notify someone directly because you cannot write under their data so instead you have to write it under your account and they somehow need to figure out that you made this um notification related to them to solve this we will create a new index where the key is the account ID and we say notify so we basically notifying someone about an action that I just did and you can read notifications from anyone so in this case for example you can read that I commented on your post and then three other people liked so that's pretty much it uh from the Lego blocks and to get used of them you can use a component that I started working on which consist of the all the different social components that I used for the main feed and if you go to this link uh it will land on a component and whenever you building something in Social you can use this to figure out what is the component how to use it its properties and stuff like this I'll keep so I'll try keep it um updated over time uh but it's not right now now a second part of this is actually how we build some new applications so we have a feed which looks like a Twitter feed which has the following properties it takes um your graph people you follow then it requests uh an index of post from these people and we just display them in Reverse chronological order and then for every post we can get the likes amount and we can also get the list of comments and notification works so instead we're going to build an edit it's like a Reddit Forum but it has a few differences from the main feed so it has to be Community specific so it's not only like one single big feed but instead kind of have a communities in which people also um talk about specific topics um usually it's sorted by likes so when you go to the main page you see top popular post from the last stay for example and to get it a Time specific bound you want to Decay it by age so if the post was like two days ago but received like enormous amount of likes it still can be at the top so we need to use the previous Lego blocks in order to build something like this so let's start with a Fed so we'll call it n/ all and it consists of the post ordered by likes comment from different sub medits and also based on their Edge age they going uh down in um popularity how we can implement it so we'll use stuff that I just talked first we start with the index and instead of fetching just 10 posts we will fetch like large amount of posts and because it's an index we don't fetch every independent data so the data is fairly small we're just fetching when they were posted and who posted them so we can construct items and the key is a subnet so for Main feed we will use all and for something else we use let's say nearon next we're going to do some JavaScript to convert this data into the items and the reason why it's a bit more complicated it because maybe you want to repost it from one Community to another Community which is not implemented on UI but the logic is implemented for this the third thing you want to do is fetch likes that's where the experimental API com into play and instead of fetching just likes for one item we will fetch likes for multiple items at once so for all post that we fetched in the first batch we will now fetch the number of likes and who likes them but we only care about the numbers and finally we want to sort your feed in order to display it so how we do this well we use the following we say okay how old is the post that's your age of the post and how many likes it got that's your score so we divide the score by exponentially decaying age so the older the post the less score it gets the the more likes it has the more higher the score is then we just sort all the items that we get and we can display them and that's how the feed works now another difference from traditional Twitter feed are multi-level comments and what is actually a multi-level comment it something like a comment on top of comment and and for every comment on top of comment you can also apply the same algorithm we did for um the Sorting of the post so we get all the comments we sort them by like Decay them by time and render them in sorted order and now for every comment we just need to display a feed of comments under this comment so a comment is an item so let's just use it and here's just how the data would look slightly modified from before so for every post we added a subnet item which indicates under which feed it was posted so that's very useful for displaying the post when you get a notification for it for every comment we also add a root item which indicates what was the post on which it was posted so you can display a full tree instead of just a parent or like having to recursively find a parent and finally um here's when you make an index you write it into two indexes instead you write it under the sub neted index and also all so that way you can get an aggregated overall Feit and that's pretty much it thank you if you have questions maybe I have time yeah all right so the question is why comments are not included in the score of post so that's actually valid uh but for this you basically just need to kind of have a big aggregation of number of likes to or something like this or like frequency how they were posted so that might need a bit more data on sorting this but probably possible to implement or do you also want to build groups you mind ask yeah I can ask it again so is this nage idea going to replace the concept of groups or are you so planning to build on groups um well the social itself is kind of like a super app of different social applications so that's why potentially what you want is probably replace the main feed um the groups are interesting concept as well but groups also make sense if you can restrict people who can control them so in this case current group implementation at least the hacking version was based on nft membership so if you own an nft then we filter on a front end uh um all the content only to the current members if you don't own it the nft then you can still write your data into social DB because no one protects from that but it's not going to be displayed on a feed because um whoever visits the official endpoint or like official app will have a filtering based on the membership so this um Reddit it also in theory can be controlled a private it um but that's a different topic that require either encryption or some kind of another Access Control yeah so based on your answer so do you see near social as becoming a social network or more becoming some you know place where people can go and actually find the components to create their own social network like what what the ambition for the future yeah so one a few features that differentiate neuros social from traditional networks I ability to embed applications directly into the feeds and posts So currently they like under strict white list and you can only repost the another post but you can imagine you can create applications that can be embedded in the main feed and that may be a mechanism to distribute the data um probably there are going to be some kind of main version of the near social which have more polished Feit but you would also be able to use different applications so once some kind of technical details I figured out around how to make custom notifications so they are not easily uh attack the or like cannot be used for fishing then it's very easy to create new custom uis and new custom applications so if someone want to like make a new app that just image focusing social network where they images on top of the post instead of on the bottom well maybe they will call it Instagram and build it on social as well um do you have any components that are related to safety or um moderation um yeah so currently um it's done on a user basis or a post basis so you when you render an index you can filter it by the people you hidden so if it's not like a Reddit specific where everything is displayed so for everything is specific you can also flag any given post for moderation which gives a goes to a custom feed that you can later kind of query when it comes to gmca takedowns and like some illegal stuff it's probably going to be deleted or like blacklisted on the server and you will not be able to request it when it comes to like building a custom UI to get it you will probably still get it maybe not from a official RPC server but you can get it from a blockchain if you run your own note any other questions um are you planning introducing any paid content uh private pay content for subscribers so yeah yeah that's like currently in Works um but it's not going to be part of the main um experience that can be fully decentralized because private content requires encryption so you can probably build um easily build like peer-to-peer uh data that is been encrypted and Kary is a good example of this they built a private chat um but for like Mass adaption data you might need a separate server that will keep data encrypted and only give it for the parties that need it otherwise you run into a problem where you need to do key exchanges will not store data on a chain all right last opportunity for questions here all right I think that's uh that's it for Eugene everyone give it up for Eugene the dream","transcript_synced_at":"2026-11-03T06:19:20.635Z","segments":[{"start_seconds":0,"text":"you know I'm uh I actually should have introduced myself I'm actually senior legal counsel at the near Foundation every time I hear regulation I kind of","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=0s"},{"start_seconds":7,"text":"wince a little uh so uh full disclaimer the Encon token is is not a security so I I don't think there's there's anything","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=7s"},{"start_seconds":15,"text":"to fear there um we've got our next session coming up uh social Lego blocks what boss o offers to web3 builders very","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=15s"},{"start_seconds":24,"text":"excited to welcome Eugene uh from proximity Labs up to the stage to give a presentation please welcome Eugene to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=24s"},{"start_seconds":31,"text":"the stage","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=31s"},{"start_seconds":40,"text":"everybody hey everyone um my name is Eugene I'm a founder of near social and","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=40s"},{"start_seconds":48,"text":"that's how all the boss started and today I'm going to talk more about what you can do on the social side","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=48s"},{"start_seconds":56,"text":"of this instead of just building apps for entire web so before we begin so that talk going to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=56s"},{"start_seconds":64,"text":"be mostly technical with a lot of visuals but um hopefully um you're all going to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=64s"},{"start_seconds":72,"text":"enjoy it so another disclaimer you probably want to know some Basics about how it all works otherwise you'll be","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=72s"},{"start_seconds":80,"text":"confused U but there's going to be a link at the end that you can use to get all the slides so let's get started so","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=80s"},{"start_seconds":87,"text":"first we're going to talk about um social components so what are actual","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=87s"},{"start_seconds":94,"text":"building blocks of a social applications and how they actually stored in the decentralized social","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=94s"},{"start_seconds":104,"text":"platform so first is a profile it's fairly simple it's probably the simplest thing you can do and behind it we have a","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=104s"},{"start_seconds":112,"text":"decentralized database that is unique and accessible by every single","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=112s"},{"start_seconds":119,"text":"user users so users can only store data under their own accounts and I'll show","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=119s"},{"start_seconds":125,"text":"how it works so there's a simple boss VM command that you can do to get the profile data so in this case you have","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=125s"},{"start_seconds":134,"text":"first request a command called social doget it takes the account ID then we say what you want to retrieve for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=134s"},{"start_seconds":142,"text":"example profile and then you um and then you get a double uh Asterix","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=142s"},{"start_seconds":150,"text":"to retrieve all the data under profile so expand the object you pass final to indicate the finality of this data and","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=150s"},{"start_seconds":158,"text":"finally just going to retrieve it from the server so it can do very large amount of data and the data you get in the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=158s"},{"start_seconds":166,"text":"following format it basically Json starting from the route where the first key is the account and then you get","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=166s"},{"start_seconds":173,"text":"subpass data so in this case profile and the all the information that we store for a profile so that's why it's very","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=173s"},{"start_seconds":181,"text":"simple it's just data that we store for a user for a given profile so there's","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=181s"},{"start_seconds":188,"text":"like image and it's stored as nft there's a description that user posted about their","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=188s"},{"start_seconds":195,"text":"profile and name and maybe a background image that is a hash on ipfs so the next thing is a graph so","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=195s"},{"start_seconds":203,"text":"that's how you keep connections in a social data so in any network you have people you follow","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=203s"},{"start_seconds":210,"text":"or like being friends with or you like and then people who follow you","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=210s"},{"start_seconds":216,"text":"back so in order to get this data you need um two things right we get data","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=216s"},{"start_seconds":224,"text":"from graph under a key follow for me and that way we can get who I follow and if","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=224s"},{"start_seconds":232,"text":"you want to get the data that who follows me because they cannot write under my profile I have to retrieve it in inverse and I'm saying who are all","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=232s"},{"start_seconds":241,"text":"the accounts that have a key under graph who follow my account if you execute it","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=241s"},{"start_seconds":248,"text":"we get the following so on the left you get pretty standard you get list of people who follow you and on the right uh you get","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=248s"},{"start_seconds":256,"text":"the kind of inverse object it starts with a account and then it has a bunch of keys indicating all right they follow","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=256s"},{"start_seconds":264,"text":"me and so on so that's how you can do okay inverse edges in a","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=264s"},{"start_seconds":272,"text":"graph now the next piece is a post so how people actually write anything on a social","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=272s"},{"start_seconds":280,"text":"network they create text that get in stored on a chain to get the post you go to a","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=280s"},{"start_seconds":288,"text":"specific key called post. main SL Main and you get the information and it start slightly different instead of being an","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=288s"},{"start_seconds":297,"text":"object which contains text type Ty and stuff like this it's stored as a string but not a simple string but Json","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=297s"},{"start_seconds":304,"text":"serialized string we do this because we don't want to store this data forever","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=304s"},{"start_seconds":311,"text":"and to store to decrease storage we want to override this data because on near protocol you only","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=311s"},{"start_seconds":319,"text":"paying for the data that is stored in a state so you don't pay for the data that was previously written and later deleted","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=319s"},{"start_seconds":327,"text":"so in this case that me message is effectively a single string that can be overwritten but how you get data from","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=327s"},{"start_seconds":336,"text":"the past right the the post that was before this so for this we have to go","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=336s"},{"start_seconds":341,"text":"back and we use indices so what is an index index is a specific key in the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=341s"},{"start_seconds":352,"text":"database that is getting parsed by the server so here's an example when you","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=352s"},{"start_seconds":359,"text":"post in new message you also write a specific key under a namespace index and","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=359s"},{"start_seconds":366,"text":"that key is in this case post so this post is an action and it should be again a just like serialized Json string that","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=366s"},{"start_seconds":375,"text":"contains two attributes key and value key is what a unique key that you would","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=375s"},{"start_seconds":383,"text":"uh aggregate data on so in this case we say just a Main feed and a value it can be any data that you want to store in addition","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=383s"},{"start_seconds":391,"text":"to this so every time you write into the index a server indexes the data and it","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=391s"},{"start_seconds":400,"text":"will serve you using the custom API called social. index so for example we say hey give","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=400s"},{"start_seconds":408,"text":"me an action post where the key is Main and we also filter by account ID and if","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=408s"},{"start_seconds":416,"text":"you do this well you get all the posted account ever written and the way you get it is","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=416s"},{"start_seconds":423,"text":"account ID a block height when it was created and then a value that was","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=423s"},{"start_seconds":430,"text":"specified so using this information you can reconstruct the feed basically now we can say all right","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=430s"},{"start_seconds":438,"text":"who was all the people that posted into this index called Main and we can","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=438s"},{"start_seconds":443,"text":"request it using command social. index how we do this","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=443s"},{"start_seconds":449,"text":"we always say all right now do not filter by the account ID and just give me everyone whoever posted anything but","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=449s"},{"start_seconds":459,"text":"make an order um descending and give me a limit at most 10 posts and here you are you get the index of everyone","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=459s"},{"start_seconds":467,"text":"whoever posted under their account Nam space and the values so that allows us to actually","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=467s"},{"start_seconds":476,"text":"create a feed of post on a main page still no custom Logic on a server except","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=476s"},{"start_seconds":483,"text":"for this magic indexing but makes it very powerful","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=483s"},{"start_seconds":491,"text":"now how we do likes so if you familiar with lens they actually don't store","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=491s"},{"start_seconds":499,"text":"likes on a blockchain so instead they like all right here's our server let's keep likes there we instead decided to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=499s"},{"start_seconds":507,"text":"store likes and without inventing anything custom for this we just reuse the previous stuff like storing data","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=507s"},{"start_seconds":516,"text":"either under your account or into an index so how we get the certain likes","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=516s"},{"start_seconds":523,"text":"for this we need to know what item was liked so we need to introduce items so","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=523s"},{"start_seconds":531,"text":"what is the item so in Social an item is effectively this structure so it","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=531s"},{"start_seconds":540,"text":"has a type so for example if it's social it means it's stored in the database social DB then it has a pass which","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=540s"},{"start_seconds":548,"text":"indicates where the data is written in the absolute pass so in this case a root. near is account ID Post Main is","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=548s"},{"start_seconds":557,"text":"the path and then a block height and a block height is when this data was created so this uniquely identifier a","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=557s"},{"start_seconds":564,"text":"post and that's kind of the a unique link that we will use for all the information so if you want to talk about","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=564s"},{"start_seconds":571,"text":"the post you would use something like this so now how we store the like uh we","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=571s"},{"start_seconds":579,"text":"do the following we basically say let's write a new index under action like and the key","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=579s"},{"start_seconds":588,"text":"going to be the item that you're liking so in this case this item is a unique identifier on a post we say all right","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=588s"},{"start_seconds":594,"text":"let's and a value going to be like and to retrieve it we use social. index we say all right let's give all the likes","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=594s"},{"start_seconds":603,"text":"on a particular key and the key is this object so if you execute it you get all the likes and when it happened and you","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=603s"},{"start_seconds":612,"text":"for every item you have like so what happens if you don't like the post from Ilia anymore well it's on a blockchain","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=612s"},{"start_seconds":622,"text":"so it's done and cannot be at done that's kind of a problem but","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=622s"},{"start_seconds":627,"text":"um you can fix it for this um let's just basically send the same index and say I","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=627s"},{"start_seconds":636,"text":"un like it so that will remove the L and but then let's say I liked it again so I added the like now instead of","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=636s"},{"start_seconds":646,"text":"1 items in previously I have 15 even so it means the same thing so to solve that","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=646s"},{"start_seconds":653,"text":"for likes I introduced an experimental API so give given an item it will retrieve you the list of likes","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=653s"},{"start_seconds":662,"text":"so it's not available inm instead we just fetch it directly from the server and you pass the data where the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=662s"},{"start_seconds":671,"text":"body consists of just a single item and it will retrieve you a list of likes so they're basically just a list of","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=671s"},{"start_seconds":679,"text":"accounts who like the post so that's very useful because now considering the feed consists of ton ton","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=679s"},{"start_seconds":686,"text":"of posts you don't really need to fetch an index for every post you can just fetch likes in","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=686s"},{"start_seconds":694,"text":"aggregate finally the simple stuff is comments and comments are like likes but","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=694s"},{"start_seconds":701,"text":"they are really posts on a given item so we let's see how it actually","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=701s"},{"start_seconds":708,"text":"implemented so when you comment something you have the following in your data that you","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=708s"},{"start_seconds":716,"text":"overwrite every time you comment you have an item indicating on what you commenting in and in this case it's a post so if","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=716s"},{"start_seconds":725,"text":"you commenting on a post you just indicate all right that's an item and then in the index for this item you also","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=725s"},{"start_seconds":734,"text":"indicated that you just commented so now if you want to retrieve all the comments on a given post you query an index if","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=734s"},{"start_seconds":743,"text":"you want to retrieve what was the post for which you created this comment","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=743s"},{"start_seconds":749,"text":"uh you you will read the comment by the item and then you can retrieve the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=749s"},{"start_seconds":760,"text":"parent and finally here's an example of the index of for a given post you request it and","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=760s"},{"start_seconds":767,"text":"you get the following so you get all the comments a final component that is useful on","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=767s"},{"start_seconds":773,"text":"notifications and if you remember in a social DB you cannot really notify someone directly because","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=773s"},{"start_seconds":782,"text":"you cannot write under their data so instead you have to write it under your account and they somehow need to figure","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=782s"},{"start_seconds":790,"text":"out that you made this um notification related to them to solve this we will","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=790s"},{"start_seconds":798,"text":"create a new index where the key is the account ID and we say notify so we basically notifying someone about an","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=798s"},{"start_seconds":806,"text":"action that I just did and you can read notifications from anyone so in this case for example you can read that I","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=806s"},{"start_seconds":813,"text":"commented on your post and then three other people liked so that's pretty much it uh from the Lego","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=813s"},{"start_seconds":821,"text":"blocks and to get used of them you can use a component that I started working on which consist of the all the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=821s"},{"start_seconds":831,"text":"different social components that I used for the main feed and if you go to this link uh it will land on a","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=831s"},{"start_seconds":840,"text":"component and whenever you building something in Social you can use this to figure out what is the component how to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=840s"},{"start_seconds":847,"text":"use it its properties and stuff like this I'll keep so I'll try keep it um updated over time uh but it's not right","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=847s"},{"start_seconds":857,"text":"now now a second part of this is actually how we build some new applications so we have a feed which","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=857s"},{"start_seconds":864,"text":"looks like a Twitter feed which has the following properties it takes um your graph people you follow","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=864s"},{"start_seconds":875,"text":"then it requests uh an index of post from these people and we just display","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=875s"},{"start_seconds":882,"text":"them in Reverse chronological order and then for every post we can get the likes amount and we can also get the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=882s"},{"start_seconds":891,"text":"list of comments and notification works so instead we're going to build an edit it's like a Reddit","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=891s"},{"start_seconds":900,"text":"Forum but it has a few differences from the main feed so it has to be Community specific so it's not only like one","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=900s"},{"start_seconds":908,"text":"single big feed but instead kind of have a communities in which people also um","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=908s"},{"start_seconds":916,"text":"talk about specific topics um usually it's sorted by likes","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=916s"},{"start_seconds":923,"text":"so when you go to the main page you see top popular post from the last stay for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=923s"},{"start_seconds":929,"text":"example and to get it a Time specific bound you want to Decay it by age so if","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=929s"},{"start_seconds":936,"text":"the post was like two days ago but received like enormous amount of likes it still can be at the top so we need to use the previous Lego","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=936s"},{"start_seconds":945,"text":"blocks in order to build something like this so let's start with a Fed so we'll call it n/","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=945s"},{"start_seconds":953,"text":"all and it consists of the post ordered by likes comment from different sub","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=953s"},{"start_seconds":963,"text":"medits and also based on their Edge age they going uh down in um popularity how","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=963s"},{"start_seconds":971,"text":"we can implement it so we'll use stuff that I just talked first we start with the index and instead of fetching just","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=971s"},{"start_seconds":981,"text":"10 posts we will fetch like large amount of posts and because it's an index we don't fetch every independent data so","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=981s"},{"start_seconds":989,"text":"the data is fairly small we're just fetching when they were posted and who posted them so we can construct","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=989s"},{"start_seconds":998,"text":"items and the key is a subnet so for Main feed we will use all and for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=998s"},{"start_seconds":1005,"text":"something else we use let's say nearon next we're going to do some","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1005s"},{"start_seconds":1012,"text":"JavaScript to convert this data into the items and the reason why it's a bit more complicated it because maybe you want to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1012s"},{"start_seconds":1019,"text":"repost it from one Community to another Community which is not implemented on UI but the logic is implemented for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1019s"},{"start_seconds":1029,"text":"this the third thing you want to do is fetch likes that's where the experimental API com into play and","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1029s"},{"start_seconds":1035,"text":"instead of fetching just likes for one item we will fetch likes for multiple items at once so for all post that we","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1035s"},{"start_seconds":1045,"text":"fetched in the first batch we will now fetch the number of likes and who likes them but we only care about the numbers","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1045s"},{"start_seconds":1052,"text":"and finally we want to sort your feed in order to display it so how we do this","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1052s"},{"start_seconds":1060,"text":"well we use the following we say okay how old is the post that's your age of the post and how many likes it got","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1060s"},{"start_seconds":1069,"text":"that's your score so we divide the score by exponentially decaying age so the older the post the less score it gets","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1069s"},{"start_seconds":1078,"text":"the the more likes it has the more higher the score is then we just sort all the items that we get and we can","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1078s"},{"start_seconds":1085,"text":"display them and that's how the feed works now another difference from traditional","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1085s"},{"start_seconds":1094,"text":"Twitter feed are multi-level comments and what is actually a","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1094s"},{"start_seconds":1100,"text":"multi-level comment it something like a comment on top of comment and and for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1100s"},{"start_seconds":1108,"text":"every comment on top of comment you can also apply the same algorithm we did for um the Sorting of the post so we get all","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1108s"},{"start_seconds":1118,"text":"the comments we sort them by like Decay them by time and render them in sorted order and now for every comment we just","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1118s"},{"start_seconds":1126,"text":"need to display a feed of comments under this comment so a comment is an item so let's just use it","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1126s"},{"start_seconds":1135,"text":"and here's just how the data would look slightly modified from before so for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1135s"},{"start_seconds":1141,"text":"every post we added a subnet item which indicates under which feed it was posted","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1141s"},{"start_seconds":1148,"text":"so that's very useful for displaying the post when you get a notification for it for every comment we also add a root","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1148s"},{"start_seconds":1157,"text":"item which indicates what was the post on which it was posted so you can display a full tree instead of just a","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1157s"},{"start_seconds":1165,"text":"parent or like having to recursively find a parent and finally um here's when you make an index","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1165s"},{"start_seconds":1175,"text":"you write it into two indexes instead you write it under the sub neted index and also all so that way you can get an","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1175s"},{"start_seconds":1184,"text":"aggregated overall Feit and that's pretty much it thank","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1184s"},{"start_seconds":1194,"text":"you if you have questions maybe I have time","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1194s"},{"start_seconds":1212,"text":"yeah all right so the question is why comments are not included in the score of post so that's actually valid uh but","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1212s"},{"start_seconds":1222,"text":"for this you basically just need to kind of have a big aggregation of number of likes to or something like this or like","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1222s"},{"start_seconds":1229,"text":"frequency how they were posted so that might need a bit more data on sorting this but probably possible to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1229s"},{"start_seconds":1240,"text":"implement or do you also want to build groups you mind ask yeah I can ask it again so is this nage idea going to","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1240s"},{"start_seconds":1248,"text":"replace the concept of groups or are you so planning to build on groups um well the social itself is kind","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1248s"},{"start_seconds":1258,"text":"of like a super app of different social applications so that's why potentially what you want is probably replace the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1258s"},{"start_seconds":1267,"text":"main feed um the groups are interesting concept as well but groups also make sense if you can restrict people who can","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1267s"},{"start_seconds":1276,"text":"control them so in this case current group implementation at least the hacking version was based on nft membership so if you own an nft then we","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1276s"},{"start_seconds":1286,"text":"filter on a front end uh um all the content only to the current members if you don't own it the nft then you can","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1286s"},{"start_seconds":1294,"text":"still write your data into social DB because no one protects from that but it's not going to be displayed on a feed","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1294s"},{"start_seconds":1301,"text":"because um whoever visits the official endpoint or like official app will have a filtering based on the","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1301s"},{"start_seconds":1310,"text":"membership so this um Reddit it also in theory can be controlled a private it um","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1310s"},{"start_seconds":1319,"text":"but that's a different topic that require either encryption or some kind of another Access","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1319s"},{"start_seconds":1329,"text":"Control yeah so based on your answer so do you see near social as becoming a social network or more becoming some you","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1329s"},{"start_seconds":1337,"text":"know place where people can go and actually find the components to create their own social network like what what the ambition for the future yeah so one","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1337s"},{"start_seconds":1346,"text":"a few features that differentiate neuros social from traditional networks I ability to embed applications directly","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1346s"},{"start_seconds":1355,"text":"into the feeds and posts So currently they like under strict white list and you can only repost the another post but","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1355s"},{"start_seconds":1364,"text":"you can imagine you can create applications that can be embedded in the main feed and that may be a mechanism to distribute the data","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1364s"},{"start_seconds":1373,"text":"um probably there are going to be some kind of main version of the near social which have more polished Feit but you","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1373s"},{"start_seconds":1382,"text":"would also be able to use different applications so once some kind of technical details I figured out around how to make custom notifications so they","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1382s"},{"start_seconds":1391,"text":"are not easily uh attack the or like cannot be used for fishing then it's very easy to create new custom uis and","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1391s"},{"start_seconds":1399,"text":"new custom applications so if someone want to like make a new app that just image focusing social network where they","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1399s"},{"start_seconds":1408,"text":"images on top of the post instead of on the bottom well maybe they will call it Instagram and build it on social as","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1408s"},{"start_seconds":1418,"text":"well um do you have any components that are related to safety or um moderation","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1418s"},{"start_seconds":1426,"text":"um yeah so currently um it's done on a user basis or a post basis so you when","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1426s"},{"start_seconds":1434,"text":"you render an index you can filter it by the people you hidden so if it's not like a Reddit","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1434s"},{"start_seconds":1442,"text":"specific where everything is displayed so for everything is specific you can also flag any given post for moderation","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1442s"},{"start_seconds":1450,"text":"which gives a goes to a custom feed that you can later kind of query when it comes to gmca takedowns and like some","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1450s"},{"start_seconds":1459,"text":"illegal stuff it's probably going to be deleted or like blacklisted on the server and you will not be able to request it when it comes to like","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1459s"},{"start_seconds":1468,"text":"building a custom UI to get it you will probably still get it maybe not from a official RPC server but you can get it","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1468s"},{"start_seconds":1475,"text":"from a blockchain if you run your own note any other","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1475s"},{"start_seconds":1488,"text":"questions um are you planning introducing any paid content uh private pay content for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1488s"},{"start_seconds":1496,"text":"subscribers so yeah yeah that's like currently in Works um but it's not going to be part of the main um experience","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1496s"},{"start_seconds":1505,"text":"that can be fully decentralized because private content requires encryption so you can probably build um easily build like peer-to-peer","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1505s"},{"start_seconds":1514,"text":"uh data that is been encrypted and Kary is a good example of this they built a private","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1514s"},{"start_seconds":1521,"text":"chat um but for like Mass adaption data you might need a separate server that will keep data encrypted and only give","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1521s"},{"start_seconds":1530,"text":"it for the parties that need it otherwise you run into a problem where you need to do key exchanges will not","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1530s"},{"start_seconds":1537,"text":"store data on a chain all right last opportunity for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1537s"},{"start_seconds":1545,"text":"questions here all right I think that's uh that's it for Eugene everyone give it up for","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1545s"},{"start_seconds":1553,"text":"Eugene the dream","url":"https://www.youtube.com/watch?v=UeHIMAjqerk&t=1553s"}],"youtube_url":"https://youtube.com/watch?v=UeHIMAjqerk","url":"https://near-pedia.xyz/videos/UeHIMAjqerk"}