{"id":"6Vx-gE5EFTk","title":"Friday with Frol Coding Workshop (Rust & NEAR)","description":"🚀 Exploring NEAR Protocol Development | DevHub Live - Rust Smart Contracts & Storage Optimization\n\nJoin us for another DevHub Live session where we dive deep into NEAR Protocol smart contract development using Rust! In this episode, we explore:\n\n📌 How NEAR stores state and how to optimize storage using native and iterable collections.\n📌 The importance of contract verification with reproducible builds & SourceScan.\n📌 Multi-tenancy in smart contracts – designing apps for individual vs. shared state.\n📌 Privacy considerations on blockchain and upcoming discussions on zero-knowledge proofs.\n📌 Gas & storage costs – how they impact scalability and contract design.\n\n🔹 Whether you’re a beginner or experienced developer, this session will help you understand how to build efficient and scalable dApps on NEAR.\n\n⏰ Timestamps:\n00:00 – Intro & DevHub Updates\n03:20 – Recap of Last Week’s Smart Contract Build\n07:45 – Understanding Storage on NEAR\n15:30 – Contract Verification & SourceScan\n22:10 – Rust Collections vs. NEAR Custom Collections\n30:50 – Optimizing State with Iterable Maps\n42:15 – Multi-Tenancy in Smart Contracts\n50:20 – Privacy on Blockchain & Zero-Knowledge Proofs\n55:00 – Gas & Storage Costs: What Developers Need to Know\n1:05:00 – Q&A & Closing Thoughts\n\n💡 Get Involved & Start Building:\n🌍 Explore NEAR DevHub: https://dev.near.org\n📨 Subscribe to the DevHub Newsletter: https://newsletter.neardevhub.org\n💬 Join the Developer Chat: https://t.me/neardev\n\n🔥 Want to build on NEAR? Join the Redacted Hackathon with $700K+ in prizes: https://redacted.devpost.com\n\n🔔 Don’t forget to LIKE, SUBSCRIBE, and hit the NOTIFICATION BELL so you never miss an update on Web3 development!\n\n#NEARProtocol #Rust #SmartContracts #BlockchainDevelopment #Web3 #DevHub #Crypto #Hackathon 🚀","channel_name":"NEAR DevHub","published_at":"2024-10-25T00:00:00.000Z","thumbnail_url":"https://img.youtube.com/vi/6Vx-gE5EFTk/hqdefault.jpg","transcript_text":"oh want want want what you want what want what want what what you want what you want what you want what want love me me what you want what you want what you want what you want you want what you want what hey hey oh n gmgm hello hello it's amazing to be back every Friday we have this show now and um I really excited um there has been a lot of positive feedback last week and uh it's going to be again uh very casual um hopefully very interactive so if you have any questions um go to uh Twitter twitch YouTube any platform of your choice and uh feel free to join the chat and ask questions away uh and uh just a quick recap last week we started building this uh small to-do app uh in R um built on chain so we have the our to-do items and the uh rules of adding and removing to do uh fully scripted as a as an application on chain on near um that is uh that is where we will start off today I will quickly recap what we did last week and Uh I promis that uh we will dive a bit deeper with this topic uh this week so want I I want to cover the topic of uh rust collections versus near like near custom collections topic uh and I will also try to cover the multi tendency setup because currently the smart contract is uh tailored towards B basically maintaining a single uh list of to-dos so we can anyone can add to-dos to the list right now and anyone can see them um and anyone can you know rearrange and the last but not least is a privacy topic I think I will only have time to briefly mention it today but there was a pretty nice discussion um with u Sandy from cero uh who wanted to join uh and talk more in depth about this topic for blockchain space it's a it's a hard topic so um yeah and I will also I would love to invite Joe at some point and I want to also beat make it very uh obvious that I'm not alone here and it's very helpful to have the community behind us and behind the the whole initiative of devhub and the and Jo helping us to organize these calls organize de Hub life and many other um um events uh online events in near space so uh that's amazing and obviously he's also building on year so there will be a lot of wisdom uh and potentially questions that he can uh ask can slow me down when I'm going way too fast with no context because it's obvious for me uh so it would be great to have um more folks uh voice in it but also yeah don't hesitate to ask questions in the chat I I hope they will appear on my screen so it will be reacting to those cool uh where should we start uh let's start with the with the short recap uh of where we were standing so I created a uh a new project last week using cargon extension so if you go to cargon GitHub page uh you will find a way to to install it uh it's super simple just choose your platform where you're using it and then cargo space near and you will be you will have all the uh nice subcommands cool H after that uh it creates basically like all the boiler plate for the um pre-standard uh rust project with just uh bit of flash to it with reproducible builds and stuff and obviously with the latest ASD case actually latest is 5.5 already but it's uh uh it's fine for us for now uh we also covered so we build the contract the very basic version of it and we even had a test added to it the unit test um we didn't cover the M20 tests I'm not sure if we will this time we'll see but nice part about it also available uh over the shelf and you can basically run the full local uh local net blockchain as a Sandbox environment and then compile deploy to it and do all the stuff with the with your control there um and uh just to remind you the interfaces there uh is there was the contract that is the root state of of the application basically um the we had a list of todos in the form of hashmap and we had a uh an identifier for the next to- do um we want to store um so um we also discussed that uh yeah there is a to do item with with it status completed rending um and uh we added the methods to initialize the uh State and add the new to-do um currently as you can see anyone there is no no uh checks who can interact with the contract so anyone can anyone can spec call the method add to do and we will just obey and uh insert the to do in the list but it could be easily changed and add we can add owner with the contract and we will uh stly Define who can U like anyone can call the method but they not every request will be fulfilled so uh that's it then we also introduced the um list listing that do um they are all public so anyone can list our to-dos also permission list uh we can change it to the status um obviously um currently there is no safeguards who can change the status not very helpful in a way but at the same time why not uh so it's up to us to Define all those rules and that that is why the applications on chain um were initially called contracts so we kind of defined the contracts uh like legal contracts uh with code and since the execution is not controlled by any one party um that becomes a contract that is uh um controlled uh and ured through the um not through the lawers or um bureaucracy but through the programming code and the decentralized network um that has certain rules um that the network has to follow otherwise the notes would not be uh reward it would not be part of the protocol so there is no real point to not follow the rules you would not gain any anything out of it cool and today just uh so and and know how it worked uh so we did Caron near and we buil bu and then deployed the contract uh I think it was I'm using visitor um let's let's check uh so I will go to near blocks to yeah um as always um if it's live it will go wrong on and all your all my attempts will be blocked at any point with unknown errors look me BLX is already not floting for some reason let's see um if the lightweight Explorer works test net uh yep great uh single access key 10 year see um we don't have the history transaction on the lightweight dixer seven days ago that's exactly last Friday so yeah let's uh let's keep going Hey Joe what's happening oh a lot of stuff a lot stuff yeah I I I'll just let you let you go and I'll chime in as as it makes sense amazing yeah thanks because it feels more a bit more uh relax and human to me than just monologue yeah for sure so the I'm using visitor testet is the account that where we uh wanted to deploy the and we deployed the contract last week uh we not sure if we used the reproducible build last week let's check so going to contract uh I can see contract code and it seems like it was either not uh contract Source metadata let's quit it okay we actually buildt it with the reproducible build um details but I think uh the um Source scan only uh was enabled for test net right after the call uh Let's uh I I didn't try let's uh let's see if we can um push and ask it to verify our contract what it does behind the scenes it basically reads the um the data the um the it makes a view call to my contract um which one you may you may ask so let's see uh contract call function as only uh I'm using viser um and the name is this contract Source metadata and uh no parameters you need to specify there so and it's testet yeah latest data so this is what um Source Canan basically pitches and as you can see in the in the output of my cont there is a like baked in uh hardcoded metadata uh that is very helpful to that allows the anyone to pull exactly the version of the code exactly the um the build environment which is a Docker image and uh well given that we use it from the root of the reapo the contract pass is just blank meaning root and uh um with the command carger built inside this built environment uh in this working directory with this source code it should re get exactly the same basm file and this is how it then confirms that Yes actually the source code matches and if so contracts verifi successfully that's what you will see um there's a lot of uh work behind the scenes has been done to enable all that um and I'm very happy to uh to see it live on testnet as well as you can see we can we can now clearly see the exact smart contract that we are dealing with nice so why just so for people understand a little better why is this important and you know and as we talk about interacting with blockchain and stuff like that exactly well very good question thanks for resing it right away the the reality is that as as I just mentioned in the very beginning the applications that are on blockchain are called contracts why so because they uh can guarantee certain rules and uh uh certain logic and yeah g game play in a way of the um of of the interactions so you can Define that anyone can add it to do or no one can add it to do or uh only some people with some amount of tokens Can Do certain things and uh for this contract to to be you know um truthful and that what the one that you can rely on you need to verify that the the application that is stored on chain is actually the one that you that uh you believe the contract like is written uh like text reflects of and the um the smart contracts on here are uh basm files so they are web assembly uh binaries so they have U just Pro program code that you deploy to the chain and not the source code and this means that uh it's like it's not for humans it they execute efficiently it works beautifully and fast but and but they but you cannot really read that code you cannot read that contract anymore so what what we what this feature is about is how to link back the uh binary that is deployed to the and published to the blockchain uh back to the source code that is is more human readable and we can review it and understand the um intricacies and rules that are defined in the program and this is why we need the source code but the the challenge is uh you cannot generate the the source code back from vasm file anymore uh and the source code is decoupled from the uh vasm file overall uh so our only way to get back to to the source code is actually confirmed that if we build the source code uh if we build the basm file from the same source code again and get exactly the same B file that means that the source code matches the the the bom file and a way to do it is to um well I can I can I can now based on the um uh based on this um in information that is picked into the vasm file I can reproduce the like I can can literally get clone uh carger build in that folder and I will arrive to exactly the same results and if if so I can locally verify it what this UI helps helpfully U like how this UI helps us is that it does it behind the scenes automatically for us and just publish the the results here here that's why you can see the drop down here it's not just one source uh the uh you you can become another source of validation in the future I'm not sure how uh exactly you can uh join the program here but I'm sure there like it was designed to be U verifiable through several lenses they they will do exactly the same process to produce it and they post the result into the smart contract in this case and this this is this is where so in ethereum if you come from there so people have always asked like why can't we see the contract code just like you could and ether scan right so this is kind of giving that same thing but at the same time it's also essentially signing off on that this is the right person who said this you you know I almost feel like this is a step further because there is a source that is validating what's there as well to match that up yep exactly cool and uh it's it's all about tooling and the features so we could imagine that the source code would be published like just like in etherum world we could publish the I know zip Archive of R project onto uh near but then the node would the validator node would need to do an expensive compulation step and each note would need to do that and you would need to strictly Define the build environment there um so that's why the near protocol decided to go okay well just upload the VM file that is good enough for us and solve the problem of verification and ensuring the match of the source code somewhere else and this is yeah was uh the pain point that Source scan team identified and they pushed for it uh for over a year and uh finally we have the the fruits out of this tree and it's uh amazing yeah very cool cool yeah um so let's uh let's talk about this uh topic of why standard so well let's go back a bit so here not here in our contract State we currently store toos as a a r STD collections hashmap uh story um object and this means that uh we basically store them in in in a in the same blob of memory and we serialize them all at once so every single time the application uh is uh a contract is called uh um a function call is executed the um the self the contract storage uh State should be uh de calized and then only then the ex the the function will be executed and then after after we return from the function these changes made here will be calized back again as a single Lop of data data and stored onch so in the essence uh actually if we go to uh nearest RS and uh open the I want to open the test here is DEC um compilation test no test um maybe not it this one should work that's one but I want to have a call generator maybe not the best way to demonstrate it after all where is test sorry about that quickly open the test here we go so the there is the uh test case in near DK RS and I think it's very important to understand the this this bit of U thing because that will just open all the doors going forward um this is a test that uh tests that that uh verifies that what the code will look like after we feed it into the near macro so the public method with the name method and self and uh K as a string uh so this is one parameter and uh for example no body in it uh we'll end up with uh so after the uh code generation step uh we want to see what's um actually inside and on the last video on Friday I showed you this beautiful instacrate uh that generates the snapshots and uh stores them so if we open X basic Json as basic Json file this is the source code the rust uh code that is generated for the uh function call so it generates a standing Standalone um function here shouldn't be X I think it's this this this is fine the our our parameter is is simple int um don't worry about the changes so what it generates it generates a a method so it's a a function a function method with which is uh marked to be no man goal C uh and only for Target VM 32 uh all you need to know is that this method just becomes part of the public um public exposed methods of the basm binary that's all it does exactly with this name so it doesn't change it because usually compilers will change it for um for the reasons to not collide with any other method with other functions uh in the user code in this case we want it to be exactly this name uh what it does next it does set up panic uh who but it's also not important here uh it also generates a struct uh it's easier to read it if we imagine it's actually top level imagine it's here so just a struct uh called input uh there is only one parameter and we apply s um Set deize uh derived to it what we do then next we call the nearest DC uh input function and with we try to um and and and it will read the um the the value from the state uh it's local state of the application and deserialize it uh for um uh from Json in our case because we use S uh into input and if the result so if input uh is there it tries to Ser deserialize from slice uh the input string and if it's successful if okay then it returns this this realized value otherwise it will just return the error that you see in the uh in the smart contract when you call it we can already test this one so failed to distalize input from Json where do you see it uh you call any contract in fact uh built on uh with nearest D KS um so let's use my contract uh let's uh call list to do we specify instead of Json RX Let's uh use this test text arcs so it's free form and we put some nonsense here uh what we expect to see is exactly the error I just showed to you okay so given that the function doesn't care about any parameters that they just ignored it and let's use the one that uh add to-dos for example uh contract call um add to do uh we do not comply with the uh uh with the Json requirements so as you can see failed to deize input from Json exactly the string that we see here so this is exactly the code um that takes care of it so they the function at to do was wrapped and this was the preparation step so it pared the input parameters first we have the input now uh and now we have the one more line let's get back to it in a bit and after that line we have the hello so our contract uh and Method add to do executed right right right this way and uh we pass the contract we will come back to it in a bit this is this line and K which we just pared from the input uh so this is this is nice part what's contract contract on the other hand so contract in our case um it's a what do we do here we call nearest Decay EnV State read and then we try to uh if if there is an error we just uh call default implementation to it so we we want to generate a contract so basically calling contract default method uh if there is no value there yet but what what state read does we can look it up here R state is very thing very small function where is it uh St State read sorry uh State read so State read what it does it does storage read State key and if there is an error do something and not deize blah blah blah so it tries to to to deize it at once whatever it it read from the key State key what what is State Key State Key State key is just this string State huh let's let's look into it actually so near uh contract you can um view storage uh amusing visitor and uh yeah which uh keys do we want to see in the storage all and let's present them as text for now so it says that there is one key in the storage State and there is a nonsense inside um so this nonsense is actually B serialized uh hash map of um probably two values if I read it right each like there are two keys one key is test to-do app and another key has a to-do of test to-do app from CI um so before I want just kind of help clarify some things here too so part of this in the way that state works on near is that so contracts are upgradeable right and so and we can they really truly actually almost act like a database because I can read write I can remove essentially remove content because I'm changing my state right I can even change the structure of my state I can actually upgrade my contract to have a different structured straight so this basically is one of the unique properties here that is how you can start to leverage a near contract to really serve as your back end right yeah so that's one aspect and also the like this allows us to to hot swap in a way the the code at any point in time and it will continue using exactly the same data that is already and you don't need to like well if if you need to update this the data that is in your local storage that's up to application so your your contract should take care of that but if your app is only changing you know the rules who can interact with data but not changing the layout of the data then no changes to the data so-called data migration is not needed um yeah but what it all like what I was trying to show here that basically on every interaction with the um with the function uh the deiz of this state value happens and then after the end um I think it's not in this example uh no return there is there should be so value return this is another thing that we didn't cover so when we we call the method we want sometimes to return something and this is the code that adds the the added basically um so it gen uh serializes the output as Json to a vector of bytes and then calls a host function value return but what's uh more interesting um uh is this thing so basically uh if if your function is uh mute has uses self as mute uh the the code that is generated for for your contract is uh has this line at the end so it executes your function and then it uh calls a state right um to to to to to to store the value back uh and the value is your contract uh structure that is calized to borch and then bytes are stored on chain and this means that the bigger this thing is the more compute power is required and uh if you have thousands of todos you will have a bit of a problem here um and we have a very good documentation in this uh uh in nears dek uh collections or actually not I think it's in store on how did I here in store um maybe the look up how come eable not as prominent as I would expect it to be honest let me find it on the cute site somehow we is it the latest it's latest store module should be there will need to fix it but um uh we do have the documentation we do have the benchmark which shows that after a certain amount of uh um records we see a degradation and performance and uh it will in like the the growing number of uh Records produces more and more gas uh that is like the that's equivalent of uh uh compute power that is required so after uh what after 1K uh we have if if we only use the contains oops did I did my sharing the screen failed yeah went away give to re add it there we go yeah so after like 1K you already see that native so before 1K uh the um if we call contains on the collection contains is like is there a key in the collection um with if the collection has five 500 elements in it and we call if it contains number 40 for example uh Native collections give you uh will require more compute power but not not substantially more but uh going from after uh 1K elements it it becomes even more obvious it's uh there is an overhead and with 100K uh elements in the to-do list of these are just integers uh if we have strings it's even more P penalty there for sure uh we already see this gap of uh um access to the data and confirming that it's U um just doing this basic operation basically uh and that is because we uh we encode the we we have to uh serialize and de ize this state at every function call we interact uh as as through a transaction or called started uh if interact internally like if if the if the contract calls its own function within the same uh transaction there is no penalty on that because there is no uh um cationization happening but when it's a cold start it does require to initialize the contract State the memory and this is the the the the the problem you may face so in our case go ahead I I was ask a question but actually keep going for a minute then I think I meant question for yeah yeah so in our case we we do have like until we have I I would say a a thousand of to we're good how many of us do have uh one k to do list benchmarks uh not not many right so sometimes makes a lot of sense to actually use just PR native Collections and it wouldn't be a huge problem but if you are building for example nft or AF contract where you need to keep record of a Unbound list of uh Records and that could be Millions potentially if you're if you have a successful nft contract um or ft uh and you have bunch of users then you need to use um these Collections and how they how how what what's the magic there there is no magic behind that uh they they just use the um individual uh uh storage key so local storage uh that you can uh use as part of the uh near API we you have two methods read State read and state write and state exist if you like so so these are the the functions that you can use you you just uh oh hold on not State um Storage storage right and storage read and storage remove these guys so storage right expects you to get give a key uh as a bytes array and put a value as bytes array so you can put the like this is how you can use it similarly uh to read the data back just use storage read you specify the key and you get the value back uh so the the those it iterative uh Set uh lookup set lookup map all those uh store collections so in store here the key store we have a bunch of them so for maps for sets uh and for just uh some values that you that are big and you don't want to put them immediately uh so you want to keep them as a separate key that's the way uh and Vector obviously as well so these are just a small uh wrappers around the um uh the those re storage read and storage right operations if you want to understand uh more in depth I I would recommend you to check out the deprecated collections implementation it's much easier to uh to understand so if you go uh lookup map for example lookup map and go to the source directly it's really not that big as you can see uh those are tests so the whole implementation is just 200 lines uh and what it does uh so it it has a method it has a method for example contains or like or G get get let's use get as an example get is just a get RW which um is a method that returns expects a key is is a bite array and returns you a bite array and it just serializes the key and de serializes the value that's all it does uh under the hood uh so you don't like when whenever you store objects so the collection is just a uh it knows the types and can cize andiz the values of those types yeah Joe you wanted to ask something yeah I was going to say like so one of the things that I think comes up is you see these limitations here but obviously we can deal with a lot more data right so some live examples are like where the ne near social contract um the nft contract that we have on Shard doog has uh a ton of data in it so what is actually happening and how are we able to actually uh program around that those limitations yeah let's let's maybe uh jump into a quick example here um this one gear uh let's uh let's change the the collections here so let's uh let's use nearest DEC store uh iterable map and see what it will actually requires to do uh so first of all it will fail to compile uh it will fail to compile because we have the initialization code here okay uh here we need to use also obviously near SDK uh store iterable map new instead of hash map but also it will fail to compile because it requires a prefix and this is a uh thing that think we need to maybe STP for a bit to to think about what what this uh prefix could be used for and why it's here um as I said the these collections are using read key read storage read storage right operations and they basically just expect the key and value uh like the the keys they they share the the same uh they they they use the shared um local store storage of your application so if you have several uh collections how to distinguish the keys inside those um there is no way uh for the up to know that's why we need to prefix all the keys this collection will use to store the um on on the local storage uh with the with the specified unique key so in this case it could be to do um uh let's prefix it with just simple t uh let's see if to do um and uh this way it will compile and we can already deploy it uh car near there will be another problem not this one so this one is about reproducibility so this is uh um is complain that uh um the changes are not committed to get that's why it cannot actually um incude the reference to the exact source code I had to disable it for now uh um just to speed up things um in production I do recommend always to deploy with uh reproducible builds uh and another question that it asks on deployment is will we need to initialize our contract again and our contract is already deployed and the state is already there that's why we don't want to initialize it uh and while we do this let's see what will happen um we'll hit another problem uh another not on deployment deployment went fine it's all great new version of the application is there uh but we whenever we will interact with the with the contract uh contract all function read only um my contract for example list to do no parameters yeah it's it's all great for now now it it panics uh and it says cannot deserialize the contract seed uh and that is exactly the problem I I we discussed just a bit ago uh with show that when you deploy the code uh you can rewrite update the code uh but the and and while keeping the data right there so the data uh contract view storage on this account yes viewing all the keys test not yes now data is exactly there like it's it still too uh two Tod do we added last week nothing has changed but the code has changed uh and how exactly has changed now the the contract State um uses a different collection and this different collection has different way to calze the data so how do we fix it so there are two ways if we you need the data to be um uh um to be pres preserved you need to come up with the function in your contract to that will be allowed to be only called once and only by by you probably or by the operator uh to that will take the old data format and put the new data in new format in the storage uh in our case for development purposes right now uh I will remove the account and recreate from scratch uh in the um in your case uh so if if you want to dive deep into this topic I can recommend you to check out the devhub contract uh there is a lot of um interesting ideas already put here so there is a migrations RS file uh which handles all the previous iterations as you can see we migrated from versions to versions to verions adding more Fields adding more um like details to it and there is a code uh that reads the state and then applies the changes somehow mapping the changes and then uh storing them back inserting state right uh so this is the the place you can um learn more about more complex way uh building the migrations uh for the prod apps um in our case I I will probably just actually create a new Dev account um for testet yes create um and we'll deploy the code there also for our reference to uh um to compare here I would say um likly make what oh it's not from here not deploying the nears obviously sorry lost in Windows let save deploy yes and in this case we do want to initialize it because uh we like this is brand new new new account new new contract so we need to call new with no parameters and it will initialize the state value uh let's do that with ini with init call um no parameters no changes needed really sending transaction boom it's there super fast let's compare the um the state Let's uh view the Storage storage of this new contract all keys s tax on testet now um you can see that the state is there uh there is this T and TV and TM so actually the underneath of the um iterative iterable map there are two Vector implementations uh one for keys and one for values but you don't need to uh really care about it but let's uh let's add something to it now so uh call contract as transaction uh this is contract that we want to call we want to call add to do uh we want to provide the parameters uh text is a new um um near is the case for uh and that's what we are adding here so this hard to do nice let's see it here just to make sure that I had to do was called with this text nice um everything is fine and we can view the store now contract new storage of this account is text now cool look now we have three keys so the key of state did not grow it it actually remained the same but the the new keys were added so one key is this nonsense there uh let's get to it bit later and there is another key um and if I like I can read it because I I'm used to to to be a machine um but the the reality is that there is a TV is just a bite prefix these are also bytes and as you as you can see there they are zero bytes so the these are four bytes which actually represent the um to do ID which is u64 u64 takes four bytes and uh this is what we see and the very first to do has the bite uh that has like number zero and this is the uh the very first to do and what it references to it references to the uh to the key in here uh what this thing is happening here I'm am not particularly sure right now I will need to um think a bit more about it uh but this is our text to do so this is our this is our to-do struct serialized to porch to-do struct is a string and a status string is seriz in bch as length so four bytes of length of the string and the string itself and then the to-do status is the enam which is just a I would expect it to be one bite but let's see uh so going back um this is our length so it's 18 characters uh new this is this is a string I assume it's 18 characters long um maybe it's plus one bite uh and the and the fine and then the um the status that's probably how it's calized there um you don't need to parse it this way usually uh it's there just like I I just wanted to show and present you that there is no magic behind it just literally it just has it there um if you need you can but you usually don't need it um and uh but the like back to the question of growing number of elements um so if we go and call function as transaction again add another to-do text another to- do we will see that the state will not um let's uh copy this handy command the state key remains exactly the same uh actually it does change I forgot it actually keeps track of the number of elements um so we know that there are two elements so the state is updated but it's only updated like just see like increment in number right there and the individual records of todos is stored separately in the under unique uh Keys awesome so yeah well um there is a balance uh of using near Collections and Ras collections ideally I think we need to come up with even more balance type of collections where we can batch um I don't know hundreds uh elements into it into into one bch of under the native key uh in near and then it would you know get benefits of Two Worlds um the best uh so far we don't have the contributions um on the direction um but I think eventually we will arrive to it with even more usage and even more optimizations needed I think some of the projects already implemented it on the application Level but it would be beneficial to also implement it on the um SDK level um okay I hope that is more or less clear uh if there are any um questions uh should them but I want to briefly touch uh these two topics um multi- tendency uh um So currently we have the um anyone can add the uh to-do to the um to the list the to the to the shared list of do so in order to make it and this means that uh with more users you will basically reuse the same list of to-dos not very helpful but what you can do you can you can you can approach this problem uh with two ways one you can you can say that okay this contract only uh belongs to one owner ID uh so only the owner who will initialize the uh who will call the new method only that user will be able to uh to use this uh contract or you may say there are owners so it's a vector of those people and you can add methods to who will be able to interact with but those owners will still share the the same list of to-dos uh this is what happens with uh um with NFS in a way like nft contracts uh on near uh usually use this approach and then you uh but then you need to keep track of the also like owner in the in each Todo in each nft it could be nft could be to um and then you need to verify whenever somebody wants to change something about the text or status of the to do you need to just first verify that the owner is the right person or you you verify it on the top level of like all todos only belong to one owner or list of own owners and then you basically how you scale it you deploy the same contract to multiple accounts each user needs to deploy their own version this approach uh is used by Sputnik Dow Dow tooling usually so the Dow is uh has the like controls of who can interact with the with the contract what are the rules uh so you add the proposal you act on the proposal um but the that's a shared ownership of something inside so the the Dow usually uh has like tokens U sent to the Dow so they control the um token allocation um and all the people who can do something with it only them can you know Define operate with in the logic um another approach is the like nft approach I'm going back is when there is only one contract and there is no owner so there is owner for like upgrading the contract per se but overall there there is an owner on the individual uh element and then each operation just requires you to validate if it's allowed or not and then you deploy it as a single contract you don't need many of them unless you want to sh them uh and this one contract needs to be um like it needs to control be be very carefully scripted so the only owners can operate with these entities and nobody like so it's Bren cons of each of the of those approaches um when you have a contract per team per person it's more expensive because you need to deploy the contracts over and over again for like all your needs or more more each individual user will need to deploy their own version but they are in full control of the uh of the version of the code of the um operations it can handle whereas with shared contract you have the limit of uh like there's probably other no updates possible at all like you don't want to anyone to even have control over that process or comers there are some risks associated with that the risk is the upgrade will be variable the risk is the upgrade will be broken and the contract will not be able to to to return you any values anymore uh and you will need to quer the data back in time and you know restore it from there and maybe create a fork of that contract so there are challenges uh but they are overall um reasonable and just like challenges over the software engineer world they're not like unique for near I would say it's it's about hosting website either it's you know is it a a Facebook where everybody comes and single uh platform and the users are co-hosted there or it's a it's a like web where I have my own personal landing page Joe has his own personal Ling page we have different domain names but we could use the same software to generate those pages like static generators or even you know Facebook as a software if it would be possible so nothing unique here but I just wanted to highlight that uh you need to pick your type of uh um cure here one piece might be I think though is different that people might not be used to if they're new to blockchain is the concept of storage cost because and so in your scenario there's a couple things that can happen here where if it's a shared contract the contract owner could cover the cost for everybody and all their users there is a way to do that um but you can also have the end user also pay for their cost of their own storage so that's something too that is a consideration in both your uh contract design as well as like did the of like again is it a single contract is going to be multiple whatever that starts to look like those are considerations now with the to-do app it's minimal it's minimal data um but it can get larged pretty quickly especially if you deal with even just nfts and like larger metadata uh it can certainly grow faster than you think that's true absolutely and this is a huge topic to discuss as well uh the the gas and the storage costs and storage in general um like it's there's nothing free in the world and we need to like computers ex like computers is you know costs money uh storage costs money traffic costs money um and like well not not only cost but it's like it's it's a work some systems are doing and they there is it's energy uh that's why you usually we um measure it in in gas points like a reflection of energy points um totally probably good topic to cover maybe next Friday we'll see um on the Privacy topic I I will only cover it uh briefly Joe are we um in touch with uh with Sandy are we ready to to think we're good to go for next live next Thursday next Thursday uh 400 PM UDC right we'll have a huge debate on the Privacy Topic in the blockchain space but today I want to say that it's it's it's fairly simple and fairly complex Topic at the same time uh so privacy is like there are many faults to it and it's it's well it's a deep dive on very like on the number of ways how things can go wrong on the um protocol level on the application Level and everywhere in between um the one thing that I want to um say in like the GetGo if you don't want something to be on the internet don't put it there so if if if you put something out there you need to be ready for for the fact that somebody can read it even if it's not blockchain but in blockchain it's it's just more obvious and clear that whatever you put on the blockchain it's public so the what you need to consider uh that these uh to-do lists to-do items uh will be available to everyone in the world um immediately in in one second after you publish the transaction in three seconds it will be finalized uh so it will be you know carved in stone uh the however it doesn't mean that uh the data has to be uh plain text and this is the where cryptography is very handy uh what you can do you can store encrypted data so instead of putting dat to do to do items is encrypt as as plain text Data like plain text you can put them as uh encrypted uh blob of data which unless you possess the key to the Crypt you cannot read uh and uh there is a huge challenge with that still because uh with advanced in uh in compute power uh we still face the problems of okay uh what if today we cannot decrypt it uh that easily without the key how about in a year in 10 years um do we care about that and what do we do with that knowledge so this is hopefully the debate we'll have with with Sundy next week um what are the solutions to this problem um um overall for some use cases I would say that it's totally fine to keep the just encrypted data on chain total totally reasonable use case I actually played around with it uh for um certification programs so the uh if you want to give a some sort of certificate to you to to to a user and you don't want to reveal their their uh personal information that could be a good way to go um so they can decide who they share the uh certificate with and that's a sharable link should just include the uh the key uh to the crypto data uh it was a nice cool experiment uh and uh it works very well uh we just need to probably to have some Primitives uh that uh make it easier to work with this direction um yeah I think that's uh all for today that I wanted to cover um is there anything in the chat that we want to discuss as well no no nothing today I think um this is I like the the pacing that we're going at here though of putting all these pieces together here and uh I want to remind people who are watching this that you know it's better to kind of go if you didn't watch one from last week watch that see how it connects here with this one and then we'll keep kind of building from there because the better and deeper understanding you have of how this all works I feel like it's easier to then go build on top of it um so that's hopefully what they're getting from yeah yeah definitely to tooling on near makes it very easy to Deep dive into very neat details of many things uh still you need to know what exactly you want to look at I would imagine if you just randomly stumble on and into view storage and open this nonsense especially of a bigger contract you would have no idea what you're looking at I hope today we uh uncovered this mystery and it's now we all can be machines and read it absolutely perfect awesome H know this is awesome so let's just remind everybody so um this is Again part of the redacted hackathon workshops but we're going to keep going through even after redacted is over uh you have until the 31st to submit uh to the hackathon which we are you know really excited about there's over $700,000 in prizes here uh almost at, 1500 participants so it's really exciting there's tons of stuff you can do you can stack bounties uh so take your time and go through that uh again everything you're learning here all coincides with what's what's available there if you are able to go interested in going to the uh actual event in Bangkok uh there's still some time to sign up for tickets make sure you're doing that that's coming up really fast here can't believe we're at the end of October already but uh yeah just keep building come ask questions uh we are available as as devhub and as as developers in the different telegram chats let me pull those up real quick uh for people so they can see those as well yeah and definitely subscribe for the newsletter there is a lot of uh yes cool ideas shared by developers we collect all of that together recently there was a C library to interact with the with near blockchain so you can use it on your you know router on your network switch and uh yeah yeah the possibilities here I mean there's just so much that's going on and uh we really want to encourage everyone to build as much as possible um so ple please do so uh I thought I had a easy Banner here but let's uh it's just simply here ah yes R SL let's not forget about that you want to talk about that really quick yeah well uh it's a fun way to contribute to the open source um as you go no no CH major changes to your flow you just create a pull request you go and tag Ros loss account um and uh um you will be greeted with a with your nice uh um beige uh with all your achievements so far and the maintainer would be helping you to collect the SLO points by scoring the poqu you create with just it's just a reflection of kind of U value and uh complexity of the problem you tackle overall I think all the contributions are valuable uh but still like it's a bit of a gamification process here that you can um you know um add a bit more source to your day-to-day um yeah absolutely life yeah for sure for sure yeah so check that out uh I added the link to the telegram chat for developer support on the screen so guys check out that as well come in ask questions no bad questions you know between the Devils here through devhub as well as just other builders in the community someone's gonna be there to help you and answer your questions and so Jump On In uh we hope to see what uh you guys are building out there so again uh we'll see you we'll be back next week um but until then uh keep hacking away we'll see you then by now amazing see you","transcript_synced_at":"2026-11-03T03:57:50.160Z","segments":[{"start_seconds":24,"text":"oh want want want what you want what want what","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=24s"},{"start_seconds":34,"text":"want what","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=34s"},{"start_seconds":86,"text":"what you want what you want what you want what want love me me what you want what you want","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=86s"},{"start_seconds":92,"text":"what you want what you want","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=92s"},{"start_seconds":144,"text":"you want what you want","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=144s"},{"start_seconds":153,"text":"what hey hey","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=153s"},{"start_seconds":180,"text":"oh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=180s"},{"start_seconds":212,"text":"n","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=212s"},{"start_seconds":246,"text":"gmgm hello hello it's amazing to be back every Friday we have this show now and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=246s"},{"start_seconds":254,"text":"um I really excited um there has been a lot of positive feedback last week and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=254s"},{"start_seconds":261,"text":"uh it's going to be again uh very casual um hopefully very interactive so if you have any questions","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=261s"},{"start_seconds":270,"text":"um go to uh Twitter twitch YouTube any platform of your choice and uh feel free","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=270s"},{"start_seconds":277,"text":"to join the chat and ask questions away uh and uh just a quick recap last week","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=277s"},{"start_seconds":285,"text":"we started building this uh small to-do app uh in R um built on chain so we have","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=285s"},{"start_seconds":293,"text":"the our to-do items and the uh rules of adding and removing to do uh fully","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=293s"},{"start_seconds":301,"text":"scripted as a as an application on chain on near um that is","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=301s"},{"start_seconds":308,"text":"uh that is where we will start off today I will quickly recap what we did last","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=308s"},{"start_seconds":315,"text":"week and Uh I promis that uh we will dive a bit deeper with this topic uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=315s"},{"start_seconds":323,"text":"this week so want I I want to cover the topic of uh rust collections versus near","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=323s"},{"start_seconds":330,"text":"like near custom collections topic uh and I will also try to cover the multi","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=330s"},{"start_seconds":337,"text":"tendency setup because currently the smart contract is uh tailored towards B basically maintaining a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=337s"},{"start_seconds":346,"text":"single uh list of to-dos so we can anyone can add to-dos to the list right","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=346s"},{"start_seconds":353,"text":"now and anyone can see them um and anyone can you know rearrange","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=353s"},{"start_seconds":360,"text":"and the last but not least is a privacy topic I think I will only have time to briefly mention it today but there was a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=360s"},{"start_seconds":370,"text":"pretty nice discussion um with u Sandy from cero uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=370s"},{"start_seconds":377,"text":"who wanted to join uh and talk more in depth about this topic for blockchain space it's a it's a hard","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=377s"},{"start_seconds":385,"text":"topic so um yeah and I will also I would love to invite Joe at some point and I","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=385s"},{"start_seconds":395,"text":"want to also beat make it very uh obvious that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=395s"},{"start_seconds":401,"text":"I'm not alone here and it's very helpful to have the community behind us and behind the the whole initiative of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=401s"},{"start_seconds":409,"text":"devhub and the and Jo helping us to organize these calls organize de Hub","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=409s"},{"start_seconds":416,"text":"life and many other um um events uh online events in near space","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=416s"},{"start_seconds":424,"text":"so uh that's amazing and obviously he's also building on year so there will be a lot of wisdom uh and potentially","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=424s"},{"start_seconds":433,"text":"questions that he can uh ask can slow me down when I'm going way too fast with no","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=433s"},{"start_seconds":440,"text":"context because it's obvious for me uh so it would be great to have um more","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=440s"},{"start_seconds":446,"text":"folks uh voice in it but also yeah don't hesitate to ask questions in the chat I","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=446s"},{"start_seconds":453,"text":"I hope they will appear on my screen so it will be reacting to those cool uh where should we start uh let's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=453s"},{"start_seconds":463,"text":"start with the with the short recap uh of where we were standing so I created a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=463s"},{"start_seconds":471,"text":"uh a new project last week using cargon extension so if you go to cargon","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=471s"},{"start_seconds":479,"text":"GitHub page uh you will find a way to to install it uh it's super simple just choose your platform where you're using","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=479s"},{"start_seconds":489,"text":"it and then cargo space near and you will be you will have all the uh nice","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=489s"},{"start_seconds":495,"text":"subcommands cool H after that uh it creates basically like all the boiler","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=495s"},{"start_seconds":502,"text":"plate for the um pre-standard uh rust project with just uh bit of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=502s"},{"start_seconds":512,"text":"flash to it with reproducible builds and stuff and obviously with the latest ASD","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=512s"},{"start_seconds":518,"text":"case actually latest is 5.5 already but it's uh uh it's fine for us for now uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=518s"},{"start_seconds":526,"text":"we also covered so we build the contract the very basic version of it and we even","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=526s"},{"start_seconds":533,"text":"had a test added to it the unit test um we didn't cover the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=533s"},{"start_seconds":540,"text":"M20 tests I'm not sure if we will this time we'll see but nice part about it also available uh over the shelf and you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=540s"},{"start_seconds":550,"text":"can basically run the full local uh local net blockchain as a Sandbox","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=550s"},{"start_seconds":558,"text":"environment and then compile deploy to it and do all the stuff with the with your control there","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=558s"},{"start_seconds":566,"text":"um and uh just to remind you the interfaces there uh is there was the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=566s"},{"start_seconds":574,"text":"contract that is the root state of of the application basically um the we had","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=574s"},{"start_seconds":582,"text":"a list of todos in the form of hashmap and we had a uh an identifier for the next to- do um we want to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=582s"},{"start_seconds":590,"text":"store um so um we also discussed that uh yeah there","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=590s"},{"start_seconds":598,"text":"is a to do item with with it status completed rending um and uh we added the methods","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=598s"},{"start_seconds":607,"text":"to initialize the uh State and add the new to-do um currently as you can see anyone","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=607s"},{"start_seconds":616,"text":"there is no no uh checks who can interact with the contract so anyone can anyone can spec call the method add to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=616s"},{"start_seconds":624,"text":"do and we will just obey and uh insert the to do in the list but it could be","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=624s"},{"start_seconds":631,"text":"easily changed and add we can add owner with the contract and we will uh stly Define who can","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=631s"},{"start_seconds":639,"text":"U like anyone can call the method but they not every request will be fulfilled","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=639s"},{"start_seconds":646,"text":"so uh that's it then we also introduced the um list listing that do um they are","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=646s"},{"start_seconds":654,"text":"all public so anyone can list our to-dos also permission list uh we can change it to the status um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=654s"},{"start_seconds":663,"text":"obviously um currently there is no safeguards who can change the status not very helpful in a way but at the same","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=663s"},{"start_seconds":672,"text":"time why not uh so it's up to us to Define all those rules and that that is why the applications on chain","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=672s"},{"start_seconds":681,"text":"um were initially called contracts so we kind of defined the contracts uh like","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=681s"},{"start_seconds":687,"text":"legal contracts uh with code and since the execution is not controlled by any","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=687s"},{"start_seconds":695,"text":"one party um that becomes a contract that is uh um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=695s"},{"start_seconds":703,"text":"controlled uh and ured through the um not through the lawers or","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=703s"},{"start_seconds":710,"text":"um bureaucracy but through the programming code and the decentralized network um that has certain rules um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=710s"},{"start_seconds":720,"text":"that the network has to follow otherwise the notes would not be","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=720s"},{"start_seconds":728,"text":"uh reward it would not be part of the protocol so there is no real point to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=728s"},{"start_seconds":734,"text":"not follow the rules you would not gain any anything out of it cool and today just uh so and and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=734s"},{"start_seconds":743,"text":"know how it worked uh so we did Caron near and we buil bu and then deployed","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=743s"},{"start_seconds":751,"text":"the contract uh I think it was I'm using visitor um let's let's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=751s"},{"start_seconds":763,"text":"check uh so I will go to near blocks","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=763s"},{"start_seconds":772,"text":"to yeah um as always um if it's live it will go wrong on and all your all my","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=772s"},{"start_seconds":781,"text":"attempts will be blocked at any point with unknown errors look me BLX is already not","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=781s"},{"start_seconds":789,"text":"floting for some reason let's see um if the lightweight","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=789s"},{"start_seconds":796,"text":"Explorer works test net uh yep","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=796s"},{"start_seconds":805,"text":"great uh single access key 10 year see","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=805s"},{"start_seconds":815,"text":"um we don't have the history transaction on the lightweight","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=815s"},{"start_seconds":822,"text":"dixer seven days ago that's exactly last Friday so yeah let's uh let's keep going Hey","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=822s"},{"start_seconds":832,"text":"Joe what's happening oh a lot of stuff a lot stuff yeah I I I'll just let you let you go","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=832s"},{"start_seconds":839,"text":"and I'll chime in as as it makes sense amazing yeah thanks because it feels more a bit more uh relax and human to me","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=839s"},{"start_seconds":848,"text":"than just monologue yeah for sure so the I'm using visitor testet is the account","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=848s"},{"start_seconds":855,"text":"that where we uh wanted to deploy the and we deployed the contract last week uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=855s"},{"start_seconds":863,"text":"we not sure if we used the reproducible build last week let's check so going to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=863s"},{"start_seconds":870,"text":"contract uh I can see contract code and it seems like it was either","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=870s"},{"start_seconds":877,"text":"not uh contract Source metadata let's quit it okay we actually buildt it with","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=877s"},{"start_seconds":885,"text":"the reproducible build um details but I think uh the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=885s"},{"start_seconds":892,"text":"um Source scan only uh was enabled for test net right after the call uh Let's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=892s"},{"start_seconds":899,"text":"uh I I didn't try let's uh let's see if we can um push and ask it to verify our","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=899s"},{"start_seconds":908,"text":"contract what it does behind the scenes it basically reads the um the data the um the it makes a view","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=908s"},{"start_seconds":919,"text":"call to my contract um which one you may you may ask so let's see uh contract call","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=919s"},{"start_seconds":927,"text":"function as only uh I'm using","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=927s"},{"start_seconds":935,"text":"viser um and the name is this contract Source metadata and uh no parameters you need","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=935s"},{"start_seconds":943,"text":"to specify there so and it's testet yeah latest data so this is what um Source","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=943s"},{"start_seconds":950,"text":"Canan basically pitches and as you can see in the in the output of my cont","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=950s"},{"start_seconds":960,"text":"there is a like baked in uh hardcoded metadata uh that is very helpful to that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=960s"},{"start_seconds":969,"text":"allows the anyone to pull exactly the version of the code exactly the um the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=969s"},{"start_seconds":976,"text":"build environment which is a Docker image and uh well given that we use it from the root of the reapo the contract","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=976s"},{"start_seconds":986,"text":"pass is just blank meaning root and uh um with the command carger built","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=986s"},{"start_seconds":993,"text":"inside this built environment uh in this working directory with this source code","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=993s"},{"start_seconds":1000,"text":"it should re get exactly the same basm file and this is how it then confirms","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1000s"},{"start_seconds":1006,"text":"that Yes actually the source code matches and if so contracts verifi successfully that's what you will","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1006s"},{"start_seconds":1015,"text":"see um there's a lot of uh work behind the scenes has been done to enable all","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1015s"},{"start_seconds":1023,"text":"that um and I'm very happy to uh to see it live on testnet as well as you can see we can we can now clearly see the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1023s"},{"start_seconds":1032,"text":"exact smart contract that we are dealing with nice so why just so for people understand a little better why is this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1032s"},{"start_seconds":1040,"text":"important and you know and as we talk about interacting with blockchain and stuff like that exactly well very good","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1040s"},{"start_seconds":1048,"text":"question thanks for resing it right away the the reality is that as as I just","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1048s"},{"start_seconds":1055,"text":"mentioned in the very beginning the applications that are on blockchain are","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1055s"},{"start_seconds":1061,"text":"called contracts why so because they uh can guarantee certain rules and uh uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1061s"},{"start_seconds":1070,"text":"certain logic and yeah g game play in a way of the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1070s"},{"start_seconds":1081,"text":"um of of the interactions so you can Define that anyone can add it to do or","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1081s"},{"start_seconds":1088,"text":"no one can add it to do or uh only some people with some amount of tokens Can Do certain things and uh for this contract","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1088s"},{"start_seconds":1098,"text":"to to be you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1098s"},{"start_seconds":1101,"text":"know um truthful and that what the one that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1101s"},{"start_seconds":1108,"text":"you can rely on you need to verify that the the application that is stored on chain is actually the one that you that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1108s"},{"start_seconds":1116,"text":"uh you believe the contract like is written uh like text reflects of and the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1116s"},{"start_seconds":1124,"text":"um the smart contracts on here are uh basm files so they are web assembly uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1124s"},{"start_seconds":1131,"text":"binaries so they have U just Pro program code that you deploy to the chain and not the source","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1131s"},{"start_seconds":1139,"text":"code and this means that uh it's like it's not for humans it they execute efficiently it works beautifully and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1139s"},{"start_seconds":1148,"text":"fast but and but they but you cannot really read that code you cannot read that contract anymore so what what we","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1148s"},{"start_seconds":1157,"text":"what this feature is about is how to link back the uh binary that is deployed to the and published to the blockchain","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1157s"},{"start_seconds":1167,"text":"uh back to the source code that is is more human readable and we can review it and understand the um intricacies and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1167s"},{"start_seconds":1173,"text":"rules that are defined in the program and this is why we need the source code but the the challenge is uh you cannot","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1173s"},{"start_seconds":1183,"text":"generate the the source code back from vasm file anymore uh and the source","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1183s"},{"start_seconds":1189,"text":"code is decoupled from the uh vasm file overall uh so our only way to get back","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1189s"},{"start_seconds":1198,"text":"to to the source code is actually confirmed that if we build the source code uh if we build the basm file from","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1198s"},{"start_seconds":1205,"text":"the same source code again and get exactly the same B file that means that the source code matches the the the bom","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1205s"},{"start_seconds":1214,"text":"file and a way to do it is to um well I","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1214s"},{"start_seconds":1220,"text":"can I can I can now based on the um uh based on this um in information","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1220s"},{"start_seconds":1229,"text":"that is picked into the vasm file I can reproduce the like I can can literally","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1229s"},{"start_seconds":1236,"text":"get clone uh carger build in that folder and I will arrive to exactly the same","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1236s"},{"start_seconds":1243,"text":"results and if if so I can locally verify it what this UI helps helpfully U","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1243s"},{"start_seconds":1251,"text":"like how this UI helps us is that it does it behind the scenes automatically for us and just publish the the results","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1251s"},{"start_seconds":1258,"text":"here here that's why you can see the drop down here it's not just one source uh the uh you you can become another","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1258s"},{"start_seconds":1266,"text":"source of validation in the future I'm not sure how uh exactly you can uh join the program here but I'm sure there like","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1266s"},{"start_seconds":1273,"text":"it was designed to be U verifiable through several lenses they they will do exactly the same process to produce it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1273s"},{"start_seconds":1282,"text":"and they post the result into the smart contract in this case and this this is this is where so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1282s"},{"start_seconds":1290,"text":"in ethereum if you come from there so people have always asked like why can't we see the contract code just like you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1290s"},{"start_seconds":1297,"text":"could and ether scan right so this is kind of giving that same thing but at the same time it's also essentially","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1297s"},{"start_seconds":1304,"text":"signing off on that this is the right person who said this you you know I almost feel like this is a step further","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1304s"},{"start_seconds":1311,"text":"because there is a source that is validating what's there as well to match that up yep exactly","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1311s"},{"start_seconds":1320,"text":"cool and uh it's it's all about tooling and the features so we could imagine that the source code would be published","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1320s"},{"start_seconds":1328,"text":"like just like in etherum world we could publish the I know zip Archive of R project","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1328s"},{"start_seconds":1336,"text":"onto uh near but then the node would the validator node would need to do an","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1336s"},{"start_seconds":1343,"text":"expensive compulation step and each note would need to do that and you would need to strictly Define the build environment","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1343s"},{"start_seconds":1350,"text":"there um so that's why the near protocol decided to go okay well just upload the VM file that is good enough for us and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1350s"},{"start_seconds":1359,"text":"solve the problem of verification and ensuring the match of the source code somewhere else and this is yeah was","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1359s"},{"start_seconds":1369,"text":"uh the pain point that Source scan team identified and they pushed for it uh for","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1369s"},{"start_seconds":1376,"text":"over a year and uh finally we have the the fruits out of this tree and it's uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1376s"},{"start_seconds":1384,"text":"amazing yeah very cool cool yeah um so let's uh let's talk about this uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1384s"},{"start_seconds":1393,"text":"topic of why standard so well let's go back a bit so here not","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1393s"},{"start_seconds":1406,"text":"here in our contract State we currently store toos as a a r STD collections","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1406s"},{"start_seconds":1415,"text":"hashmap uh story um object and this means that uh we basically store them in","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1415s"},{"start_seconds":1422,"text":"in in a in the same blob of memory and we serialize","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1422s"},{"start_seconds":1428,"text":"them all at once so every single time the application uh is uh a contract is","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1428s"},{"start_seconds":1437,"text":"called uh um a function call is executed the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1437s"},{"start_seconds":1443,"text":"um the self the contract storage uh State should be uh de calized and then","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1443s"},{"start_seconds":1452,"text":"only then the ex the the function will be executed and then after after we return from the function these changes","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1452s"},{"start_seconds":1460,"text":"made here will be calized back again as a single Lop of data data and stored onch","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1460s"},{"start_seconds":1469,"text":"so in the essence uh actually if we go to uh nearest","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1469s"},{"start_seconds":1478,"text":"RS and uh open the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1478s"},{"start_seconds":1500,"text":"I want to open the test here is","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1500s"},{"start_seconds":1504,"text":"DEC um compilation test no test","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1504s"},{"start_seconds":1522,"text":"um maybe not it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1522s"},{"start_seconds":1537,"text":"this one should work that's one but I want to have a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1537s"},{"start_seconds":1550,"text":"call generator","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1550s"},{"start_seconds":1583,"text":"maybe not the best way to demonstrate it after all","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1583s"},{"start_seconds":1599,"text":"where is test sorry about","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1599s"},{"start_seconds":1605,"text":"that quickly open the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1605s"},{"start_seconds":1614,"text":"test here we go so the there is the uh test case in near DK RS and I think it's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1614s"},{"start_seconds":1622,"text":"very important to understand the this this bit of U thing because that will just open all the doors going forward um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1622s"},{"start_seconds":1631,"text":"this is a test that uh tests that that uh verifies that what the code will look","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1631s"},{"start_seconds":1638,"text":"like after we feed it into the near macro so the public method with the name","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1638s"},{"start_seconds":1645,"text":"method and self and uh K as a string uh so this is one parameter and uh for","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1645s"},{"start_seconds":1654,"text":"example no body in it uh we'll end up with uh so after the uh code generation","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1654s"},{"start_seconds":1663,"text":"step uh we want to see what's um actually inside and on the last video on","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1663s"},{"start_seconds":1670,"text":"Friday I showed you this beautiful instacrate uh that generates the snapshots and uh stores them","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1670s"},{"start_seconds":1678,"text":"so if we open X basic Json as basic Json file this is the source code the rust uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1678s"},{"start_seconds":1688,"text":"code that is generated for the uh function call so it generates a standing Standalone","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1688s"},{"start_seconds":1696,"text":"um function here shouldn't be X","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1696s"},{"start_seconds":1708,"text":"I think it's this this this is fine the our our parameter is is simple int um don't worry about the changes so what it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1708s"},{"start_seconds":1717,"text":"generates it generates a a method so it's a a function a function method with","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1717s"},{"start_seconds":1724,"text":"which is uh marked to be no man goal C uh and only for Target VM 32 uh all you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1724s"},{"start_seconds":1733,"text":"need to know is that this method just becomes part of the public um public exposed methods of the basm binary","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1733s"},{"start_seconds":1741,"text":"that's all it does exactly with this name so it doesn't change it because usually compilers will change it for um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1741s"},{"start_seconds":1749,"text":"for the reasons to not collide with any other method with other functions uh in the user code in this case we want it to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1749s"},{"start_seconds":1756,"text":"be exactly this name uh what it does next it does set up panic uh who but","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1756s"},{"start_seconds":1763,"text":"it's also not important here uh it also generates a struct uh it's easier to read it if we imagine","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1763s"},{"start_seconds":1771,"text":"it's actually top level imagine it's here so just a struct uh called input uh there is only one","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1771s"},{"start_seconds":1781,"text":"parameter and we apply s um Set deize uh derived to it what we do then","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1781s"},{"start_seconds":1791,"text":"next we call the nearest DC uh input function and with we try to um and and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1791s"},{"start_seconds":1801,"text":"and it will read the um the the value from the state","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1801s"},{"start_seconds":1809,"text":"uh it's local state of the application and deserialize it uh for","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1809s"},{"start_seconds":1817,"text":"um uh from Json in our case because we use S uh into input and if the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1817s"},{"start_seconds":1826,"text":"result so if input uh is there it tries to Ser","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1826s"},{"start_seconds":1835,"text":"deserialize from slice uh the input string and if it's successful if okay then it returns this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1835s"},{"start_seconds":1844,"text":"this realized value otherwise it will just return the error that you see in the uh in the smart contract when you call it we can already test this one so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1844s"},{"start_seconds":1853,"text":"failed to distalize input from Json where do you see it uh you call any contract in fact uh built on uh with","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1853s"},{"start_seconds":1862,"text":"nearest D KS um so let's use my contract uh let's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1862s"},{"start_seconds":1868,"text":"uh call list to do we specify instead of Json RX Let's uh use this test text arcs","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1868s"},{"start_seconds":1876,"text":"so it's free form and we put some nonsense here uh what we expect to see is exactly the error I just showed to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1876s"},{"start_seconds":1884,"text":"you okay so given that the function doesn't care about any parameters that they just ignored it and let's use the one that uh add to-dos for","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1884s"},{"start_seconds":1893,"text":"example uh contract call um add to do uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1893s"},{"start_seconds":1901,"text":"we do not comply with the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1901s"},{"start_seconds":1908,"text":"uh uh with the Json requirements so as you can see failed to deize input from","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1908s"},{"start_seconds":1915,"text":"Json exactly the string that we see here so this is exactly the code um that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1915s"},{"start_seconds":1924,"text":"takes care of it so they the function at to do was wrapped and this was the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1924s"},{"start_seconds":1931,"text":"preparation step so it pared the input parameters first we have the input now","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1931s"},{"start_seconds":1939,"text":"uh and now we have the one more line let's get back to it in a bit and after","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1939s"},{"start_seconds":1945,"text":"that line we have the hello so our contract uh and Method add to do","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1945s"},{"start_seconds":1955,"text":"executed right right right this way and uh we pass the contract we will come back to it in a bit this is this line","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1955s"},{"start_seconds":1964,"text":"and K which we just pared from the input uh so this is this is nice part","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1964s"},{"start_seconds":1971,"text":"what's contract contract on the other hand so contract in our case um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1971s"},{"start_seconds":1978,"text":"it's a what do we do here we call nearest Decay EnV State read and then we","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1978s"},{"start_seconds":1986,"text":"try to uh if if there is an error we just uh call default implementation to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1986s"},{"start_seconds":1993,"text":"it so we we want to generate a contract so basically calling contract default","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=1993s"},{"start_seconds":2001,"text":"method uh if there is no value there yet but what what state read does","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2001s"},{"start_seconds":2009,"text":"we can look it up here R","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2009s"},{"start_seconds":2017,"text":"state is very thing very small function where is","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2017s"},{"start_seconds":2024,"text":"it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2024s"},{"start_seconds":2033,"text":"uh St State read sorry uh State read so State","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2033s"},{"start_seconds":2042,"text":"read what it does it does storage read State key and if there is an error do something and not deize blah blah blah","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2042s"},{"start_seconds":2050,"text":"so it tries to to to deize it at once whatever it it read from the key State key what what is State Key State","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2050s"},{"start_seconds":2060,"text":"Key State key is just this string State huh let's let's look into it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2060s"},{"start_seconds":2068,"text":"actually so near uh contract you can um view","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2068s"},{"start_seconds":2077,"text":"storage uh amusing visitor and uh yeah which uh keys do we want to see in the storage all and let's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2077s"},{"start_seconds":2086,"text":"present them as text for now so it says that there is one key in","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2086s"},{"start_seconds":2093,"text":"the storage State and there is a nonsense inside um so this nonsense is actually B","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2093s"},{"start_seconds":2103,"text":"serialized uh hash map of um probably two values if I read it right each like","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2103s"},{"start_seconds":2113,"text":"there are two keys one key is test to-do app and another key has a to-do of test","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2113s"},{"start_seconds":2121,"text":"to-do app from CI um so before I want just kind of help clarify some things","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2121s"},{"start_seconds":2130,"text":"here too so part of this in the way that state works on near is that so contracts are upgradeable right and so and we can","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2130s"},{"start_seconds":2139,"text":"they really truly actually almost act like a database because I can read write I can remove essentially remove content","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2139s"},{"start_seconds":2147,"text":"because I'm changing my state right I can even change the structure of my state I can actually upgrade my contract","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2147s"},{"start_seconds":2154,"text":"to have a different structured straight so this basically is one of the unique properties here that is how you can","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2154s"},{"start_seconds":2163,"text":"start to leverage a near contract to really serve as your back end","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2163s"},{"start_seconds":2173,"text":"right yeah so that's one aspect and also the like this allows us to to hot swap in a way","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2173s"},{"start_seconds":2181,"text":"the the code at any point in time and it will continue using exactly the same data that is already and you don't need","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2181s"},{"start_seconds":2188,"text":"to like well if if you need to update this the data that is in your local","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2188s"},{"start_seconds":2195,"text":"storage that's up to application so your your contract should take care of that but if your app is only changing you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2195s"},{"start_seconds":2202,"text":"know the rules who can interact with data but not changing the layout of the data then no changes to the data","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2202s"},{"start_seconds":2209,"text":"so-called data migration is not needed um yeah but what it all like what I was","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2209s"},{"start_seconds":2216,"text":"trying to show here that basically on every interaction with the um with the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2216s"},{"start_seconds":2223,"text":"function uh the deiz of this state value happens and then after the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2223s"},{"start_seconds":2232,"text":"end um I think it's not in this example uh no return there is there","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2232s"},{"start_seconds":2242,"text":"should be so value return this is another thing that we didn't cover so when we we call the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2242s"},{"start_seconds":2249,"text":"method we want sometimes to return something and this is the code that adds","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2249s"},{"start_seconds":2255,"text":"the the added basically um so it gen uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2255s"},{"start_seconds":2260,"text":"serializes the output as Json to a vector of bytes and then calls a host","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2260s"},{"start_seconds":2268,"text":"function value return but what's uh more interesting um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2268s"},{"start_seconds":2280,"text":"uh is this thing so basically uh if if your function is uh mute has","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2280s"},{"start_seconds":2289,"text":"uses self as mute uh the the code that is generated for for your contract is uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2289s"},{"start_seconds":2296,"text":"has this line at the end so it executes your function and then it uh calls a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2296s"},{"start_seconds":2303,"text":"state right um to to to to to to store the value back uh and the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2303s"},{"start_seconds":2312,"text":"value is your contract uh structure that is calized to borch and then bytes are","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2312s"},{"start_seconds":2321,"text":"stored on chain and this means that the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2321s"},{"start_seconds":2328,"text":"bigger this thing is the more compute power is required and uh if you have thousands of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2328s"},{"start_seconds":2337,"text":"todos you will have a bit of a problem here um and we have a very good","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2337s"},{"start_seconds":2345,"text":"documentation in this uh uh in nears dek uh collections or","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2345s"},{"start_seconds":2353,"text":"actually not I think it's in store on how did I here in","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2353s"},{"start_seconds":2360,"text":"store um maybe","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2360s"},{"start_seconds":2370,"text":"the look","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2370s"},{"start_seconds":2380,"text":"up how","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2380s"},{"start_seconds":2393,"text":"come eable","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2393s"},{"start_seconds":2416,"text":"not as prominent as I would expect it to be","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2416s"},{"start_seconds":2424,"text":"honest let me find it on the cute site somehow we is it the latest it's latest","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2424s"},{"start_seconds":2467,"text":"store module should be","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2467s"},{"start_seconds":2479,"text":"there will need to fix it but um uh we do have the documentation we do have the benchmark which shows that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2479s"},{"start_seconds":2488,"text":"after a certain amount of uh um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2488s"},{"start_seconds":2495,"text":"records we see a degradation and performance and uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2495s"},{"start_seconds":2504,"text":"it will in like the the growing number","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2504s"},{"start_seconds":2510,"text":"of uh Records produces more and more gas uh that is like the that's equivalent of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2510s"},{"start_seconds":2518,"text":"uh uh compute power that is required so after uh what after","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2518s"},{"start_seconds":2526,"text":"1K uh we have if if we only use the contains oops did I did my sharing the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2526s"},{"start_seconds":2534,"text":"screen failed yeah went away give to re add it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2534s"},{"start_seconds":2553,"text":"there we go yeah so after like 1K you already see that native so before","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2553s"},{"start_seconds":2561,"text":"1K uh the um if we call contains on the collection","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2561s"},{"start_seconds":2571,"text":"contains is like is there a key in the collection um with if the collection has five 500","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2571s"},{"start_seconds":2579,"text":"elements in it and we call if it contains number 40 for example uh Native","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2579s"},{"start_seconds":2587,"text":"collections give you uh will require more compute power but not not substantially more but uh going from","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2587s"},{"start_seconds":2596,"text":"after uh 1K elements it it becomes even more obvious it's uh there is an overhead and with","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2596s"},{"start_seconds":2605,"text":"100K uh elements in the to-do list of these are just integers uh if we have strings it's even more P penalty there","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2605s"},{"start_seconds":2614,"text":"for sure uh we already see this gap of uh um access to the data and confirming","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2614s"},{"start_seconds":2623,"text":"that it's U um just doing this basic operation basically uh and that is because we uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2623s"},{"start_seconds":2632,"text":"we encode the we we have to uh serialize and de ize this state at every function","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2632s"},{"start_seconds":2641,"text":"call we interact uh as as through a transaction or called started uh if interact internally like if if the if","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2641s"},{"start_seconds":2650,"text":"the contract calls its own function within the same uh transaction there is no penalty on that because there is no","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2650s"},{"start_seconds":2659,"text":"uh um cationization happening but when it's a cold start it does require to initialize","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2659s"},{"start_seconds":2667,"text":"the contract State the memory and this is the the the the the problem you may","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2667s"},{"start_seconds":2674,"text":"face so in our case go ahead I I was ask a question but actually keep going for a minute then I think I meant question for yeah yeah so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2674s"},{"start_seconds":2683,"text":"in our case we we do have like until we have I I would say","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2683s"},{"start_seconds":2690,"text":"a a thousand of to we're good how many of us do have uh one k to do list","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2690s"},{"start_seconds":2699,"text":"benchmarks uh not not many right so sometimes makes a lot of sense to actually use just PR native Collections","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2699s"},{"start_seconds":2708,"text":"and it wouldn't be a huge problem but if you are building for example nft or AF contract where you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2708s"},{"start_seconds":2716,"text":"need to keep record of a Unbound list of uh Records and that could be Millions","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2716s"},{"start_seconds":2725,"text":"potentially if you're if you have a successful nft contract um or ft uh and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2725s"},{"start_seconds":2732,"text":"you have bunch of users then you need to use um these Collections and how they","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2732s"},{"start_seconds":2740,"text":"how how what what's the magic there there is no magic behind that uh they they just use the um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2740s"},{"start_seconds":2747,"text":"individual uh uh storage key so local storage uh that you can uh use as part","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2747s"},{"start_seconds":2755,"text":"of the uh near API we you have two methods","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2755s"},{"start_seconds":2762,"text":"read State read and state write and state exist if you like so so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2762s"},{"start_seconds":2769,"text":"these are the the functions that you can use you you just uh oh hold on not State um Storage storage","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2769s"},{"start_seconds":2777,"text":"right and storage read and storage remove these guys so storage","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2777s"},{"start_seconds":2784,"text":"right expects you to get give a key uh as a bytes array and put a value as","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2784s"},{"start_seconds":2792,"text":"bytes array so you can put the like this is how you can use it similarly uh to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2792s"},{"start_seconds":2799,"text":"read the data back just use storage read you specify the key and you get the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2799s"},{"start_seconds":2806,"text":"value back uh so the the those it iterative uh Set uh lookup set lookup","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2806s"},{"start_seconds":2814,"text":"map all those uh store collections so in store here the key store we have a bunch","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2814s"},{"start_seconds":2820,"text":"of them so for maps for sets uh and for just uh some values that you that are","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2820s"},{"start_seconds":2827,"text":"big and you don't want to put them immediately uh so you want to keep them as a separate key that's the way uh and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2827s"},{"start_seconds":2837,"text":"Vector obviously as well so these are just a small uh wrappers around the um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2837s"},{"start_seconds":2846,"text":"uh the those re storage read and storage right operations if you want to understand uh more in depth I I would","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2846s"},{"start_seconds":2855,"text":"recommend you to check out the deprecated collections implementation it's much easier to uh to understand so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2855s"},{"start_seconds":2862,"text":"if you go uh lookup map for example lookup map and go to the source directly","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2862s"},{"start_seconds":2869,"text":"it's really not that big as you can see uh those are tests so the whole implementation is just 200 lines","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2869s"},{"start_seconds":2878,"text":"uh and what it does uh so it it has a method it has a method for example","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2878s"},{"start_seconds":2884,"text":"contains or like or G get get let's use get as an example get is just a get RW","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2884s"},{"start_seconds":2893,"text":"which um is a method that returns expects a key is is a bite array and returns you a bite array and it just","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2893s"},{"start_seconds":2901,"text":"serializes the key and de serializes the value that's all it does uh under the hood uh so you don't like when whenever","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2901s"},{"start_seconds":2908,"text":"you store objects so the collection is just a uh it knows the types and can cize","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2908s"},{"start_seconds":2916,"text":"andiz the values of those types yeah Joe you wanted to ask something yeah I was going to say like so one of the things that I think comes","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2916s"},{"start_seconds":2925,"text":"up is you see these limitations here but obviously we can deal with a lot more data right so some live examples are","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2925s"},{"start_seconds":2932,"text":"like where the ne near social contract um the nft contract that we have on Shard doog has uh a ton of data in it so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2932s"},{"start_seconds":2942,"text":"what is actually happening and how are we able to actually uh program around that those limitations yeah let's let's maybe uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2942s"},{"start_seconds":2952,"text":"jump into a quick example here","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2952s"},{"start_seconds":2960,"text":"um this one gear","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2960s"},{"start_seconds":2968,"text":"uh let's uh let's change the the collections here so let's uh let's use nearest DEC","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2968s"},{"start_seconds":2976,"text":"store uh iterable map and see what it will actually","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2976s"},{"start_seconds":2983,"text":"requires to do uh so first of all it will fail to compile uh it will fail to compile","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2983s"},{"start_seconds":2990,"text":"because we have the initialization code here okay","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2990s"},{"start_seconds":2998,"text":"uh here we need to use also obviously near SDK uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=2998s"},{"start_seconds":3006,"text":"store iterable map new instead of hash map but also it will fail to compile","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3006s"},{"start_seconds":3015,"text":"because it requires a prefix and this is a uh thing","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3015s"},{"start_seconds":3021,"text":"that think we need to maybe STP for a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3021s"},{"start_seconds":3027,"text":"bit to to think about what what this uh prefix could be used for and why it's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3027s"},{"start_seconds":3034,"text":"here um as I said the these collections are using read key read storage read","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3034s"},{"start_seconds":3041,"text":"storage right operations and they basically just expect the key and value uh like the the keys they they share the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3041s"},{"start_seconds":3049,"text":"the same uh they they they use the shared um local store storage of your","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3049s"},{"start_seconds":3058,"text":"application so if you have several uh collections how to distinguish the keys","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3058s"},{"start_seconds":3066,"text":"inside those um there is no way uh for the up to know that's why we need to prefix all the keys this collection will use to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3066s"},{"start_seconds":3075,"text":"store the um on on the local storage uh with the with the specified","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3075s"},{"start_seconds":3084,"text":"unique key so in this case it could be to do","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3084s"},{"start_seconds":3090,"text":"um uh let's prefix it with just simple t uh let's see if to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3090s"},{"start_seconds":3097,"text":"do um and uh this way it will compile and we can already deploy it uh car","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3097s"},{"start_seconds":3108,"text":"near there will be another problem not this one so this one is about","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3108s"},{"start_seconds":3115,"text":"reproducibility so this is uh um is complain that uh um the changes","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3115s"},{"start_seconds":3124,"text":"are not committed to get that's why it cannot actually um incude the reference to the exact source code I had to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3124s"},{"start_seconds":3133,"text":"disable it for now uh um just to speed up things um in","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3133s"},{"start_seconds":3140,"text":"production I do recommend always to deploy with uh reproducible builds uh and another question that it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3140s"},{"start_seconds":3147,"text":"asks on deployment is will we need to initialize our contract again and our","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3147s"},{"start_seconds":3156,"text":"contract is already deployed and the state is already there that's why we don't want to initialize it uh and while","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3156s"},{"start_seconds":3163,"text":"we do this let's see what will happen um we'll hit another problem uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3163s"},{"start_seconds":3170,"text":"another not on deployment deployment went fine it's all great new version of the application is there uh but we","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3170s"},{"start_seconds":3180,"text":"whenever we will interact with the with the contract uh contract all function read","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3180s"},{"start_seconds":3187,"text":"only um my contract for example list to do no parameters yeah it's it's all great for","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3187s"},{"start_seconds":3195,"text":"now now it it panics uh and it says cannot deserialize the contract","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3195s"},{"start_seconds":3204,"text":"seed uh and that is exactly the problem I I we discussed just a bit ago uh with show that when you deploy the code uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3204s"},{"start_seconds":3213,"text":"you can rewrite update the code uh but the and and while keeping the data right","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3213s"},{"start_seconds":3221,"text":"there so the data uh contract view storage on this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3221s"},{"start_seconds":3228,"text":"account yes viewing all the keys test not yes now data is exactly there like it's it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3228s"},{"start_seconds":3235,"text":"still too uh two Tod do we added last week nothing has changed but the code has changed uh and how exactly has","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3235s"},{"start_seconds":3244,"text":"changed now the the contract State um uses a different collection and this different collection has different way","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3244s"},{"start_seconds":3252,"text":"to calze the data so how do we fix it so there are","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3252s"},{"start_seconds":3258,"text":"two ways if we you need the data to be um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3258s"},{"start_seconds":3264,"text":"uh um to be pres preserved you need to come up with the function in your contract to that will be allowed to be","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3264s"},{"start_seconds":3274,"text":"only called once and only by by you probably or by the operator uh to that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3274s"},{"start_seconds":3282,"text":"will take the old data format and put the new data in new format in the storage uh in our case for development","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3282s"},{"start_seconds":3290,"text":"purposes right now uh I will remove the account and recreate from scratch","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3290s"},{"start_seconds":3297,"text":"uh in the um in your case uh so if if you want to dive deep into this topic I","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3297s"},{"start_seconds":3306,"text":"can recommend you to check out the devhub contract uh there is a lot of um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3306s"},{"start_seconds":3314,"text":"interesting ideas already put here so there is a migrations RS file uh which handles all the previous iterations as","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3314s"},{"start_seconds":3322,"text":"you can see we migrated from versions to versions to verions adding more Fields adding more um like details to it and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3322s"},{"start_seconds":3332,"text":"there is a code uh that reads the state and then applies the changes somehow mapping the changes and then uh storing","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3332s"},{"start_seconds":3341,"text":"them back inserting state right uh so this is the the place you can um learn","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3341s"},{"start_seconds":3349,"text":"more about more complex way uh building the migrations uh for the prod apps um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3349s"},{"start_seconds":3357,"text":"in our case I I will probably just actually create a new Dev account","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3357s"},{"start_seconds":3365,"text":"um for testet yes create um and we'll deploy the code","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3365s"},{"start_seconds":3372,"text":"there also for our reference to uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3372s"},{"start_seconds":3384,"text":"um to compare here I would say um likly make","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3384s"},{"start_seconds":3391,"text":"what oh it's not from here not deploying the nears","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3391s"},{"start_seconds":3399,"text":"obviously sorry lost in Windows let save","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3399s"},{"start_seconds":3408,"text":"deploy yes and in this case we do want to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3408s"},{"start_seconds":3414,"text":"initialize it because uh we like this is brand new new new account new new","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3414s"},{"start_seconds":3420,"text":"contract so we need to call new with no parameters and it will initialize the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3420s"},{"start_seconds":3427,"text":"state value uh let's do that with ini with init call um no","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3427s"},{"start_seconds":3435,"text":"parameters no changes needed really sending transaction boom it's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3435s"},{"start_seconds":3443,"text":"there super fast let's compare the um the state Let's uh view the Storage storage of this new contract all keys s","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3443s"},{"start_seconds":3453,"text":"tax on testet now um you can see that the state is","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3453s"},{"start_seconds":3459,"text":"there uh there is this T and TV and TM","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3459s"},{"start_seconds":3465,"text":"so actually the underneath of the um iterative iterable map there are two Vector implementations uh one for keys","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3465s"},{"start_seconds":3474,"text":"and one for values but you don't need to uh really care about it but let's uh let's add something to it now so uh call","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3474s"},{"start_seconds":3484,"text":"contract as transaction uh this is contract that we want to call we want to call add to do","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3484s"},{"start_seconds":3494,"text":"uh we want to provide the parameters uh text is a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3494s"},{"start_seconds":3500,"text":"new um um near is the case for","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3500s"},{"start_seconds":3510,"text":"uh and that's what we are adding here so this hard to do","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3510s"},{"start_seconds":3521,"text":"nice let's see it here just to make sure that I had to do was called with this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3521s"},{"start_seconds":3530,"text":"text nice um everything is fine and we can view the store now","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3530s"},{"start_seconds":3538,"text":"contract new storage of this account is text","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3538s"},{"start_seconds":3545,"text":"now cool look now we have three keys so the key of state did not grow it it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3545s"},{"start_seconds":3553,"text":"actually remained the same but the the new keys were added so one key is this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3553s"},{"start_seconds":3560,"text":"nonsense there uh let's get to it bit later and there is another key um and if","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3560s"},{"start_seconds":3568,"text":"I like I can read it because I I'm used to to to be a machine um but the the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3568s"},{"start_seconds":3577,"text":"reality is that there is a TV is just a bite prefix these are also bytes and as you as you can see there they are zero","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3577s"},{"start_seconds":3586,"text":"bytes so the these are four bytes which actually represent the um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3586s"},{"start_seconds":3597,"text":"to do ID which is u64 u64 takes four bytes and uh this is what we see and the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3597s"},{"start_seconds":3605,"text":"very first to do has the bite uh that has like number zero and this is the uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3605s"},{"start_seconds":3613,"text":"the very first to do and what it references to it references to the uh to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3613s"},{"start_seconds":3619,"text":"the key in here uh what this thing is happening here I'm am not particularly","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3619s"},{"start_seconds":3628,"text":"sure right now I will need to um think a bit more about it uh but this is our","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3628s"},{"start_seconds":3636,"text":"text to do so this is our this is our to-do struct serialized","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3636s"},{"start_seconds":3647,"text":"to porch to-do struct is a string and a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3647s"},{"start_seconds":3653,"text":"status string is seriz in bch as length so four bytes of length of the string","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3653s"},{"start_seconds":3662,"text":"and the string itself and then the to-do status is the enam which is just a I","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3662s"},{"start_seconds":3670,"text":"would expect it to be one bite but let's see uh so going","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3670s"},{"start_seconds":3677,"text":"back um this is our length so it's 18 characters uh new this is this is a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3677s"},{"start_seconds":3685,"text":"string I assume it's 18 characters long um maybe it's plus one bite uh and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3685s"},{"start_seconds":3693,"text":"the and the fine and then the um the status that's probably how it's calized","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3693s"},{"start_seconds":3699,"text":"there um you don't need to parse it this way usually uh it's there just like I I just wanted to show and present you that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3699s"},{"start_seconds":3708,"text":"there is no magic behind it just literally it just has it there um if you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3708s"},{"start_seconds":3715,"text":"need you can but you usually don't need it um and uh but","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3715s"},{"start_seconds":3723,"text":"the like back to the question of growing number of elements um so if we go and call","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3723s"},{"start_seconds":3732,"text":"function as transaction again add another to-do","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3732s"},{"start_seconds":3738,"text":"text another to- do we will see that the state will not","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3738s"},{"start_seconds":3753,"text":"um let's uh copy this handy","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3753s"},{"start_seconds":3761,"text":"command the state key remains exactly the same uh actually it does change I forgot it actually keeps track of the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3761s"},{"start_seconds":3769,"text":"number of elements um so we know that there are two elements so the state is updated but it's only updated like just see like","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3769s"},{"start_seconds":3777,"text":"increment in number right there and the individual records of todos is stored","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3777s"},{"start_seconds":3784,"text":"separately in the under unique uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3784s"},{"start_seconds":3791,"text":"Keys awesome so yeah well um there is a balance uh of using near Collections and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3791s"},{"start_seconds":3801,"text":"Ras collections ideally I think we need to come up with even more balance type of collections where we can batch","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3801s"},{"start_seconds":3809,"text":"um I don't know hundreds uh elements into it into into one bch of under the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3809s"},{"start_seconds":3817,"text":"native key uh in near and then it would you know get benefits of Two Worlds um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3817s"},{"start_seconds":3824,"text":"the best uh so far we don't have the contributions um on the direction um but","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3824s"},{"start_seconds":3831,"text":"I think eventually we will arrive to it with even more usage and even more optimizations needed I think some of the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3831s"},{"start_seconds":3839,"text":"projects already implemented it on the application Level but it would be beneficial to also implement it on the um SDK","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3839s"},{"start_seconds":3847,"text":"level um okay I hope that is more or less clear uh if there are any um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3847s"},{"start_seconds":3856,"text":"questions uh should them but I want to briefly touch uh these two topics um multi-","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3856s"},{"start_seconds":3864,"text":"tendency uh um So currently we have the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3864s"},{"start_seconds":3870,"text":"um anyone can add the uh to-do to the um to the list the to the to the shared","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3870s"},{"start_seconds":3878,"text":"list of do so in order to make it and this means that uh with more users you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3878s"},{"start_seconds":3885,"text":"will basically reuse the same list of to-dos not very helpful but what you can do you can you can you can approach this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3885s"},{"start_seconds":3893,"text":"problem uh with two ways one you can you can say that okay this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3893s"},{"start_seconds":3900,"text":"contract only uh belongs to one owner ID","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3900s"},{"start_seconds":3905,"text":"uh so only the owner who will initialize","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3905s"},{"start_seconds":3913,"text":"the uh who will call the new method only that user will be able to uh to use this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3913s"},{"start_seconds":3921,"text":"uh contract or you may say there are owners so it's a vector of those people","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3921s"},{"start_seconds":3928,"text":"and you can add methods to who will be able to interact with but those owners will still share the the same list of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3928s"},{"start_seconds":3936,"text":"to-dos uh this is what happens with uh um with NFS in a way like nft contracts","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3936s"},{"start_seconds":3944,"text":"uh on near uh usually use this approach and then you uh but then you need to keep track","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3944s"},{"start_seconds":3953,"text":"of the also like owner in the in each Todo in each","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3953s"},{"start_seconds":3961,"text":"nft it could be nft could be to um and then you need to verify whenever somebody wants to change something about","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3961s"},{"start_seconds":3970,"text":"the text or status of the to do you need to just first verify that the owner is the right person or you you verify it on","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3970s"},{"start_seconds":3979,"text":"the top level of like all todos only belong to one owner or list of own","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3979s"},{"start_seconds":3986,"text":"owners and then you basically how you scale it you deploy the same contract to multiple accounts each user needs to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3986s"},{"start_seconds":3994,"text":"deploy their own version this approach uh is used by Sputnik Dow Dow tooling","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=3994s"},{"start_seconds":4000,"text":"usually so the Dow is uh has the like controls of who can interact with the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4000s"},{"start_seconds":4008,"text":"with the contract what are the rules uh so you add the proposal you act on the proposal um but the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4008s"},{"start_seconds":4016,"text":"that's a shared ownership of something inside so the the Dow usually uh has like tokens U sent to the Dow so they","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4016s"},{"start_seconds":4025,"text":"control the um token allocation um and all the people who can do something with it only them can you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4025s"},{"start_seconds":4035,"text":"know Define operate with in the logic um another approach is the like nft","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4035s"},{"start_seconds":4042,"text":"approach I'm going back is when there is only one contract and there is no owner so there is owner for like upgrading the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4042s"},{"start_seconds":4052,"text":"contract per se but overall there there is an owner on the individual uh element and then each","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4052s"},{"start_seconds":4060,"text":"operation just requires you to validate if it's allowed or not and then you deploy it as a single contract you don't","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4060s"},{"start_seconds":4068,"text":"need many of them unless you want to sh them uh and this one contract needs to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4068s"},{"start_seconds":4076,"text":"be um like it needs to control be be very carefully scripted so the only","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4076s"},{"start_seconds":4084,"text":"owners can operate with these entities and nobody like so it's Bren cons of each of the of those","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4084s"},{"start_seconds":4094,"text":"approaches um when you have a contract per team per person it's more","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4094s"},{"start_seconds":4102,"text":"expensive because you need to deploy the contracts over and over again for like all your needs or more more each individual user will need to deploy","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4102s"},{"start_seconds":4110,"text":"their own version but they are in full control of the uh of the version of the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4110s"},{"start_seconds":4116,"text":"code of the um operations it can handle whereas with shared","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4116s"},{"start_seconds":4124,"text":"contract you have the limit of uh like there's probably other no updates","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4124s"},{"start_seconds":4131,"text":"possible at all like you don't want to anyone to even have control over that process or comers there are some risks","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4131s"},{"start_seconds":4139,"text":"associated with that the risk is the upgrade will be variable the risk","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4139s"},{"start_seconds":4147,"text":"is the upgrade will be broken and the contract will not be able to to to return you any values anymore uh and you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4147s"},{"start_seconds":4155,"text":"will need to quer the data back in time and you know restore it from there and maybe create a fork of that contract so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4155s"},{"start_seconds":4164,"text":"there are challenges uh but they are overall um reasonable and just like challenges over the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4164s"},{"start_seconds":4171,"text":"software engineer world they're not like unique for near I would say it's it's about hosting website either it's you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4171s"},{"start_seconds":4178,"text":"know is it a a Facebook where everybody comes and single uh platform and the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4178s"},{"start_seconds":4184,"text":"users are co-hosted there or it's a it's a like web where I have my own personal","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4184s"},{"start_seconds":4193,"text":"landing page Joe has his own personal Ling page we have different domain names but we could use the same software to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4193s"},{"start_seconds":4201,"text":"generate those pages like static generators or even you know Facebook as a software if it would be possible so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4201s"},{"start_seconds":4209,"text":"nothing unique here but I just wanted to highlight that uh you need to pick your type of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4209s"},{"start_seconds":4218,"text":"uh um cure here one piece might be I think though is different that people might not be used to if they're new to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4218s"},{"start_seconds":4226,"text":"blockchain is the concept of storage cost because and so in your scenario there's a couple things that can happen","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4226s"},{"start_seconds":4235,"text":"here where if it's a shared contract the contract owner could cover the cost for everybody and all their users there is a way to do that um but you can also have","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4235s"},{"start_seconds":4244,"text":"the end user also pay for their cost of their own storage so that's something too that is a consideration in both your","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4244s"},{"start_seconds":4252,"text":"uh contract design as well as like did the of like again is it a single contract is going to be multiple","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4252s"},{"start_seconds":4259,"text":"whatever that starts to look like those are considerations now with the to-do app it's minimal it's minimal data um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4259s"},{"start_seconds":4266,"text":"but it can get larged pretty quickly especially if you deal with even just nfts and like larger metadata uh it can","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4266s"},{"start_seconds":4273,"text":"certainly grow faster than you think that's true absolutely and this is a huge topic to discuss as well uh the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4273s"},{"start_seconds":4281,"text":"the gas and the storage costs and storage in general um like it's there's nothing free in the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4281s"},{"start_seconds":4290,"text":"world and we need to like computers ex like computers is you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4290s"},{"start_seconds":4296,"text":"know costs money uh storage costs money traffic costs money um and like well not","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4296s"},{"start_seconds":4304,"text":"not only cost but it's like it's it's a work some systems are doing and they","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4304s"},{"start_seconds":4312,"text":"there is it's energy uh that's why you usually we um measure it in in gas","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4312s"},{"start_seconds":4319,"text":"points like a reflection of energy points um totally probably good topic to cover","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4319s"},{"start_seconds":4327,"text":"maybe next Friday we'll see um on the Privacy topic I I will only cover it uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4327s"},{"start_seconds":4335,"text":"briefly Joe are we um in touch with uh with Sandy are we ready","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4335s"},{"start_seconds":4343,"text":"to to think we're good to go for next live next Thursday next Thursday uh 400","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4343s"},{"start_seconds":4351,"text":"PM UDC right we'll have a huge debate on the Privacy Topic in the blockchain space but today I want to say that it's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4351s"},{"start_seconds":4360,"text":"it's it's fairly simple and fairly complex Topic at the same time uh so privacy is like there are many faults to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4360s"},{"start_seconds":4369,"text":"it and it's it's well it's a deep dive on very like on the number of ways how things can go wrong on the um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4369s"},{"start_seconds":4379,"text":"protocol level on the application Level and everywhere in between um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4379s"},{"start_seconds":4385,"text":"the one thing that I want to um say in like the GetGo if you don't want","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4385s"},{"start_seconds":4393,"text":"something to be on the internet don't put it there so if if if","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4393s"},{"start_seconds":4401,"text":"you put something out there you need to be ready for for the fact that somebody can read it even if it's not blockchain","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4401s"},{"start_seconds":4410,"text":"but in blockchain it's it's just more obvious and clear that whatever you put","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4410s"},{"start_seconds":4416,"text":"on the blockchain it's public so the what you need to consider uh that these","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4416s"},{"start_seconds":4424,"text":"uh to-do lists to-do items uh will be available to everyone in the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4424s"},{"start_seconds":4432,"text":"world um immediately in in one second after you publish the transaction in three seconds it will be finalized uh so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4432s"},{"start_seconds":4441,"text":"it will be you know carved in stone uh the however it doesn't mean","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4441s"},{"start_seconds":4448,"text":"that uh the data has to be uh plain text and this is the where cryptography is","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4448s"},{"start_seconds":4455,"text":"very handy uh what you can do you can store encrypted data so instead of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4455s"},{"start_seconds":4462,"text":"putting dat to do to do items is encrypt as as plain text Data like plain text","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4462s"},{"start_seconds":4468,"text":"you can put them as uh encrypted uh blob of data which unless you possess the key","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4468s"},{"start_seconds":4476,"text":"to the Crypt you cannot read uh and uh there is a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4476s"},{"start_seconds":4483,"text":"huge challenge with that still because uh with advanced in uh in compute power","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4483s"},{"start_seconds":4490,"text":"uh we still face the problems of okay uh what if today we cannot decrypt it uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4490s"},{"start_seconds":4498,"text":"that easily without the key how about in a year in 10 years um do we care about that and what do we do with that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4498s"},{"start_seconds":4507,"text":"knowledge so this is hopefully the debate we'll have with with Sundy next week um what are the solutions to this","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4507s"},{"start_seconds":4515,"text":"problem um um overall for some use cases I would say that it's totally fine to","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4515s"},{"start_seconds":4522,"text":"keep the just encrypted data on chain total totally reasonable use case I","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4522s"},{"start_seconds":4529,"text":"actually played around with it uh for um certification programs so the uh if you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4529s"},{"start_seconds":4536,"text":"want to give a some sort of certificate to you to to to a user and you don't want to reveal their their uh personal","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4536s"},{"start_seconds":4544,"text":"information that could be a good way to go um so they can decide who they share","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4544s"},{"start_seconds":4551,"text":"the uh certificate with and that's a sharable link should just include the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4551s"},{"start_seconds":4558,"text":"uh the key uh to the crypto data uh it was a nice cool experiment uh and uh it","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4558s"},{"start_seconds":4566,"text":"works very well uh we just need to probably to have some Primitives uh that","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4566s"},{"start_seconds":4572,"text":"uh make it easier to work with this direction um yeah I think that's uh all","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4572s"},{"start_seconds":4580,"text":"for today that I wanted to cover um is there anything in the chat that we want to discuss as","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4580s"},{"start_seconds":4589,"text":"well no no nothing today I think um this is I like the the pacing that we're going at here though of putting all","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4589s"},{"start_seconds":4597,"text":"these pieces together here and uh I want to remind people who are watching this that you know it's better to kind of go","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4597s"},{"start_seconds":4606,"text":"if you didn't watch one from last week watch that see how it connects here with this one and then we'll keep kind of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4606s"},{"start_seconds":4612,"text":"building from there because the better and deeper understanding you have of how this all works I feel like it's easier","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4612s"},{"start_seconds":4621,"text":"to then go build on top of it um so that's hopefully what they're getting from","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4621s"},{"start_seconds":4628,"text":"yeah yeah definitely to tooling on near makes it very easy to Deep dive into very neat details of many things uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4628s"},{"start_seconds":4637,"text":"still you need to know what exactly you want to look at I would imagine if you just randomly stumble on and into view","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4637s"},{"start_seconds":4646,"text":"storage and open this nonsense especially of a bigger contract you would have no idea what you're looking","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4646s"},{"start_seconds":4652,"text":"at I hope today we uh uncovered this mystery and it's now we all can be","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4652s"},{"start_seconds":4658,"text":"machines and read it absolutely perfect awesome H know this is awesome so let's","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4658s"},{"start_seconds":4666,"text":"just remind everybody so um this is Again part of the redacted hackathon workshops but we're going to keep going through even after redacted is over uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4666s"},{"start_seconds":4674,"text":"you have until the 31st to submit uh to the hackathon which we are you know really excited about there's over","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4674s"},{"start_seconds":4683,"text":"$700,000 in prizes here uh almost at, 1500 participants so it's really exciting there's tons of stuff you can","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4683s"},{"start_seconds":4691,"text":"do you can stack bounties uh so take your time and go through that uh again everything you're learning here all","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4691s"},{"start_seconds":4699,"text":"coincides with what's what's available there if you are able to go interested in going to the uh actual event in","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4699s"},{"start_seconds":4707,"text":"Bangkok uh there's still some time to sign up for tickets make sure you're doing that that's coming up really fast here can't believe we're at the end of","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4707s"},{"start_seconds":4715,"text":"October already but uh yeah just keep building come ask questions uh we are available","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4715s"},{"start_seconds":4723,"text":"as as devhub and as as developers in the different telegram chats let me pull those up real quick uh for people so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4723s"},{"start_seconds":4731,"text":"they can see those as well yeah and definitely subscribe for the newsletter there is a lot of uh yes","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4731s"},{"start_seconds":4738,"text":"cool ideas shared by developers we collect all of that together recently there was a C library to interact with","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4738s"},{"start_seconds":4745,"text":"the with near blockchain so you can use it on your you know router on your","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4745s"},{"start_seconds":4751,"text":"network switch and uh yeah yeah the possibilities here I mean there's just","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4751s"},{"start_seconds":4757,"text":"so much that's going on and uh we really want to encourage everyone to build as much as possible um so ple please do so","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4757s"},{"start_seconds":4766,"text":"uh I thought I had a easy Banner here but let's uh it's just simply here ah yes R SL let's not forget about that you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4766s"},{"start_seconds":4775,"text":"want to talk about that really quick yeah well uh it's a fun way to contribute to the open source um as you go no no CH major changes to your flow","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4775s"},{"start_seconds":4784,"text":"you just create a pull request you go and tag Ros loss account um and uh um","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4784s"},{"start_seconds":4793,"text":"you will be greeted with a with your nice uh um beige uh with all","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4793s"},{"start_seconds":4800,"text":"your achievements so far and the maintainer would be helping you to collect the SLO points by scoring the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4800s"},{"start_seconds":4809,"text":"poqu you create with just it's just a reflection of kind of U value and uh","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4809s"},{"start_seconds":4817,"text":"complexity of the problem you tackle overall I think all the contributions are valuable uh but still like it's a","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4817s"},{"start_seconds":4824,"text":"bit of a gamification process here that you can um you know um add a bit more","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4824s"},{"start_seconds":4832,"text":"source to your day-to-day um yeah absolutely life yeah for sure for sure yeah so check that out uh I added the","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4832s"},{"start_seconds":4840,"text":"link to the telegram chat for developer support on the screen so guys check out that as well come in ask questions no","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4840s"},{"start_seconds":4847,"text":"bad questions you know between the Devils here through devhub as well as just other builders in the community someone's gonna be there to help you and","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4847s"},{"start_seconds":4855,"text":"answer your questions and so Jump On In uh we hope to see what uh you guys are building out there so again uh we'll see","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4855s"},{"start_seconds":4863,"text":"you we'll be back next week um but until then uh keep hacking away we'll see you then by now","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4863s"},{"start_seconds":4870,"text":"amazing see you","url":"https://www.youtube.com/watch?v=6Vx-gE5EFTk&t=4870s"}],"youtube_url":"https://youtube.com/watch?v=6Vx-gE5EFTk","url":"https://near-pedia.xyz/videos/6Vx-gE5EFTk"}